1 // 18650 is ~18mm diameter, ~65mm length,
4 batt_clip_h = 0.75 * batt_diam;
20 translate([0, -batt_diam/2-wall-pcb_thick/2+eps, 0])
23 // lower part of the PCB holder
24 translate([0, 0, (pcb_groove + wall) / 2])
25 cube([pcb_len + 2*wall, pcb_thick + 2*wall, pcb_groove + wall], center=true);
26 // rear part of the PCB holder (behind S1)
27 translate([pcb_clip_off, 0, 0])
28 cube([pcb_clip_w, pcb_thick/2+wall/2, pcb_width + 2*wall]);
29 // side part of the PCB holder (near the battery wires)
30 translate([-pcb_len/2-wall, -pcb_thick/2-wall, 0])
31 cube([pcb_groove+wall, pcb_thick+1.5*wall, pcb_width + 2*wall]);
34 translate([0, 0, wall + pcb_width/2])
35 cube([pcb_len, pcb_thick, pcb_width+eps], center=true);
40 // lower part of the battery holder
41 translate([0, 0, pcb_groove/2 + wall/2])
42 cube([batt_len + 2*wall, batt_diam + 2*wall, pcb_groove + wall],
44 // rear part of the battery clip
45 translate([-(batt_len/2-pcb_len/2+pcb_groove+wall)/2-pcb_len/2+pcb_groove, 0, batt_clip_h/2+wall/2])
46 cube([batt_len/2-pcb_len/2+pcb_groove + wall, batt_diam + 2*wall, batt_clip_h + wall], center=true);
47 // front (+) part of the battery clip
48 translate([batt_len/2+wall/2, 0, batt_clip_h/2+wall/2])
50 cube([wall, batt_diam + 2*wall, batt_clip_h + wall], center=true);
51 translate([-10/2, 0, -batt_clip_h/2])
52 cube([10, batt_diam+2*wall, wall], center=true);
55 translate([pcb_clip_off+pcb_clip_w/2, 0, batt_clip_h/2+wall/2])
57 cube([pcb_clip_w, batt_diam + 2*wall, batt_clip_h + wall], center=true);
58 translate([0, 0, -batt_clip_h/2])
59 cube([2*pcb_clip_w, batt_diam+2*wall, wall], center=true);
63 translate([-batt_len/2, 0, batt_diam/2+wall])
65 cylinder(r=batt_diam/2, h = batt_len);
68 translate([0, 0, infty/4 + wall + batt_diam/2])
69 cube([infty/2, infty/2, infty/2], center=true);
70 translate([-infty/2, 0, batt_diam/2+wall])
72 cylinder(r=batt_diam/2+wall, h = infty);
75 for (j=[-wire_sep/2, wire_sep/2])
76 for (i=[-wire_sep/2, wire_sep/2])
77 translate([-infty/2, i, batt_diam/2 + wall+j])
80 cylinder(r=wire_thick/2, h = infty, $fn=6);
82 translate([-infty/2, -batt_diam/2, wall + pcb_groove + wire_thick/2])
85 cylinder(r=wire_thick/2, h = infty, $fn=6);