// -*- C -*-
+// This file can be used in two ways:
+//
+// A. Rectangular boxes
+// 1. include <sealing-box.scad>
+// 2. assign() values to (xxx these should be $ variables)
+// ts_xbox (outer dimensions)
+// ts_ybox (outer dimension)
+// ts_zbox (??? xxx)
+// ts_cnrrad (outer radius of corners, leave at default normall)
+// xxx default should be in this file
+// 3. use the modules
+// SealingBox_RectBox
+// SealingBox_RectLid
+//
+// B. Complicated shapes, but harder work
+// 1. Be a .m4 file and m4_include sealing-box.scad.m4
+// 2. Maybe define your own BoxDoShapeRect xxx tbd
+
m4_dnl Box_Part($1=transl_x,$2=transl_y, $3=rot_z,$4=mirror_xy)
m4_dnl $5=kind, $6=kindargs, $7=profile(profileargsargs))
m4_define(`Box_Part',`
ts_xbox_lin = ts_xbox - ts_cnrrad*2;
ts_ybox_lin = ts_ybox - ts_cnrrad*2;
-m4_dnl TestSealDoBoxShape(`profile(profileargs)');
-m4_define(`TestSealDoBoxShape',`
+m4_dnl BoxDoShapeRect(`profile(profileargs)');
+m4_define(`BoxDoShapeRect',`
Box_Part(0, ts_cnrrad, 0,0, Linear,`ts_ybox_lin', `$1' )
Box_Part(0, ts_ybox-ts_cnrrad, 0,0, Arc,`-ts_cnrrad,90' , `$1' )
Box_Part(ts_cnrrad, ts_ybox, -90,0, Linear,`ts_xbox_lin', `$1' )
m4_dnl '
-module WallProfile(){
+module SealingBox_WallProfile(){
z = ts_zbox - innertube - tubesealrad;
translate([0, -0.1]) square([wallthick, z]);
translate([tubesealrad, z]) circle(r=tubesealrad, $fn=20);
}
-module FloorProfile(){
+module SealingBox_FloorProfile(){
mirror([0,1]) square([wallthick, floorth]);
}
-module LidProfile(){
+module SealingBox_LidProfile(){
rad = tubesealrad + innertube;
morex = wallthick;
difference(){
}
}
-module CeilProfile(){
+module SealingBox_CeilProfile(){
translate([0, ts_zbox])
square([wallthick*2, ceilth]);
}
module TestSealBoxBox(){
- TestSealDoBoxShape(WallProfile(););
- hull(){ TestSealDoBoxShape(FloorProfile();); }
+ BoxDoShapeRect(SealingBox_WallProfile(););
+ hull(){ BoxDoShapeRect(SealingBox_FloorProfile();); }
}
module TestSealBoxLid(){ ////toplevel
- TestSealDoBoxShape(LidProfile(););
- hull(){ TestSealDoBoxShape(CeilProfile();); }
+ BoxDoShapeRect(SealingBox_LidProfile(););
+ hull(){ BoxDoShapeRect(SealingBox_CeilProfile();); }
}