- // holes for wire from battery to the PCB
- translate([-infty/2, -batt_diam/2, base_h + wire_thick/2])
- rotate([0, 90, 0])
- 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);
+ // hole for PCB
+ translate([-pcb_len/2,
+ 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 under the PCB
+ translate([-pcb_len/2+pcb_groove,
+ 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]);
+ // 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-wall-cable_sep-eps, 0, 0])
+ difference() {
+ rotate([0, 90, 0])
+ cylinder(r = batt_diam/2-wall, h = batt_len + 2*wall + 2*cable_sep + 2*eps);
+ translate([-infty/2, -infty/2, -body_top_h])
+ cube(infty);