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;
38 totx_outer = totx_inner + wallthick*2;
39 toty_inner = toty_outer - wallthick*2;
40 totz_outer = totz_inner + wallthick*2;
42 sb_box_sz = [totx_outer, totz_outer, toty_inner];
44 // origin is at centre on outer face wall
45 // outside is towards positive x
46 // mounting is vertical
47 module S1930_Positive(){
48 d = s1930_recess + s1930_behind;
49 translate([-d/2, 0,0])
51 s1930_x_outer + s1930_around,
52 s1930_y_outer + s1930_around], center=true);
54 module S1930_Negative(){
55 cube([60, s1930_x, s1930_y],
58 cube([s1930_recess*2+2, s1930_x_outer, s1930_y_outer],
62 module TestWall(){ ////toplevel
63 sw_ctr = [25, wallthick, 25];
68 cube([50, wallthick, 42]);
71 translate([30, -1, 20])
73 cylinder(r = pxp6012_rad, h=10, $fn=60);
76 Commitid_BestCount([15,40]);
82 cube([50, wallthick, 50]);
99 ts_box_sz = [ts_totx, ts_toty, ts_totz_inner];
101 $sealingbox_wallth = wallthick;
102 $sealingbox_floorth = wallthick;
103 $sealingbox_ceilth = wallthick;
105 module TestSealBox(){ ////toplevel
106 $sealingbox_sz = ts_box_sz;
108 SealingBox_RectBox();
109 ts_cidoff = ($sealingbox_cnrrad * (1-.7) + wallthick * .8) * [1,1];
111 Commitid_BestCount([ts_totx,ts_toty] - 2*ts_cidoff);
114 module TestSealLid(){ ////toplevel
115 $sealingbox_sz = ts_box_sz;
118 SealingBox_RectLid();
120 translate([ts_totx * .75, ts_toty/2, 0])
121 cylinder(h=100, r=5);
123 translate([-wallthick + $sealingbox_cnrrad*.5,
124 $sealingbox_cnrrad*.5 - wallthick,
125 ts_totz_inner + $sealingbox_ceilth])
126 Commitid_BestCount([ts_totx * .75 - 2.5 - ($sealingbox_cnrrad*.5),
127 ts_toty - ($sealingbox_cnrrad*.5 - wallthick)*2]);
131 module TestSealLidPrint(){ ////toplevel
132 rotate([180,0,0]) TestSealLid();
135 module ProfileDemos(){ ////toplevel
136 $sealingbox_sz = ts_box_sz;
138 SealingBox_WallProfile();
139 color("blue") SealingBox_FloorProfile();
140 SealingBox_LidProfile();
141 color("blue") SealingBox_CeilProfile();
142 color("red") translate([-5,0]) square([1,ts_totz_inner]);
146 for (dgy=[-15,-45]) {
147 translate([totx_inner + wallthick - $sealingbox_cnrrad * .3,
154 module StrapKeepers(){
155 strap_x_tot = strap_w + strap_pillar*2;
157 for (sx=[strap_every : strap_every : totx_inner - strap_every]) {
158 echo("strapkeeper at ",sx);
159 translate([sx - strap_x_tot, 0, 0])
161 translate([0,0, -0.1])
162 cube([strap_x_tot, strap_pillard, strap_th + strap_over]);
163 translate([strap_pillar, -1, 0])
164 cube([strap_w, strap_pillard+2, strap_th]);
169 module Box(){ ////toplevel
170 $sealingbox_sz = sb_box_sz;
172 chargingconn_x = pxp6012_rad_outer + 1 + $sealingbox_cnrrad;
173 switch_x = chargingconn_x + pxp6012_rad_outer
174 + s1930_y_outer/2 + s1930_around;
179 translate([-wallthick,-wallthick, -toty_inner])
180 SealingBox_RectBox();
182 translate([switch_x, toty_inner, totz_inner/2])
187 for (kx= [ 40, 80, 120 ]) {
188 translate([kx, 40, -1])
193 GlandPositive(cabledia);
196 // charging connector
197 translate([chargingconn_x,
198 toty_inner - (pxp6012_rad_outer + 5),
200 cylinder(r= pxp6012_rad, h= totz_outer);
202 translate([switch_x, toty_inner, totz_inner/2])
207 GlandNegative(cabledia);
209 translate($sealingbox_cnrrad * [1,1,0] +
210 [0, toty_inner/2, -wallthick])
215 module BoxPrint(){ ////toplevel
224 //FArcSegment_mask(350);