From: Ian Jackson Date: Sat, 13 Feb 2016 20:53:04 +0000 (+0000) Subject: sealing-box: Provide BoxUseShape as separate macro (nfc) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=commitdiff_plain;h=96e17d229fb7a287b890a589d1ef7b28a317e23f sealing-box: Provide BoxUseShape as separate macro (nfc) --- diff --git a/sealing-box.scad.m4 b/sealing-box.scad.m4 index 2cb20f8..c3ff461 100644 --- a/sealing-box.scad.m4 +++ b/sealing-box.scad.m4 @@ -115,12 +115,18 @@ module SealingBox_CeilProfile(){ square([wallthick*2, ceilth]); } -module TestSealBoxBox(){ - BoxDoShapeRect(SealingBox_WallProfile();); - hull(){ BoxDoShapeRect(SealingBox_FloorProfile();); } -} +// BoxDoShape(Basename,BoxDoShapeSomething) +// generates modules BasenameBox and BasenameLid +m4_define(`BoxUseShape',` + module $1Box(){ + $2(SealingBox_WallProfile();); + hull(){ $2(SealingBox_FloorProfile();); } + } -module TestSealBoxLid(){ ////toplevel - BoxDoShapeRect(SealingBox_LidProfile();); - hull(){ BoxDoShapeRect(SealingBox_CeilProfile();); } -} + module $1Lid(){ ////toplevel + $2(SealingBox_LidProfile();); + hull(){ $2(SealingBox_CeilProfile();); } + } +') + +BoxUseShape(`TestSealBox',`BoxDoShapeRect')