chiark / gitweb /
sewing-table: Abolish InterlockNegative in favour of a parameter (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Jan 2017 13:47:22 +0000 (13:47 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Jan 2017 13:47:22 +0000 (13:47 +0000)
sewing-table.scad.m4

index b5ee987370ca4272e9687b97106b90797b7d8483..d1d3d94f4939a0570c0da37bbae10f6e0dc66094 100644 (file)
@@ -150,14 +150,11 @@ module InterlockCore(r, plusth, ymir) {
   }
 }
 
   }
 }
 
-module InterlockNegative(this_cnr, right_cnr) {
+module Interlock(this_cnr, right_cnr, negative=0) {
   INREFFRAME(this_cnr, right_cnr)
   INREFFRAME(this_cnr, right_cnr)
-    InterlockCore(interlock_negative_rad, 1, 0);
-}
-
-module Interlock(this_cnr, right_cnr) {
-  INREFFRAME(this_cnr, right_cnr)
-    InterlockCore(interlock_rad, 0, 1);
+    InterlockCore(negative ? interlock_negative_rad : interlock_rad,
+                 negative ? 1 : 0,
+                 negative ? 0 : 1);
 }
 
 function TestPiece_holes2corners(holes) =
 }
 
 function TestPiece_holes2corners(holes) =
@@ -173,7 +170,7 @@ module TestPiece1(){ ////toplevel
   corners = TestPiece_holes2corners(holes);
   difference(){
     TileBase(corners[0], corners[2]);
   corners = TestPiece_holes2corners(holes);
   difference(){
     TileBase(corners[0], corners[2]);
-    InterlockNegative(corners[1], corners[2]);
+    Interlock(corners[1], corners[2], 1);
   }
   Posts(holes);
   RoundEdge(corners[0], corners[1]);
   }
   Posts(holes);
   RoundEdge(corners[0], corners[1]);