3 // This file can be used in two ways:
5 // A. Rectangular boxes
6 // 1. include <sealing-box.scad>
7 // 2. assign() values to (xxx these should be $ variables)
8 // ts_xbox (outer dimensions)
9 // ts_ybox (outer dimension)
11 // ts_cnrrad (outer radius of corners, leave at default normall)
12 // xxx default should be in this file
17 // B. Complicated shapes, but harder work
18 // 1. Be a .m4 file and m4_include sealing-box.scad.m4
19 // 2. Maybe define your own BoxDoShapeRect xxx tbd
21 m4_dnl Box_Part($1=transl_x,$2=transl_y, $3=rot_z,$4=mirror_xy)
22 m4_dnl $5=kind, $6=kindargs, $7=profile(profileargsargs))
23 m4_define(`Box_Part',`
24 translate([($1),($2)])
27 BoxPart_Extrude_$5($6, $7)') m4_dnl
31 m4_dnl BoxPart_Extrude_Linear(dist, `profile(...);');
32 m4_define(`BoxPart_Extrude_Linear',`
34 translate([0,0, -($1)])
35 linear_extrude(height= boxpart_d + ($1)) {
40 m4_dnl BoxPart_Extrude_Arc(x0_radius, swept_angle, `profile(...);')
41 m4_dnl arc starting at transl_x, transl_y, moving towards positive
42 m4_dnl y at first and then bending towards negative x, until
43 m4_dnl use negative x0_radius to inciate bending towards positive x
44 m4_dnl swept_angle is reached
45 m4_dnl x0_radius is the radius of the extruded part at x=0, not of the box
46 m4_define(`BoxPart_Extrude_Arc',`
47 translate([-($1),0,0])
50 linear_extrude(height=1000)
54 rotate_extrude(convexity=10, $fs=1, $fn=36)
56 translate([+($1),0,0]){
62 ts_cidoff = (ts_cnrrad * (1-.7) + wallthick * .8) * [1,1];
64 ts_xbox_lin = ts_xbox - ts_cnrrad*2;
65 ts_ybox_lin = ts_ybox - ts_cnrrad*2;
67 m4_dnl TestSealDoBoxShape(`profile(profileargs)');
68 m4_define(`TestSealDoBoxShape',`
69 Box_Part(0, ts_cnrrad, 0,0, Linear,`ts_ybox_lin', `$1' )
70 Box_Part(0, ts_ybox-ts_cnrrad, 0,0, Arc,`-ts_cnrrad,90' , `$1' )
71 Box_Part(ts_cnrrad, ts_ybox, -90,0, Linear,`ts_xbox_lin', `$1' )
72 Box_Part(ts_xbox-ts_cnrrad, ts_ybox, -90,0, Arc,`-ts_cnrrad,90' , `$1' )
73 Box_Part(ts_xbox, ts_ybox-ts_cnrrad, -180,0, Linear,`ts_ybox_lin', `$1' )
74 Box_Part(ts_xbox, ts_cnrrad, -180,0, Arc,`-ts_cnrrad,90' , `$1' )
75 Box_Part(ts_xbox-ts_cnrrad, 0, -270,0, Linear,`ts_xbox_lin', `$1' )
76 Box_Part(ts_cnrrad, 0, -270,0, Arc,`-ts_cnrrad,90' , `$1' )
82 z = ts_zbox - innertube - tubesealrad;
83 translate([0, -0.1]) square([wallthick, z]);
84 translate([tubesealrad, z]) circle(r=tubesealrad, $fn=20);
87 module FloorProfile(){
88 mirror([0,1]) square([wallthick, floorth]);
92 rad = tubesealrad + innertube;
95 translate([-lidoverlap - innertube,
96 ts_zbox - lidoverhang - innertube])
97 square([lidoverlap + innertube + wallthick,
98 lidoverhang + innertube + ceilth]);
100 translate([tubesealrad,
101 ts_zbox - innertube - tubesealrad])
107 circle(r= tubesealrad + innertube, $fn=20);
113 module CeilProfile(){
114 translate([0, ts_zbox])
115 square([wallthick*2, ceilth]);
118 module TestSealBoxBox(){
119 TestSealDoBoxShape(WallProfile(););
120 hull(){ TestSealDoBoxShape(FloorProfile();); }
123 module TestSealBoxLid(){ ////toplevel
124 TestSealDoBoxShape(LidProfile(););
125 hull(){ TestSealDoBoxShape(CeilProfile();); }