3 include <commitid.scad>
6 pxp6012_rad = 22.5 / 2 + 0.5;
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
41 wallthick + 0.5, // xxx compatibility bug
47 cube([50, wallthick, 42]);
50 translate([30, -1, 20])
52 cylinder(r = pxp6012_rad, h=10, $fn=60);
55 Commitid_BestCount([15,40]);
61 cube([50, wallthick, 50]);
67 translate(sw_ctr_new) {
76 innertube = 1.0 + 0.2;
86 ts_cidoff = (ts_cnrrad * (1-.7) + wallthick * .8) * [1,1];
88 m4_dnl Box_Part($1=transl_x,$2=transl_y, $3=rot_z,$4=mirror_xy)
89 m4_dnl $5=kind, $6=kindargs, $7=profile(profileargsargs))
90 m4_define(`Box_Part',`
91 translate([($1),($2)])
94 BoxPart_Extrude_$5($6, $7)') m4_dnl
98 m4_dnl BoxPart_Extrude_Linear(dist, `profile(...);');
99 m4_define(`BoxPart_Extrude_Linear',`
101 translate([0,0, -($1)])
102 linear_extrude(height= boxpart_d + ($1)) {
107 m4_dnl BoxPart_Extrude_Arc(x0_radius, swept_angle, `profile(...);')
108 m4_dnl arc starting at transl_x, transl_y, moving towards positive
109 m4_dnl y at first and then bending towards negative x, until
110 m4_dnl use negative x0_radius to inciate bending towards positive x
111 m4_dnl swept_angle is reached
112 m4_dnl x0_radius is the radius of the extruded part at x=0, not of the box
113 m4_define(`BoxPart_Extrude_Arc',`
114 translate([-($1),0,0])
116 translate([0,0,-500])
117 linear_extrude(height=1000)
119 mirror([($1)<0, 0,0])
120 FArcSegment_mask($2);
121 rotate_extrude(convexity=10, $fs=1, $fn=36)
122 mirror([($1)<0, 0,0])
123 translate([+($1),0,0]){
129 ts_xbox_lin = ts_xbox - ts_cnrrad*2;
130 ts_ybox_lin = ts_ybox - ts_cnrrad*2;
132 m4_dnl TestSealDoBoxShape(`profile(profileargs)');
133 m4_define(`TestSealDoBoxShape',`
134 Box_Part(0, ts_cnrrad, 0,0, Linear,`ts_ybox_lin', `$1' )
135 Box_Part(0, ts_ybox-ts_cnrrad, 0,0, Arc,`-ts_cnrrad,90' , `$1' )
136 Box_Part(ts_cnrrad, ts_ybox, -90,0, Linear,`ts_xbox_lin', `$1' )
137 Box_Part(ts_xbox-ts_cnrrad, ts_ybox, -90,0, Arc,`-ts_cnrrad,90' , `$1' )
138 Box_Part(ts_xbox, ts_ybox-ts_cnrrad, -180,0, Linear,`ts_ybox_lin', `$1' )
139 Box_Part(ts_xbox, ts_cnrrad, -180,0, Arc,`-ts_cnrrad,90' , `$1' )
140 Box_Part(ts_xbox-ts_cnrrad, 0, -270,0, Linear,`ts_xbox_lin', `$1' )
141 Box_Part(ts_cnrrad, 0, -270,0, Arc,`-ts_cnrrad,90' , `$1' )
146 module WallProfile(){
147 z = ts_zbox - innertube - tubesealrad;
148 translate([0, -0.1]) square([wallthick, z]);
149 translate([tubesealrad, z]) circle(r=tubesealrad, $fn=20);
152 module FloorProfile(){
153 mirror([0,1]) square([wallthick, floorth]);
157 rad = tubesealrad + innertube;
160 translate([-lidoverlap - innertube,
161 ts_zbox - lidoverhang - innertube])
162 square([lidoverlap + innertube + wallthick,
163 lidoverhang + innertube + ceilth]);
165 translate([tubesealrad,
166 ts_zbox - innertube - tubesealrad])
172 circle(r= tubesealrad + innertube, $fn=20);
178 module CeilProfile(){
179 translate([0, ts_zbox])
180 square([wallthick*2, ceilth]);
183 module TestSealBox(){ ////toplevel
184 TestSealDoBoxShape(WallProfile(););
185 hull(){ TestSealDoBoxShape(FloorProfile();); }
187 Commitid_BestCount([ts_xbox,ts_ybox] - 2*ts_cidoff);
190 module TestSealLid(){ ////toplevel
193 TestSealDoBoxShape(LidProfile(););
194 hull(){ TestSealDoBoxShape(CeilProfile();); }
196 translate([ts_xbox * .75, ts_ybox/2, 0])
197 cylinder(h=100, r=5);
199 translate([-wallthick + ts_cnrrad*.5,
200 ts_cnrrad*.5 - wallthick,
202 Commitid_BestCount([ts_xbox * .75 - 2.5 - (ts_cnrrad*.5),
203 ts_ybox - (ts_cnrrad*.5 - wallthick)*2]);
207 module TestSealLidPrint(){ ////toplevel
208 rotate([180,0,0]) TestSealLid();
211 module ProfileDemos(){
213 color("blue") FloorProfile();
215 color("blue") CeilProfile();
222 //FArcSegment_mask(350);