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;
37 lipokeeper_slope = 0.75;
38 lipokeeper_end_d_min = 15;
40 straps_at_box = [45, 95, 125, 160];
45 totx_outer = totx_inner + wallthick*2;
46 toty_inner = toty_outer - wallthick*2;
47 totz_outer = totz_inner + wallthick*2;
49 sb_box_sz = [totx_outer, totz_outer, toty_inner];
51 // origin is at centre on outer face wall
52 // outside is towards positive x
53 // mounting is vertical
54 module S1930_Positive(){
55 d = s1930_recess + s1930_behind;
56 translate([-d/2, 0,0])
58 s1930_x_outer + s1930_around,
59 s1930_y_outer + s1930_around], center=true);
61 module S1930_Negative(){
62 cube([60, s1930_x, s1930_y],
65 cube([s1930_recess*2+2, s1930_x_outer, s1930_y_outer],
69 module TestWall(){ ////toplevel
70 sw_ctr = [25, wallthick, 25];
75 cube([50, wallthick, 42]);
78 translate([30, -1, 20])
80 cylinder(r = pxp6012_rad, h=10, $fn=60);
83 Commitid_BestCount([15,40]);
89 cube([50, wallthick, 50]);
106 ts_box_sz = [ts_totx, ts_toty, ts_totz_inner];
108 $sealingbox_wallth = wallthick;
109 $sealingbox_floorth = wallthick;
110 $sealingbox_ceilth = wallthick;
112 module TestSealBox(){ ////toplevel
113 $sealingbox_sz = ts_box_sz;
115 SealingBox_RectBox();
116 ts_cidoff = ($sealingbox_cnrrad * (1-.7) + wallthick * .8) * [1,1];
118 Commitid_BestCount([ts_totx,ts_toty] - 2*ts_cidoff);
121 module TestSealLid(){ ////toplevel
122 $sealingbox_sz = ts_box_sz;
125 SealingBox_RectLid();
127 translate([ts_totx * .75, ts_toty/2, 0])
128 cylinder(h=100, r=5);
130 translate([-wallthick + $sealingbox_cnrrad*.5,
131 $sealingbox_cnrrad*.5 - wallthick,
132 ts_totz_inner + $sealingbox_ceilth])
133 Commitid_BestCount([ts_totx * .75 - 2.5 - ($sealingbox_cnrrad*.5),
134 ts_toty - ($sealingbox_cnrrad*.5 - wallthick)*2]);
138 module TestSealLidPrint(){ ////toplevel
139 rotate([180,0,0]) TestSealLid();
142 module ProfileDemos(){ ////toplevel
143 $sealingbox_sz = ts_box_sz;
145 SealingBox_WallProfile();
146 color("blue") SealingBox_FloorProfile();
147 SealingBox_LidProfile();
148 color("blue") SealingBox_CeilProfile();
149 color("red") translate([-5,0]) square([1,ts_totz_inner]);
153 for (dgy=[-15,-45]) {
154 translate([totx_inner + wallthick - $sealingbox_cnrrad * .3,
161 module StrapKeepers(at){
162 strap_x_tot = strap_w + strap_pillar*2;
165 echo("strapkeeper at ",sx);
166 translate([sx - strap_x_tot, 0, 0])
168 translate([0,0, -0.1])
169 cube([strap_x_tot, strap_pillard, strap_th + strap_over]);
170 translate([strap_pillar, -1, 0])
171 cube([strap_w, strap_pillard+2, strap_th]);
176 chargingconn_x = pxp6012_rad_outer + 1 + $sealingbox_cnrrad;
177 switch_x = chargingconn_x + pxp6012_rad_outer
178 + s1930_y_outer/2 + s1930_around;
180 module AtSealingBox(){
182 translate([-wallthick,-wallthick, -toty_inner])
186 module Box(){ ////toplevel
187 $sealingbox_sz = sb_box_sz;
192 SealingBox_RectBox();
194 translate([switch_x, toty_inner, totz_inner/2])
199 for (keepers= [[ 40, lipokeeper_d_min, [ 10, 40, 80, 120 ] ],
200 [ 20, lipokeeper_end_d_min, [ 135 ] ] ])
201 for (kx= keepers[2]) {
202 translate([kx, keepers[0], -1])
204 cube([lipokeeper_w, keepers[1], lipokeeper_h +1]);
206 keepers[1] + lipokeeper_h / lipokeeper_slope,
212 GlandPositive(cabledia);
214 translate([0, toty_inner+wallthick, -wallthick])
216 StrapKeepers(straps_at_box);
219 // charging connector
220 translate([chargingconn_x,
221 toty_inner - (pxp6012_rad_outer + 5),
223 cylinder(r= pxp6012_rad, h= totz_outer);
225 translate([switch_x, toty_inner, totz_inner/2])
230 GlandNegative(cabledia);
232 translate($sealingbox_cnrrad * [1,1,0] +
233 [0, toty_inner/2, -wallthick])
238 module BoxPrint(){ ////toplevel
243 module Lid(){ ////toplevel
244 $sealingbox_sz = sb_box_sz;
248 SealingBox_RectLid();
249 translate([0, -wallthick, -SealingBox_lidbigger()])
251 StrapKeepers([ straps_every : straps_every
252 : totx_inner-straps_every ]);
255 translate($sealingbox_cnrrad * [1,0,1])
261 module LidPrint(){ ////toplevel
266 module Demo(){ ////toplevel
275 //FArcSegment_mask(350);