chiark / gitweb /
sealing-box, bike-lipo-box: $-ise cnrrad
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Feb 2016 22:06:31 +0000 (22:06 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Feb 2016 22:06:31 +0000 (22:06 +0000)
bike-lipo-box.scad
sealing-box.scad.m4

index b7c4cd6aeedf9b1e12ba14333bae6855c71ed3f5..6056d61304db0732715ff7caf9d77d3a4c11a640 100644 (file)
@@ -83,7 +83,6 @@ innertube = 1.0 + 0.2;
 lidoverlap = 1.5;
 lidoverhang = 6;
 tubesealrad = 2.0;
-ts_cnrrad = 10;
 
 include <sealing-box.scad>
 
@@ -100,11 +99,11 @@ module TestSealLid(){ ////toplevel
     translate([totx_outer * .75, toty_outer/2, 0])
       cylinder(h=100, r=5);
     
-    translate([-wallthick + ts_cnrrad*.5,
-              ts_cnrrad*.5 - wallthick,
+    translate([-wallthick + $sealingbox_cnrrad*.5,
+              $sealingbox_cnrrad*.5 - wallthick,
               totz_inner + $sealingbox_ceilth])
-      Commitid_BestCount([totx_outer * .75 - 2.5 - (ts_cnrrad*.5),
-                         toty_outer - (ts_cnrrad*.5 - wallthick)*2]);
+      Commitid_BestCount([totx_outer * .75 - 2.5 - ($sealingbox_cnrrad*.5),
+                         toty_outer - ($sealingbox_cnrrad*.5 - wallthick)*2]);
   }
 }
 
index 3130e6d5463aa322d4ae98fdd5f09d43e4d3495f..efc253a1077d4a74820ba7577a8767e244b63cf4 100644 (file)
@@ -12,8 +12,6 @@
 //           $sealingbox_ceilth
 //           $sealingbox_floorth
 //           $sealingbox_wallth
-//           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
 //      2. Define your own BoxDoShapeSomething like BoxDoShapeRect
 //      3. Invoke BoxUseShape
 //      4. Use the Box and Lid modules generated
+//
+// Other settings
+//  $sealingbox_cnrrad
+
+$sealingbox_cnrrad = 10;
 
 m4_define(`BoxLocals',`
   wall = $sealingbox_wallth;
@@ -31,11 +34,12 @@ m4_define(`BoxLocals',`
   xbox = $sealingbox_xbox;
   ybox = $sealingbox_ybox;
   zbox = $sealingbox_zbox;
+  cnrrad = $sealingbox_cnrrad;
 
-  ts_cidoff = (ts_cnrrad * (1-.7) + wall * .8) * [1,1];
+  ts_cidoff = (cnrrad * (1-.7) + wall * .8) * [1,1];
 
-  xbox_lin = xbox - ts_cnrrad*2;
-  ybox_lin = ybox - ts_cnrrad*2;
+  xbox_lin = xbox - cnrrad*2;
+  ybox_lin = ybox - cnrrad*2;
 ')
 
 m4_dnl Box_Part($1=transl_x,$2=transl_y, $3=rot_z,$4=mirror_xy)
@@ -81,14 +85,14 @@ m4_define(`BoxPart_Extrude_Arc',`
 
 m4_dnl BoxDoShapeRect(`profile(profileargs)');
 m4_define(`BoxDoShapeRect',`
-  Box_Part(0,               ts_cnrrad,    0,0, Linear,`ybox_lin', `$1' )
-  Box_Part(0,    ybox-ts_cnrrad,          0,0, Arc,`-ts_cnrrad,90' , `$1' )
-  Box_Part(ts_cnrrad,       ybox,       -90,0, Linear,`xbox_lin', `$1' )
-  Box_Part(xbox-ts_cnrrad,  ybox,       -90,0, Arc,`-ts_cnrrad,90' , `$1' )
-  Box_Part(xbox,       ybox-ts_cnrrad, -180,0, Linear,`ybox_lin', `$1' )
-  Box_Part(xbox,            ts_cnrrad, -180,0, Arc,`-ts_cnrrad,90' , `$1' )
-  Box_Part(xbox-ts_cnrrad,    0,       -270,0, Linear,`xbox_lin', `$1' )
-  Box_Part(ts_cnrrad,         0,       -270,0, Arc,`-ts_cnrrad,90' , `$1' )
+  Box_Part(0,           cnrrad,         0,0, Linear,`ybox_lin', `$1' )
+  Box_Part(0,           ybox-cnrrad,    0,0, Arc,`-cnrrad,90' , `$1' )
+  Box_Part(cnrrad,      ybox,         -90,0, Linear,`xbox_lin', `$1' )
+  Box_Part(xbox-cnrrad, ybox,         -90,0, Arc,`-cnrrad,90' , `$1' )
+  Box_Part(xbox,        ybox-cnrrad, -180,0, Linear,`ybox_lin', `$1' )
+  Box_Part(xbox,        cnrrad,      -180,0, Arc,`-cnrrad,90' , `$1' )
+  Box_Part(xbox-cnrrad, 0,           -270,0, Linear,`xbox_lin', `$1' )
+  Box_Part(cnrrad,      0,           -270,0, Arc,`-cnrrad,90' , `$1' )
 ')
 
 m4_dnl '