1 // 18650 is ~18mm diameter, ~65mm length,
4 batt_clip_h = 0.75 * batt_diam;
21 side_protrusion_len = 10;
22 side_protrusion_diam = 2;
24 base_batt_extend = wall+pcb_thick; // extend the base on the battery side
30 s2_xoff = -160 * 25.4/1000;
31 led_xoff = 90 * 25.4/1000;
32 s1_xoff = 340 * 25.4/1000;
35 pcb_clip_off = led_xoff + pcb_clip_w/2;
38 translate([0, 0, base_h/2]) {
40 cube([batt_len + 2*wall + 2*cable_sep, batt_diam + 2*wall, base_h], center=true);
42 translate([0, -batt_diam/2-wall-pcb_thick/2-wall/2, 0])
43 cube([pcb_len + 2*wall, pcb_thick + wall + eps, base_h], center=true);
44 // battery-side extension
45 translate([0, batt_diam/2 + wall + base_batt_extend, -base_h/4+side_protrusion_diam/4])
46 cube([batt_len + 2*wall, eps, base_h/2+side_protrusion_diam/2], center=true);
50 module base_protrusions() {
51 // pcb-side side protrusion
52 translate([-side_protrusion_len/2, -batt_diam/2-2*wall-pcb_thick, base_h/2])
54 cylinder(r = side_protrusion_diam/2, h = side_protrusion_len, $fn = 6);
56 // battery-side side protrusion
57 translate([-side_protrusion_len/2, batt_diam/2+wall+base_batt_extend, base_h/2])
59 cylinder(r = side_protrusion_diam/2, h = side_protrusion_len, $fn = 6);
63 // rear part of the PCB holder (behind S1)
64 translate([pcb_clip_off, -batt_diam/2-wall-pcb_thick+eps, 0])
65 cube([pcb_clip_w, pcb_thick+wall, pcb_width + wall + base_h - pcb_groove]);
66 // side part of the PCB holder (near the battery wires)
67 translate([-pcb_len/2-wall, -batt_diam/2-pcb_thick-2*wall, 0])
68 cube([pcb_groove+wall, pcb_thick+2*wall+eps, pcb_width + wall + base_h - pcb_groove]);
74 // rear part of the battery clip
75 translate([-(batt_len/2-pcb_len/2+pcb_groove+wall)/2-pcb_len/2+pcb_groove, 0, batt_clip_h/2+wall/2])
76 cube([batt_len/2-pcb_len/2+pcb_groove + wall, batt_diam + 2*wall, batt_clip_h + wall], center=true);
77 // front (+) part of the battery clip
78 translate([batt_len/2+wall/2, 0, batt_clip_h/2+wall/2])
80 cube([wall, batt_diam + 2*wall, batt_clip_h + wall], center=true);
81 translate([-10/2, 0, -batt_clip_h/2])
82 cube([10, batt_diam+2*wall, wall], center=true);
85 translate([pcb_clip_off+pcb_clip_w/2, 0, batt_clip_h/2+wall/2])
87 cube([pcb_clip_w, batt_diam + 2*wall, batt_clip_h + wall], center=true);
88 translate([0, 0, -batt_clip_h/2])
89 cube([2*pcb_clip_w, batt_diam+2*wall, wall], center=true);
94 translate([0, 0, infty/4 + wall + batt_diam/2])
95 cube([infty/2, infty/2, infty/2], center=true);
96 translate([-infty/2, 0, batt_diam/2+wall])
98 cylinder(r=batt_diam/2+wall, h = infty);
105 translate([-batt_len/2, 0, batt_diam/2+wall])
107 cylinder(r=batt_diam/2, h = batt_len);
119 translate([0, -batt_diam/2-wall-pcb_thick/2, base_h - pcb_groove + pcb_width/2])
120 cube([pcb_len, pcb_thick, pcb_width], center=true);
123 // 4 wire holes at the battery ends
124 for (j=[-wire_sep/2, wire_sep/2])
125 for (i=[-wire_sep/2, wire_sep/2])
126 translate([-infty/2, i, batt_diam/2 + wall+j])
129 cylinder(r=wire_thick/2, h = infty, $fn=6);
131 // holes for wire from battery to the PCB
132 translate([-infty/2, -batt_diam/2, wall + pcb_groove + wire_thick/2])
135 cylinder(r=wire_thick/2, h = infty, $fn=6);
136 // hole for the cable outlet
137 translate([-pcb_len/2+pcb_groove+cable_out_diam/2, -batt_diam/2-pcb_thick-2*wall, -infty/2])
138 cylinder(r=cable_out_diam/2, h = infty, $fn=6);
139 // holes for binding to the shoe
141 pcb_len/2 + wall + wire_thick/2 + wire_sep,
142 pcb_len/2 + wall + wire_thick/2,
143 -pcb_len/2 - wall - wire_thick/2 - wire_sep,,
144 -pcb_len/2 - wall - wire_thick/2 ]) {
146 translate([x, y*(batt_diam/2 + wall + wire_thick/2), -infty/2])
147 cylinder(r=wire_thick/2, h=infty, $fn=6);
153 module cover_internal() {
156 // battery + wall + cable space
157 translate([-batt_len/2-wall, 0, batt_diam/2+wall])
159 cylinder(r=batt_diam/2+wall, h = batt_len + 2*wall);
161 translate([-pcb_len/2-wall, -batt_diam/2-2*wall-pcb_thick, base_h-pcb_groove])
162 cube([pcb_len+2*wall, wall+pcb_thick, pcb_width+wall]);
166 module cover_hole() {
169 translate([-infty/2, -infty/2, wall + batt_clip_h])
174 translate([-batt_len/2-cable_sep, 0, batt_diam/2+wall])
176 cylinder(r=batt_diam/2, h = batt_len + 2*cable_sep);
183 sphere(wall+cover_sep, $fn=16);
187 sphere(cover_sep, $fn=8);
190 translate([s2_xoff, 0, base_h-pcb_groove + pcb_width/2])
192 cylinder(r=uswitch_diam/2, h = infty, $fn=6);
194 translate([led_xoff, 0, base_h-pcb_groove + pcb_width/2])
196 cylinder(r=led_diam/2, h = infty, $fn=6);
198 translate([s1_xoff, 0, base_h-pcb_groove + pcb_width/2])
200 cylinder(r=uswitch_diam/2, h = infty, $fn=6);
202 translate([0, 0, -infty/2]) cube(infty, center=true);
206 translate([0, -19, 0])
209 // translate([0, -40, 0])
213 // translate([0, 17, batt_diam + 3*wall + cover_sep])
214 // rotate([180, 0, 0])
217 translate([0, 19, 0])