}
')
-ts_cidoff = (ts_cnrrad * (1-.7) + wallthick * .8) * [1,1];
+m4_define(`BoxLocals',`
+ ts_cidoff = (ts_cnrrad * (1-.7) + wallthick * .8) * [1,1];
-ts_xbox_lin = ts_xbox - ts_cnrrad*2;
-ts_ybox_lin = ts_ybox - ts_cnrrad*2;
+ ts_xbox_lin = ts_xbox - ts_cnrrad*2;
+ ts_ybox_lin = ts_ybox - ts_cnrrad*2;
+')
m4_dnl BoxDoShapeRect(`profile(profileargs)');
m4_define(`BoxDoShapeRect',`
m4_dnl '
module SealingBox_WallProfile(){
+ BoxLocals
z = ts_zbox - innertube - tubesealrad;
translate([0, -0.1]) square([wallthick, z]);
translate([tubesealrad, z]) circle(r=tubesealrad, $fn=20);
}
module SealingBox_FloorProfile(){
+ BoxLocals
mirror([0,1]) square([wallthick, floorth]);
}
module SealingBox_LidProfile(){
+ BoxLocals
rad = tubesealrad + innertube;
morex = wallthick;
difference(){
}
module SealingBox_CeilProfile(){
+ BoxLocals
translate([0, ts_zbox])
square([wallthick*2, ceilth]);
}
// generates modules BasenameBox and BasenameLid
m4_define(`BoxUseShape',`
module $1Box(){
+ BoxLocals
$2(SealingBox_WallProfile(););
hull(){ $2(SealingBox_FloorProfile();); }
}
module $1Lid(){
+ BoxLocals
$2(SealingBox_LidProfile(););
hull(){ $2(SealingBox_CeilProfile();); }
}