8 // 2x 18650 side by side
16 batt_d = batt_d_real + batt_sep;
22 body_h = 0.8*batt_d_real;
23 cyl_center_h = batt_l/3;
25 // z-offset from the widest point of the battery to the widest
27 top_clip_h = 0.25*batt_d;
30 // outer part of the spring
31 d_out = batt_d/2-spring_sep/2;
32 // inner part of the spring
33 d_in = d_out/2-wall/2-spring_sep/2; // batt_d/4-3*wall/4;
34 // straight part length
35 straight_l = batt_l + 3*wall/2 + d_out/2;
37 module cyl_arc(d, h, beg, end) {
39 cylinder(r = d/2+wall/2, h = h, $fn = 64);
40 translate([0, 0, -eps])
41 cylinder(r = d/2-wall/2, h=h+2*eps, $fn = 64);
46 translate([-infty/2, 0, -eps])
49 translate([-infty/2, 0, -eps])
56 translate([-infty/2, 0, -eps])
58 rotate([0, 0, end-180])
60 translate([-infty/2, 0, -eps])
71 translate([-batt_d/2-wall, 0, 0])
72 cube([batt_d + 2*wall, straight_l, body_h]);
73 // upper part at the - pole
74 translate([-batt_d/2, wall, batt_d/2])
75 cube([batt_d, (batt_l-cyl_center_h)/2, batt_d + 2*eps]);
77 translate([0, wall, batt_d_real/2])
79 cylinder(r = batt_d/2, h = straight_l, $fn = 64);
80 // upper part of the clip
81 translate([0, wall, batt_d_real/2+2*top_clip_h])
83 cylinder(r = batt_d/2, h = straight_l, $fn = 64);
84 // upper part at the + pole
85 translate([-batt_d/2, wall+(batt_l-cyl_center_h)/2+cyl_center_h, batt_d/2])
86 cube([batt_d, (batt_l-cyl_center_h)/2, batt_d + 2*eps]);
87 // at the clip - sides only
88 translate([-batt_d/2, batt_l, -eps])
89 cube([batt_d, straight_l-batt_l+eps, batt_d + 2*eps]);
94 // spring, x-axis cenered, to be connected by y-minus axis
96 for (x = [-1, 1]) scale([x, 1, 1]) {
98 translate([d_out/2+wall/2+spring_sep/2, 0, 0])
99 cyl_arc(d_out, body_h, 0-eps, 180+eps);
100 // inner center d_in arc
101 translate([spring_sep/2+wall/2+d_in/2, 0, 0])
102 cyl_arc(d_in, body_h, 180, 360+eps);
103 // outer center d_in arc
104 translate([spring_sep/2+wall/2+3*d_in/2, 0, 0])
105 cyl_arc(d_in, body_h, -eps, 180+eps);
106 // innermost d_out arc
107 translate([2*d_in+wall/2+spring_sep/2-d_out/2, 0, 0])
108 cyl_arc(d_out, body_h, 270-eps, 360+eps);
111 translate([-2*d_in-spring_sep/2-wall/2+d_out/2, -d_out/2-wall/2, 0])
112 cube([4*d_in+spring_sep+wall-d_out, wall, body_h]);
120 translate([0, straight_l, 0])
124 for (z = [batt_d_real/2-wire_h-wire_sep/2,
125 batt_d_real/2+wire_sep/2]) {
126 translate([-wire_w/2, -eps, z])
127 cube([wire_w, batt_l+2*wall+2*eps, wire_h]);
133 translate([batt_d+wall, straight_l + d_out/2, 0])