3 include <commitid.scad>
6 pxp6012_rad = 22.5 / 2 + 0.5; // make circular hole this size in outer wall
7 pxp6012_rad_outer = 32.0 / 2 - 0.5;
11 s1930_y_outer = 36.4 + 0.2;
12 s1930_x_outer = 27.6 + 0.2;
20 // origin is at centre on outer face wall
21 // outside is towards positive x
22 // mounting is vertical
23 module S1930_Positive(){
24 d = s1930_recess + s1930_behind;
25 translate([-d/2, 0,0])
27 s1930_x_outer + s1930_around,
28 s1930_y_outer + s1930_around], center=true);
30 module S1930_Negative(){
31 cube([60, s1930_x, s1930_y],
34 cube([s1930_recess*2+2, s1930_x_outer, s1930_y_outer],
38 module TestWall(){ ////toplevel
39 sw_ctr = [25, wallthick, 25];
44 cube([50, wallthick, 42]);
47 translate([30, -1, 20])
49 cylinder(r = pxp6012_rad, h=10, $fn=60);
52 Commitid_BestCount([15,40]);
58 cube([50, wallthick, 50]);
73 innertube = 1.0 + 0.2;
83 ts_cidoff = (ts_cnrrad * (1-.7) + wallthick * .8) * [1,1];
85 m4_dnl Box_Part($1=transl_x,$2=transl_y, $3=rot_z,$4=mirror_xy)
86 m4_dnl $5=kind, $6=kindargs, $7=profile(profileargsargs))
87 m4_define(`Box_Part',`
88 translate([($1),($2)])
91 BoxPart_Extrude_$5($6, $7)') m4_dnl
95 m4_dnl BoxPart_Extrude_Linear(dist, `profile(...);');
96 m4_define(`BoxPart_Extrude_Linear',`
98 translate([0,0, -($1)])
99 linear_extrude(height= boxpart_d + ($1)) {
104 m4_dnl BoxPart_Extrude_Arc(x0_radius, swept_angle, `profile(...);')
105 m4_dnl arc starting at transl_x, transl_y, moving towards positive
106 m4_dnl y at first and then bending towards negative x, until
107 m4_dnl use negative x0_radius to inciate bending towards positive x
108 m4_dnl swept_angle is reached
109 m4_dnl x0_radius is the radius of the extruded part at x=0, not of the box
110 m4_define(`BoxPart_Extrude_Arc',`
111 translate([-($1),0,0])
113 translate([0,0,-500])
114 linear_extrude(height=1000)
116 mirror([($1)<0, 0,0])
117 FArcSegment_mask($2);
118 rotate_extrude(convexity=10, $fs=1, $fn=36)
119 mirror([($1)<0, 0,0])
120 translate([+($1),0,0]){
126 ts_xbox_lin = ts_xbox - ts_cnrrad*2;
127 ts_ybox_lin = ts_ybox - ts_cnrrad*2;
129 m4_dnl TestSealDoBoxShape(`profile(profileargs)');
130 m4_define(`TestSealDoBoxShape',`
131 Box_Part(0, ts_cnrrad, 0,0, Linear,`ts_ybox_lin', `$1' )
132 Box_Part(0, ts_ybox-ts_cnrrad, 0,0, Arc,`-ts_cnrrad,90' , `$1' )
133 Box_Part(ts_cnrrad, ts_ybox, -90,0, Linear,`ts_xbox_lin', `$1' )
134 Box_Part(ts_xbox-ts_cnrrad, ts_ybox, -90,0, Arc,`-ts_cnrrad,90' , `$1' )
135 Box_Part(ts_xbox, ts_ybox-ts_cnrrad, -180,0, Linear,`ts_ybox_lin', `$1' )
136 Box_Part(ts_xbox, ts_cnrrad, -180,0, Arc,`-ts_cnrrad,90' , `$1' )
137 Box_Part(ts_xbox-ts_cnrrad, 0, -270,0, Linear,`ts_xbox_lin', `$1' )
138 Box_Part(ts_cnrrad, 0, -270,0, Arc,`-ts_cnrrad,90' , `$1' )
143 module WallProfile(){
144 z = ts_zbox - innertube - tubesealrad;
145 translate([0, -0.1]) square([wallthick, z]);
146 translate([tubesealrad, z]) circle(r=tubesealrad, $fn=20);
149 module FloorProfile(){
150 mirror([0,1]) square([wallthick, floorth]);
154 rad = tubesealrad + innertube;
157 translate([-lidoverlap - innertube,
158 ts_zbox - lidoverhang - innertube])
159 square([lidoverlap + innertube + wallthick,
160 lidoverhang + innertube + ceilth]);
162 translate([tubesealrad,
163 ts_zbox - innertube - tubesealrad])
169 circle(r= tubesealrad + innertube, $fn=20);
175 module CeilProfile(){
176 translate([0, ts_zbox])
177 square([wallthick*2, ceilth]);
180 module TestSealBox(){ ////toplevel
181 TestSealDoBoxShape(WallProfile(););
182 hull(){ TestSealDoBoxShape(FloorProfile();); }
184 Commitid_BestCount([ts_xbox,ts_ybox] - 2*ts_cidoff);
187 module TestSealLid(){ ////toplevel
190 TestSealDoBoxShape(LidProfile(););
191 hull(){ TestSealDoBoxShape(CeilProfile();); }
193 translate([ts_xbox * .75, ts_ybox/2, 0])
194 cylinder(h=100, r=5);
196 translate([-wallthick + ts_cnrrad*.5,
197 ts_cnrrad*.5 - wallthick,
199 Commitid_BestCount([ts_xbox * .75 - 2.5 - (ts_cnrrad*.5),
200 ts_ybox - (ts_cnrrad*.5 - wallthick)*2]);
204 module TestSealLidPrint(){ ////toplevel
205 rotate([180,0,0]) TestSealLid();
208 module ProfileDemos(){
210 color("blue") FloorProfile();
212 color("blue") CeilProfile();
219 //FArcSegment_mask(350);