-lowres = 0;
+lowres = 0; // fast rendering or fine printing with print-friendly orientation
eps = 0.01;
infty = 300;
prg_len = 10; // programming connector
prg_width = 7;
+rear_clip_hole_dist = 10; // distance between the holes in the rear clip
+rear_clip_aspect = 0.35; // w/h aspect ratio of the ellipse of the rear clip
+
module case_body() {
hull() {
translate([-batt_len/2-2*wall-cable_sep, -batt_diam/2-wall, 0])
-batt_diam/2-2*pcb_comp_h-pcb_thick-wall])
cube([front_flat_len, pcb_width+wall, eps]);
};
+ for (x = [-1, 1]) scale([x, 1, 1]) hull() {
+ for (x0 = [0-wall, 10+wall])
+ translate([batt_len/2-wall-wire_thick-x0, batt_diam/2, 0])
+ rotate([-90, 0, 0]) scale([rear_clip_aspect, 1, 1])
+ cylinder(r=batt_diam/2 + 2*wall + wire_thick, h=wall);
+ };
};
module case() {
vert_torus();
for (x = [-1, 1]) scale([x, 1, 1]) for (x0 = [0, 10])
- translate([batt_len/2-wall-wire_thick-x0, 0, batt_end_h-wire_thick/2])
+ translate([batt_len/2-wall-wire_thick-x0, 0, batt_diam/2+wire_thick/2+wall])
rotate([-90, 0, 0])
scale([2,1,1]) cylinder (r=wire_thick/2, h=infty, $fn=16);
};
translate([-batt_len/2-cable_sep-wall, batt_diam/2-pcb_width+0.5*wall+0.5*lid_sep, batt_diam/2 + pcb_comp_h+pcb_thick-wall-lid_sep])
cube([batt_len + 2*wall + 2* cable_sep, pcb_width-1.5*wall-1.5*lid_sep, eps]);
};
+ // holes for the mounting clips on the body
+ for (x = [-1, 1]) scale([x, 1, 1]) hull() {
+ for (x0 = [0-wall, 10+wall])
+ translate([batt_len/2-wall-wire_thick-x0, batt_diam/2-lid_sep+eps, 0])
+ rotate([-90, 0, 0]) scale([rear_clip_aspect, 1, 1])
+ cylinder(r=batt_diam/2 + 2*wall + wire_thick+lid_sep/rear_clip_aspect, h=wall+lid_sep+eps);
+ };
};
};