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;
34 straps_at_box = [45, 95, 125, 160];
39 totx_outer = totx_inner + wallthick*2;
40 toty_inner = toty_outer - wallthick*2;
41 totz_outer = totz_inner + wallthick*2;
43 sb_box_sz = [totx_outer, totz_outer, toty_inner];
45 // origin is at centre on outer face wall
46 // outside is towards positive x
47 // mounting is vertical
48 module S1930_Positive(){
49 d = s1930_recess + s1930_behind;
50 translate([-d/2, 0,0])
52 s1930_x_outer + s1930_around,
53 s1930_y_outer + s1930_around], center=true);
55 module S1930_Negative(){
56 cube([60, s1930_x, s1930_y],
59 cube([s1930_recess*2+2, s1930_x_outer, s1930_y_outer],
63 module TestWall(){ ////toplevel
64 sw_ctr = [25, wallthick, 25];
69 cube([50, wallthick, 42]);
72 translate([30, -1, 20])
74 cylinder(r = pxp6012_rad, h=10, $fn=60);
77 Commitid_BestCount([15,40]);
83 cube([50, wallthick, 50]);
100 ts_box_sz = [ts_totx, ts_toty, ts_totz_inner];
102 $sealingbox_wallth = wallthick;
103 $sealingbox_floorth = wallthick;
104 $sealingbox_ceilth = wallthick;
106 module TestSealBox(){ ////toplevel
107 $sealingbox_sz = ts_box_sz;
109 SealingBox_RectBox();
110 ts_cidoff = ($sealingbox_cnrrad * (1-.7) + wallthick * .8) * [1,1];
112 Commitid_BestCount([ts_totx,ts_toty] - 2*ts_cidoff);
115 module TestSealLid(){ ////toplevel
116 $sealingbox_sz = ts_box_sz;
119 SealingBox_RectLid();
121 translate([ts_totx * .75, ts_toty/2, 0])
122 cylinder(h=100, r=5);
124 translate([-wallthick + $sealingbox_cnrrad*.5,
125 $sealingbox_cnrrad*.5 - wallthick,
126 ts_totz_inner + $sealingbox_ceilth])
127 Commitid_BestCount([ts_totx * .75 - 2.5 - ($sealingbox_cnrrad*.5),
128 ts_toty - ($sealingbox_cnrrad*.5 - wallthick)*2]);
132 module TestSealLidPrint(){ ////toplevel
133 rotate([180,0,0]) TestSealLid();
136 module ProfileDemos(){ ////toplevel
137 $sealingbox_sz = ts_box_sz;
139 SealingBox_WallProfile();
140 color("blue") SealingBox_FloorProfile();
141 SealingBox_LidProfile();
142 color("blue") SealingBox_CeilProfile();
143 color("red") translate([-5,0]) square([1,ts_totz_inner]);
147 for (dgy=[-15,-45]) {
148 translate([totx_inner + wallthick - $sealingbox_cnrrad * .3,
155 module StrapKeepers(at){
156 strap_x_tot = strap_w + strap_pillar*2;
159 echo("strapkeeper at ",sx);
160 translate([sx - strap_x_tot, 0, 0])
162 translate([0,0, -0.1])
163 cube([strap_x_tot, strap_pillard, strap_th + strap_over]);
164 translate([strap_pillar, -1, 0])
165 cube([strap_w, strap_pillard+2, strap_th]);
170 chargingconn_x = pxp6012_rad_outer + 1 + $sealingbox_cnrrad;
171 switch_x = chargingconn_x + pxp6012_rad_outer
172 + s1930_y_outer/2 + s1930_around;
174 module AtSealingBox(){
176 translate([-wallthick,-wallthick, -toty_inner])
180 module Box(){ ////toplevel
181 $sealingbox_sz = sb_box_sz;
186 SealingBox_RectBox();
188 translate([switch_x, toty_inner, totz_inner/2])
193 for (kx= [ 40, 80, 120 ]) {
194 translate([kx, 40, -1])
199 GlandPositive(cabledia);
201 translate([0, toty_inner+wallthick, -wallthick])
203 StrapKeepers(straps_at_box);
206 // charging connector
207 translate([chargingconn_x,
208 toty_inner - (pxp6012_rad_outer + 5),
210 cylinder(r= pxp6012_rad, h= totz_outer);
212 translate([switch_x, toty_inner, totz_inner/2])
217 GlandNegative(cabledia);
219 translate($sealingbox_cnrrad * [1,1,0] +
220 [0, toty_inner/2, -wallthick])
225 module BoxPrint(){ ////toplevel
230 module Lid(){ ////toplevel
231 $sealingbox_sz = sb_box_sz;
235 SealingBox_RectLid();
236 translate([0, -wallthick, -SealingBox_lidbigger()])
238 StrapKeepers([ straps_every : straps_every
239 : totx_inner-straps_every ]);
242 translate($sealingbox_cnrrad * [1,0,1])
248 module LidPrint(){ ////toplevel
253 module Demo(){ ////toplevel
262 //FArcSegment_mask(350);