3 - mozna sirsi misto na baterku?
4 - vetsi vybrani pro baterku ve vicku
5 - kuzelova dira pro tlacitka
6 - jine diry pro uchyceni
7 - zvetsit vybrani na strane tlacitek
8 - mozna prilis velky klip zasunovaciho konce baterky
9 - diry pro neizolovany drat muzou byt mensi
11 - mensi horni cast klipu baterky - pri 0.7 je sirka nahore 16 mm.
19 wall = 1.5; // generic wall thickness
21 // 18650 is ~18mm diameter, ~65mm length,
28 front_flat_len = batt_len + 2*wall + 2*cable_sep;
30 // PCB-related dimensions
31 pcb_len = 36 + 1; // length of the board
32 pcb_width = 11 + 0.5; // width of the board
33 pcb_thick = 1.2 + 0.3; // thickness of the board
34 pcb_comp_h = 2.2; // height of the components on board
37 body_top_h = 0.30 * batt_diam; // cube-shaped part of the body
43 pcbside_protrusion_len = 20;
44 pcbside_protrusion_diam = 2.5;
45 battside_protrusion_len = 10;
46 battside_protrusion_diam = 2;
48 base_batt_extend = wall + pcb_thick; // extend the base on the battery side
54 sw_xoff = 250 * 25.4/1000; // x offset of microswitches
57 pcb_clip_off = led_xoff + pcb_clip_w/2;
61 translate([-batt_len/2, 0, 0])
63 cylinder(r=batt_diam/2, h = batt_len);
68 translate([-batt_len/2-wall-cable_sep, -batt_diam/2-wall, 0])
69 cube([batt_len + 2*wall + 2*cable_sep,
70 batt_diam+2*wall, body_top_h]);
72 translate([-batt_len/2-wall-cable_sep, 0, 0])
74 cylinder(r=batt_diam/2+wall,
75 h = batt_len + 2*wall + 2*cable_sep);
76 translate([-infty/2, -infty/2, eps]) cube(infty);
78 translate([-front_flat_len/2,
79 batt_diam/2 - pcb_width,
80 -batt_diam/2-2*pcb_comp_h-pcb_thick-wall])
81 cube([front_flat_len, pcb_width+wall, eps]);
83 translate([-batt_len/2 - 2*wall - cable_sep, 0, 0])
85 cylinder(r = 1.414*wire_sep + wire_thick,
86 h = batt_len + 4*wall + 2*cable_sep);
94 // upper cube-shaped part
96 translate([-batt_len/2, -batt_diam/2, 0])
97 cube([batt_len, batt_diam, batt_diam]);
99 // battery cylinder for the lower part
100 translate([-batt_len/2, 0, 0])
102 cylinder(r=batt_diam/2, h = batt_len);
105 translate([-pcb_len/2,
106 batt_diam/2-pcb_width,
107 -batt_diam/2-pcb_thick - pcb_comp_h])
108 cube([pcb_len, pcb_width,
109 batt_diam/2 + pcb_thick + pcb_comp_h + eps]);
110 // hole under the PCB
111 translate([-pcb_len/2+pcb_groove,
112 batt_diam/2-pcb_width + pcb_groove,
113 -batt_diam/2-pcb_thick - 2*pcb_comp_h])
114 cube([pcb_len-2*pcb_groove, pcb_width-2*pcb_groove,
115 batt_diam/2 + pcb_thick + pcb_comp_h + eps]);
117 translate([0, batt_diam/2-pcb_width/2, -infty/2]) {
118 cylinder(r=led_diam/2, h=infty, $fn=6);
119 translate([sw_xoff, 0, 0])
120 cylinder(r=sw_diam/2, h=infty, $fn=6);
121 translate([-sw_xoff, 0, 0])
122 cylinder(r=sw_diam/2, h=infty, $fn=6);
124 // space under the wire holes for battery contacts
125 translate([-batt_len/2-wall-cable_sep-eps, 0, 0])
128 cylinder(r = batt_diam/2-wall, h = batt_len + 2*wall + 2*cable_sep + 2*eps);
129 translate([-infty/2, -infty/2, -body_top_h])
132 // wire holes for battery contacts
135 translate([-batt_len/2-wall-eps, x*wire_sep/2, y*wire_sep/2])
137 cylinder(r = wire_thick/2, h = batt_len + 2*wall + 2*eps, $fn=6);
138 // wire hole from PCB to battery contacts
139 // translate([-batt_len/2-wall-eps, 0, -batt_diam/2-pcb_comp_h + wire_thick/2])
141 translate([-batt_len/2-wall-eps, 0, -batt_diam/2 - wall/2 - wire_thick/2])
143 cylinder(r = wire_thick/2, h = batt_len + 2*wall + 2*eps, $fn=6);
144 // hole behind the battery contacts
146 scale([x, 1, 1]) translate([batt_len/2+wall, 0, 0]) hull() {
147 translate([0, -batt_diam/2, 0])
148 cube([cable_sep + eps, batt_diam, infty]);
150 cylinder(r = batt_diam/2, h = cable_sep+eps);
151 translate([0, batt_diam/2 - pcb_width,
152 -batt_diam/2-pcb_comp_h-pcb_thick])
153 cube([cable_sep + eps, pcb_width, eps]);
159 translate([-batt_len/2 + eps, -batt_diam/2, -batt_diam/2-eps])
160 cube([batt_len - 2*eps, batt_diam, batt_diam/2 - body_top_h + wall + eps]);
161 translate([-batt_len/2 - wall - cable_sep, -batt_diam/2 - wall,
163 cube([batt_len + 2*wall + 2*cable_sep, batt_diam + 2*wall,
164 wall + batt_diam/2 - body_top_h]);
165 // clip behind the battery contacts
167 scale([x, 1, 1]) translate([batt_len/2+cable_sep, 0, 0]) hull() {
168 translate([0, -batt_diam/2, -batt_diam/2])
169 cube([wall, batt_diam, eps]);
171 cylinder(r = batt_diam/2, h = wall);
172 translate([0, batt_diam/2 - pcb_width,
173 batt_diam/2+pcb_comp_h+pcb_thick])
174 cube([wall, pcb_width, eps]);
181 translate([-batt_len/2-eps, 0, 0]) rotate([0, 90, 0])
182 cylinder(r=batt_diam/2, h=batt_len+2*eps);
187 color("lightblue", 0.2)
188 translate([-65/2, 0, 0])
190 cylinder(r=18/2, h=65);
192 translate([0, 30, 0]) case($fn=128);