+ case_body();
+ // upper cube-shaped part
+ // rotate([20, 0, 0])
+ translate([-batt_len/2, -batt_diam/2, 0])
+ cube([batt_len, batt_diam, batt_diam]);
+
+ // battery cylinder for the lower part
+ translate([-batt_len/2, 0, 0])
+ rotate([0, 90, 0])
+ cylinder(r=batt_diam/2, h = batt_len);
+
+ // 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);