- rotate([0, 0, 90])
- cylinder(r=wire_thick/2, h = infty, $fn=6);
- // hole for the cable outlet
- translate([-pcb_len/2+pcb_groove+cable_out_diam/2, -batt_diam/2-pcb_thick-2*wall, -infty/2])
- cylinder(r=cable_out_diam/2, h = infty, $fn=6);
- // holes for binding to the shoe
- for (x = [
- pcb_len/2 + wall + wire_thick/2 + wire_sep,
- pcb_len/2 + wall + wire_thick/2,
- -pcb_len/2 - wall - wire_thick/2 - wire_sep,,
- -pcb_len/2 - wall - wire_thick/2 ]) {
- for (y = [-1,1]) {
- translate([x, y*(batt_diam/2 + wall + wire_thick/2), -infty/2])
- cylinder(r=wire_thick/2, h=infty, $fn=6);
+ cylinder(r=batt_diam/2, h = batt_len);
+
+ // hole for PCB
+ translate([-pcb_len/2-pcb_xoff,
+ batt_diam/2-pcb_width,
+ -batt_diam/2-pcb_thick - pcb_comp_h])
+ cube([pcb_len, pcb_width,
+ batt_diam/2 + pcb_thick + pcb_comp_h + eps]);
+ // hole above the PCB for the outgoing cable
+ translate([-pcb_len/2-pcb_xoff-2*wall-outcable_w,
+ batt_diam/2-pcb_width,
+ -batt_diam/2-pcb_comp_h])
+ cube([pcb_len, pcb_width,
+ batt_diam/2 + pcb_comp_h + eps]);
+ // cable outlet
+ translate([-pcb_xoff-pcb_len/2-wall-outcable_w,
+ -pcb_width+batt_diam/2,
+ -batt_diam/2-outcable_h])
+ cube([outcable_w, infty, outcable_h]);
+ // hole under the PCB
+ translate([-pcb_len/2+pcb_groove-pcb_xoff,
+ batt_diam/2-pcb_width + pcb_groove,
+ -batt_diam/2-pcb_thick - 2*pcb_comp_h])
+ cube([pcb_len-2*pcb_groove, pcb_width-2*pcb_groove,
+ batt_diam/2 + pcb_thick + pcb_comp_h + eps]);
+ // hole for prog connector
+ translate([pcb_len/2-pcb_xoff-pcb_groove-eps,
+ batt_diam/2-pcb_width/2-prg_width/2,
+ -batt_diam/2-pcb_thick - 2*pcb_comp_h])
+ difference() {
+ cube([prg_len+pcb_groove+eps, prg_width,
+ batt_diam/2 + pcb_thick + pcb_comp_h + eps]);
+ translate([prg_len/2+pcb_groove, -eps, pcb_comp_h])
+ cube([prg_len/2+eps, prg_width+2*eps, pcb_thick]);
+ };
+ // LED hole
+ translate([0, batt_diam/2-pcb_width/2, -infty/2]) {
+ cylinder(r=led_diam/2, h=infty, $fn=6);
+ translate([sw_xoff, 0, 0])
+ cylinder(r=sw_diam/2, h=infty, $fn=6);
+ translate([-sw_xoff, 0, 0])
+ cylinder(r=sw_diam/2, h=infty, $fn=6);
+ };
+ // space under the wire holes for battery contacts
+ translate([-batt_len/2-2*wall-cable_sep-eps, 0, 0])
+ difference() {
+ rotate([0, 90, 0])
+ cylinder(r = batt_diam/2-wall, h = batt_len + 4*wall + 2*cable_sep + 2*eps);
+ translate([-infty/2, -infty/2, -batt_end_h])
+ cube(infty);