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;
39 straps_at_box = [45, 95, 125, 160];
44 totx_outer = totx_inner + wallthick*2;
45 toty_inner = toty_outer - wallthick*2;
46 totz_outer = totz_inner + wallthick*2;
48 sb_box_sz = [totx_outer, totz_outer, toty_inner];
50 // origin is at centre on outer face wall
51 // outside is towards positive x
52 // mounting is vertical
53 module S1930_Positive(){
54 d = s1930_recess + s1930_behind;
55 translate([-d/2, 0,0])
57 s1930_x_outer + s1930_around,
58 s1930_y_outer + s1930_around], center=true);
60 module S1930_Negative(){
61 cube([60, s1930_x, s1930_y],
64 cube([s1930_recess*2+2, s1930_x_outer, s1930_y_outer],
68 module TestWall(){ ////toplevel
69 sw_ctr = [25, wallthick, 25];
74 cube([50, wallthick, 42]);
77 translate([30, -1, 20])
79 cylinder(r = pxp6012_rad, h=10, $fn=60);
82 Commitid_BestCount([15,40]);
88 cube([50, wallthick, 50]);
105 ts_box_sz = [ts_totx, ts_toty, ts_totz_inner];
107 $sealingbox_wallth = wallthick;
108 $sealingbox_floorth = wallthick;
109 $sealingbox_ceilth = wallthick;
111 module TestSealBox(){ ////toplevel
112 $sealingbox_sz = ts_box_sz;
114 SealingBox_RectBox();
115 ts_cidoff = ($sealingbox_cnrrad * (1-.7) + wallthick * .8) * [1,1];
117 Commitid_BestCount([ts_totx,ts_toty] - 2*ts_cidoff);
120 module TestSealLid(){ ////toplevel
121 $sealingbox_sz = ts_box_sz;
124 SealingBox_RectLid();
126 translate([ts_totx * .75, ts_toty/2, 0])
127 cylinder(h=100, r=5);
129 translate([-wallthick + $sealingbox_cnrrad*.5,
130 $sealingbox_cnrrad*.5 - wallthick,
131 ts_totz_inner + $sealingbox_ceilth])
132 Commitid_BestCount([ts_totx * .75 - 2.5 - ($sealingbox_cnrrad*.5),
133 ts_toty - ($sealingbox_cnrrad*.5 - wallthick)*2]);
137 module TestSealLidPrint(){ ////toplevel
138 rotate([180,0,0]) TestSealLid();
141 module ProfileDemos(){ ////toplevel
142 $sealingbox_sz = ts_box_sz;
144 SealingBox_WallProfile();
145 color("blue") SealingBox_FloorProfile();
146 SealingBox_LidProfile();
147 color("blue") SealingBox_CeilProfile();
148 color("red") translate([-5,0]) square([1,ts_totz_inner]);
152 for (dgy=[-15,-45]) {
153 translate([totx_inner + wallthick - $sealingbox_cnrrad * .3,
160 module StrapKeepers(at){
161 strap_x_tot = strap_w + strap_pillar*2;
164 echo("strapkeeper at ",sx);
165 translate([sx - strap_x_tot, 0, 0])
167 translate([0,0, -0.1])
168 cube([strap_x_tot, strap_pillard, strap_th + strap_over]);
169 translate([strap_pillar, -1, 0])
170 cube([strap_w, strap_pillard+2, strap_th]);
175 chargingconn_x = pxp6012_rad_outer + 1 + $sealingbox_cnrrad;
176 switch_x = chargingconn_x + pxp6012_rad_outer
177 + s1930_y_outer/2 + s1930_around;
179 module AtSealingBox(){
181 translate([-wallthick,-wallthick, -toty_inner])
185 module Box(){ ////toplevel
186 $sealingbox_sz = sb_box_sz;
191 SealingBox_RectBox();
193 translate([switch_x, toty_inner, totz_inner/2])
198 for (keepers= [[ 40, lipokeeper_d_min, [ 10, 40, 80, 120 ] ]])
199 for (kx= keepers[2]) {
200 translate([kx, keepers[0], -1])
202 cube([lipokeeper_w, keepers[1], lipokeeper_h +1]);
204 keepers[1] + lipokeeper_h / lipokeeper_slope,
210 GlandPositive(cabledia);
212 translate([0, toty_inner+wallthick, -wallthick])
214 StrapKeepers(straps_at_box);
217 // charging connector
218 translate([chargingconn_x,
219 toty_inner - (pxp6012_rad_outer + 5),
221 cylinder(r= pxp6012_rad, h= totz_outer);
223 translate([switch_x, toty_inner, totz_inner/2])
228 GlandNegative(cabledia);
230 translate($sealingbox_cnrrad * [1,1,0] +
231 [0, toty_inner/2, -wallthick])
236 module BoxPrint(){ ////toplevel
241 module Lid(){ ////toplevel
242 $sealingbox_sz = sb_box_sz;
246 SealingBox_RectLid();
247 translate([0, -wallthick, -SealingBox_lidbigger()])
249 StrapKeepers([ straps_every : straps_every
250 : totx_inner-straps_every ]);
253 translate($sealingbox_cnrrad * [1,0,1])
259 module LidPrint(){ ////toplevel
264 module Demo(){ ////toplevel
273 //FArcSegment_mask(350);