chiark / gitweb /
sewing-table: RoundCornerAdd/Cut: change calling convention (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Jan 2017 16:26:15 +0000 (16:26 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Jan 2017 16:26:15 +0000 (16:26 +0000)
sewing-table.scad.m4

index 2231e3fbb3320d5ff1aac22da196725bf2866ed9..83d04e0278629a794a11ff5746d7d0ec5bd3d573 100644 (file)
@@ -121,7 +121,9 @@ module RoundEdge(left_cnr, right_cnr) {
   }
 }
 
-module RoundCornerCut(this_cnr, right_cnr) {
+module RoundCornerCut(ci) {
+  this_cnr = ci[0];
+  right_cnr = ci[1];
   offr= round_cnr_rad - round_edge_rad;
   INREFFRAME(this_cnr, right_cnr) INREFFRAME_EDGE {
     difference(){
@@ -132,7 +134,9 @@ module RoundCornerCut(this_cnr, right_cnr) {
   }
 }
 
-module RoundCornerAdd(this_cnr, right_cnr) {
+module RoundCornerAdd(ci) {
+  this_cnr = ci[0];
+  right_cnr = ci[1];
   bigr = round_cnr_rad - round_edge_rad;
   INREFFRAME(this_cnr, right_cnr) INREFFRAME_EDGE {
     intersection(){
@@ -282,6 +286,7 @@ module Tile02(){ ////toplevel
   c0 = -sz;
   c = Rectangle_corners(c0, sz);
   posts = Rectangle_corners2posts(c);
+  rcs = [c[0], c[1]];
   difference(){
     union(){
       TileBase(c[0], c[2]);
@@ -291,9 +296,9 @@ module Tile02(){ ////toplevel
       InterlockEdge(c[2], c[3], 0);
     }
     InterlockEdge(c[1], c[2], 1);
-    RoundCornerCut(c[0], c[1]);
+    RoundCornerCut(rcs);
   }
-  RoundCornerAdd(c[0], c[1]);
+  RoundCornerAdd(rcs);
 }
 
 module Tile12(){ ////toplevel
@@ -301,6 +306,7 @@ module Tile12(){ ////toplevel
   c0 = [-sz[0], 0];
   c = Rectangle_corners(c0, sz);
   posts = Rectangle_corners2posts(c);
+  rcs = [c[2], c[3]];
   difference(){
     union(){
       TileBase(c[0], c[2]);
@@ -309,9 +315,9 @@ module Tile12(){ ////toplevel
       Posts(posts);
     }
     InterlockEdge(c[0], c[1], 1);
-    RoundCornerCut(c[2], c[3]);
+    RoundCornerCut(rcs);
   }
-  RoundCornerAdd(c[2], c[3]);
+  RoundCornerAdd(rcs);
 }
 
 module Demo(){ ////toplevel