chiark / gitweb /
sealing-box, bike-lipo-box: $-ise wallthick
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Feb 2016 21:48:09 +0000 (21:48 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Feb 2016 21:48:28 +0000 (21:48 +0000)
bike-lipo-box.scad
sealing-box.scad.m4

index 43be1dd2f5f89e85b817c8a02d2dcd0a8f954b2c..bde5ece0940545f1bb467fdd90e9e7e2ed90d236 100644 (file)
@@ -68,6 +68,8 @@ module TestWall(){ ////toplevel
   }    
 }
 
+$sealingbox_wallthick = wallthick;
+
 floorth = 2.5;
 ceilth = 2.5;
 innertube = 1.0 + 0.2;
index 33b1069ecce0fb45c9a0ee25e2a458d558fa1f5f..cbdff22695a65943d79a0075c59f2226a61e765f 100644 (file)
@@ -5,6 +5,7 @@
 // A. Rectangular boxes
 //      1. include <sealing-box.scad>
 //      2. assign() values to (xxx these should be $ variables)
+//           $sealingbox_wallthick
 //           ts_xbox (outer dimensions)
 //           ts_ybox (outer dimension)
 //           ts_zbox (??? xxx)
@@ -62,7 +63,9 @@ m4_define(`BoxPart_Extrude_Arc',`
 ')
 
 m4_define(`BoxLocals',`
-  ts_cidoff = (ts_cnrrad * (1-.7) + wallthick * .8) * [1,1];
+  wall = $sealingbox_wallthick;
+
+  ts_cidoff = (ts_cnrrad * (1-.7) + wall * .8) * [1,1];
 
   ts_xbox_lin = ts_xbox - ts_cnrrad*2;
   ts_ybox_lin = ts_ybox - ts_cnrrad*2;
@@ -85,23 +88,23 @@ m4_dnl '
 module SealingBox_WallProfile(){
   BoxLocals
   z = ts_zbox - innertube - tubesealrad;
-  translate([0, -0.1]) square([wallthick, z]);
+  translate([0, -0.1]) square([wall, z]);
   translate([tubesealrad, z]) circle(r=tubesealrad, $fn=20);
 }
 
 module SealingBox_FloorProfile(){
   BoxLocals
-  mirror([0,1]) square([wallthick, floorth]);
+  mirror([0,1]) square([wall, floorth]);
 }
 
 module SealingBox_LidProfile(){
   BoxLocals
   rad = tubesealrad + innertube;
-  morex = wallthick;
+  morex = wall;
   difference(){
     translate([-lidoverlap - innertube,
               ts_zbox - lidoverhang - innertube])
-      square([lidoverlap + innertube + wallthick,
+      square([lidoverlap + innertube + wall,
              lidoverhang + innertube + ceilth]);
     hull(){
       translate([tubesealrad,
@@ -120,7 +123,7 @@ module SealingBox_LidProfile(){
 module SealingBox_CeilProfile(){
   BoxLocals
   translate([0, ts_zbox])
-    square([wallthick*2, ceilth]);
+    square([wall*2, ceilth]);
 }
 
 // BoxDoShape(Basename,BoxDoShapeSomething)