3 include <commitid.scad>
5 include <sealing-box.scad>
6 include <bike-lipo-box-gland.scad>
8 pxp6012_rad = 22.5 / 2 + 0.5; // make circular hole this size in outer wall
9 pxp6012_rad_outer = 32.0 / 2 - 0.5;
13 s1930_y_outer = 36.4 + 0.2;
14 s1930_x_outer = 27.6 + 0.2;
20 jdae12pa_rad = 12 / 2 + 0.5;
21 jdae12pa_rad_outer = 19 / 2 + 0.5; // head of an "M12 bolt"
40 lipokeeper_slope = 0.75;
41 lipokeeper_end_h = 12;
42 lipokeeper_end_d_min = 15;
44 straps_at_box = [45, 95, 125, 160];
49 totx_outer = totx_inner + wallthick*2;
50 toty_inner = toty_outer - wallthick*2;
51 totz_outer = totz_inner + wallthick*2;
53 sb_box_sz = [totx_outer, totz_outer, toty_inner];
55 // origin is at centre on outer face wall
56 // outside is towards positive x
57 // mounting is vertical
58 module S1930_Positive(){
59 d = s1930_recess + s1930_behind;
60 translate([-d/2, 0,0])
62 s1930_x_outer + s1930_around,
63 s1930_y_outer + s1930_around], center=true);
65 module S1930_Negative(){
66 cube([60, s1930_x, s1930_y],
69 cube([s1930_recess*2+2, s1930_x_outer, s1930_y_outer],
73 module TestWall(){ ////toplevel
74 sw_ctr = [25, wallthick, 25];
79 cube([50, wallthick, 42]);
82 translate([30, -1, 20])
84 cylinder(r = pxp6012_rad, h=10, $fn=60);
87 Commitid_BestCount([15,40]);
93 cube([50, wallthick, 50]);
110 ts_box_sz = [ts_totx, ts_toty, ts_totz_inner];
112 $sealingbox_wallth = wallthick;
113 $sealingbox_floorth = wallthick;
114 $sealingbox_ceilth = wallthick;
116 module TestSealBox(){ ////toplevel
117 $sealingbox_sz = ts_box_sz;
119 SealingBox_RectBox();
120 ts_cidoff = ($sealingbox_cnrrad * (1-.7) + wallthick * .8) * [1,1];
122 Commitid_BestCount([ts_totx,ts_toty] - 2*ts_cidoff);
125 module TestSealLid(){ ////toplevel
126 $sealingbox_sz = ts_box_sz;
129 SealingBox_RectLid();
131 translate([ts_totx * .75, ts_toty/2, 0])
132 cylinder(h=100, r=5);
134 translate([-wallthick + $sealingbox_cnrrad*.5,
135 $sealingbox_cnrrad*.5 - wallthick,
136 ts_totz_inner + $sealingbox_ceilth])
137 Commitid_BestCount([ts_totx * .75 - 2.5 - ($sealingbox_cnrrad*.5),
138 ts_toty - ($sealingbox_cnrrad*.5 - wallthick)*2]);
142 module TestSealLidPrint(){ ////toplevel
143 rotate([180,0,0]) TestSealLid();
146 module ProfileDemos(){ ////toplevel
147 $sealingbox_sz = ts_box_sz;
149 SealingBox_WallProfile();
150 color("blue") SealingBox_FloorProfile();
151 SealingBox_LidProfile();
152 color("blue") SealingBox_CeilProfile();
153 color("red") translate([-5,0]) square([1,ts_totz_inner]);
157 for (dgy=[-15,-45]) {
158 translate([totx_inner + wallthick - $sealingbox_cnrrad * .3,
165 module StrapKeepers(at){
166 strap_x_tot = strap_w + strap_pillar*2;
169 echo("strapkeeper at ",sx);
170 translate([sx - strap_x_tot, 0, 0])
172 translate([0,0, -0.1])
173 cube([strap_x_tot, strap_pillard, strap_th + strap_over]);
174 translate([strap_pillar, -1, 0])
175 cube([strap_w, strap_pillard+2, strap_th]);
180 chargingconn_x = pxp6012_rad_outer + 1 + $sealingbox_cnrrad;
181 switch_x = chargingconn_x + pxp6012_rad_outer
182 + s1930_y_outer/2 + s1930_around;
184 module AtSealingBox(){
186 translate([-wallthick,-wallthick, -toty_inner])
190 module Box(){ ////toplevel
191 $sealingbox_sz = sb_box_sz;
196 SealingBox_RectBox();
198 translate([switch_x, toty_inner, totz_inner/2])
203 for (keepers= [[ 35, lipokeeper_d_min, lipokeeper_h,
204 [ 40, 80, 120, 150 ] ],
205 [ 10, lipokeeper_end_d_min, lipokeeper_end_h,
207 // each entry: [ y, d_min, h, [ x, ...] ]
209 for (kx= keepers[3]) {
210 translate([kx, keepers[0], -1])
212 cube([lipokeeper_w, keepers[1], keepers[2] +1]);
214 keepers[1] + keepers[2] / lipokeeper_slope,
220 GlandPositive(cabledia);
222 translate([0, toty_inner+wallthick, -wallthick])
224 StrapKeepers(straps_at_box);
227 // charging connector
228 translate([chargingconn_x,
229 toty_inner - (pxp6012_rad_outer + 5),
231 cylinder(r= pxp6012_rad, h= totz_outer);
234 translate([chargingconn_x,
235 toty_inner - (pxp6012_rad_outer*2 + 5 + 15 +
238 cylinder(r= jdae12pa_rad, h= totz_outer);
240 translate([switch_x, toty_inner, totz_inner/2])
245 GlandNegative(cabledia);
247 translate(-$sealingbox_cnrrad * [1,1,0] +
248 [totx_inner, toty_inner/2, -wallthick])
255 module BoxPrint(){ ////toplevel
260 module Lid(){ ////toplevel
261 $sealingbox_sz = sb_box_sz;
265 SealingBox_RectLid();
266 translate([0, -wallthick, -SealingBox_lidbigger()])
268 StrapKeepers([ straps_every : straps_every
269 : totx_inner-straps_every ]);
272 translate($sealingbox_cnrrad * [1,0,1])
275 Commitid_Small16_M();
279 module LidPrint(){ ////toplevel
284 module Demo(){ ////toplevel
293 //FArcSegment_mask(350);