From: Ian Jackson Date: Sat, 13 Feb 2016 21:45:31 +0000 (+0000) Subject: sealing-box: Introduce BoxLocals (nfc) X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=08eff150d30933b2df40a080607437ffbd3260ba;p=reprap-play.git sealing-box: Introduce BoxLocals (nfc) --- diff --git a/sealing-box.scad.m4 b/sealing-box.scad.m4 index e2b5702..33b1069 100644 --- a/sealing-box.scad.m4 +++ b/sealing-box.scad.m4 @@ -61,10 +61,12 @@ m4_define(`BoxPart_Extrude_Arc',` } ') -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',` @@ -81,16 +83,19 @@ 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(){ @@ -113,6 +118,7 @@ module SealingBox_LidProfile(){ } module SealingBox_CeilProfile(){ + BoxLocals translate([0, ts_zbox]) square([wallthick*2, ceilth]); } @@ -121,11 +127,13 @@ module SealingBox_CeilProfile(){ // 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();); } }