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_h = 12;
39 lipokeeper_end_d_min = 15;
41 straps_at_box = [45, 95, 125, 160];
46 totx_outer = totx_inner + wallthick*2;
47 toty_inner = toty_outer - wallthick*2;
48 totz_outer = totz_inner + wallthick*2;
50 sb_box_sz = [totx_outer, totz_outer, toty_inner];
52 // origin is at centre on outer face wall
53 // outside is towards positive x
54 // mounting is vertical
55 module S1930_Positive(){
56 d = s1930_recess + s1930_behind;
57 translate([-d/2, 0,0])
59 s1930_x_outer + s1930_around,
60 s1930_y_outer + s1930_around], center=true);
62 module S1930_Negative(){
63 cube([60, s1930_x, s1930_y],
66 cube([s1930_recess*2+2, s1930_x_outer, s1930_y_outer],
70 module TestWall(){ ////toplevel
71 sw_ctr = [25, wallthick, 25];
76 cube([50, wallthick, 42]);
79 translate([30, -1, 20])
81 cylinder(r = pxp6012_rad, h=10, $fn=60);
84 Commitid_BestCount([15,40]);
90 cube([50, wallthick, 50]);
107 ts_box_sz = [ts_totx, ts_toty, ts_totz_inner];
109 $sealingbox_wallth = wallthick;
110 $sealingbox_floorth = wallthick;
111 $sealingbox_ceilth = wallthick;
113 module TestSealBox(){ ////toplevel
114 $sealingbox_sz = ts_box_sz;
116 SealingBox_RectBox();
117 ts_cidoff = ($sealingbox_cnrrad * (1-.7) + wallthick * .8) * [1,1];
119 Commitid_BestCount([ts_totx,ts_toty] - 2*ts_cidoff);
122 module TestSealLid(){ ////toplevel
123 $sealingbox_sz = ts_box_sz;
126 SealingBox_RectLid();
128 translate([ts_totx * .75, ts_toty/2, 0])
129 cylinder(h=100, r=5);
131 translate([-wallthick + $sealingbox_cnrrad*.5,
132 $sealingbox_cnrrad*.5 - wallthick,
133 ts_totz_inner + $sealingbox_ceilth])
134 Commitid_BestCount([ts_totx * .75 - 2.5 - ($sealingbox_cnrrad*.5),
135 ts_toty - ($sealingbox_cnrrad*.5 - wallthick)*2]);
139 module TestSealLidPrint(){ ////toplevel
140 rotate([180,0,0]) TestSealLid();
143 module ProfileDemos(){ ////toplevel
144 $sealingbox_sz = ts_box_sz;
146 SealingBox_WallProfile();
147 color("blue") SealingBox_FloorProfile();
148 SealingBox_LidProfile();
149 color("blue") SealingBox_CeilProfile();
150 color("red") translate([-5,0]) square([1,ts_totz_inner]);
154 for (dgy=[-15,-45]) {
155 translate([totx_inner + wallthick - $sealingbox_cnrrad * .3,
162 module StrapKeepers(at){
163 strap_x_tot = strap_w + strap_pillar*2;
166 echo("strapkeeper at ",sx);
167 translate([sx - strap_x_tot, 0, 0])
169 translate([0,0, -0.1])
170 cube([strap_x_tot, strap_pillard, strap_th + strap_over]);
171 translate([strap_pillar, -1, 0])
172 cube([strap_w, strap_pillard+2, strap_th]);
177 chargingconn_x = pxp6012_rad_outer + 1 + $sealingbox_cnrrad;
178 switch_x = chargingconn_x + pxp6012_rad_outer
179 + s1930_y_outer/2 + s1930_around;
181 module AtSealingBox(){
183 translate([-wallthick,-wallthick, -toty_inner])
187 module Box(){ ////toplevel
188 $sealingbox_sz = sb_box_sz;
193 SealingBox_RectBox();
195 translate([switch_x, toty_inner, totz_inner/2])
200 for (keepers= [[ 35, lipokeeper_d_min, lipokeeper_h,
201 [ 10, 40, 80, 120 ] ],
202 [ 10, lipokeeper_end_d_min, lipokeeper_end_h,
204 // each entry: [ y, d_min, h, [ x, ...] ]
206 for (kx= keepers[3]) {
207 translate([kx, keepers[0], -1])
209 cube([lipokeeper_w, keepers[1], keepers[2] +1]);
211 keepers[1] + keepers[2] / lipokeeper_slope,
217 GlandPositive(cabledia);
219 translate([0, toty_inner+wallthick, -wallthick])
221 StrapKeepers(straps_at_box);
224 // charging connector
225 translate([chargingconn_x,
226 toty_inner - (pxp6012_rad_outer + 5),
228 cylinder(r= pxp6012_rad, h= totz_outer);
230 translate([switch_x, toty_inner, totz_inner/2])
235 GlandNegative(cabledia);
237 translate(-$sealingbox_cnrrad * [1,1,0] +
238 [totx_inner, toty_inner/2, -wallthick])
245 module BoxPrint(){ ////toplevel
250 module Lid(){ ////toplevel
251 $sealingbox_sz = sb_box_sz;
255 SealingBox_RectLid();
256 translate([0, -wallthick, -SealingBox_lidbigger()])
258 StrapKeepers([ straps_every : straps_every
259 : totx_inner-straps_every ]);
262 translate($sealingbox_cnrrad * [1,0,1])
265 Commitid_Small16_M();
269 module LidPrint(){ ////toplevel
274 module Demo(){ ////toplevel
283 //FArcSegment_mask(350);