chiark / gitweb /
sewing-table: Introduce Rectangle_TileBase, and a call to R_EDGE (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 21 May 2017 22:09:45 +0000 (23:09 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 21 May 2017 22:09:45 +0000 (23:09 +0100)
sewing-table.scad.m4

index bdbb72e..8b69b44 100644 (file)
@@ -316,6 +316,8 @@ function Rectangle_corners2posts(c) =
     c[2] + thehd_bl,
     c[3] + thehd_br ];
 
+module Rectangle_TileBase(c) { TileBase(c[0], c[2]); }
+
 m4_dnl   R_EDGE(c,ix)
 m4_dnl        c is from Rectangle_corners and
 m4_dnl        ix is a corner number
@@ -328,10 +330,10 @@ module Tile02(){ ////toplevel
   c0 = -sz;
   c = Rectangle_corners(c0, sz);
   posts = Rectangle_corners2posts(c);
-  rcs = [c[0], c[1]];
+  rcs = [R_EDGE(c,0)];
   difference(){
     union(){
-      TileBase(c[0], c[2]);
+      Rectangle_TileBase(c);
       Posts(posts);
       RoundEdge(R_EDGE(c,0));
       RoundEdge(R_EDGE(c,3));
@@ -348,13 +350,13 @@ module Tile12(){ ////toplevel
   c0 = [-sz[0], 0];
   c = Rectangle_corners(c0, sz);
   posts = Rectangle_corners2posts(c);
-  rcs = [c[3], c[0]];
+  rcs = [R_EDGE(c,3)];
   difference(){
     union(){
-      TileBase(c[0], c[2]);
+      Rectangle_TileBase(c);
+      Posts(posts);
       RoundEdge(R_EDGE(c,2));
       RoundEdge(R_EDGE(c,3));
-      Posts(posts);
     }
     InterlockEdge(R_EDGE(c,0), 1);
     InterlockEdge(R_EDGE(c,1), 1);