chiark / gitweb /
sewing-table: Start on real tiles
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Jan 2017 14:25:01 +0000 (14:25 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Jan 2017 14:25:01 +0000 (14:25 +0000)
sewing-table.scad.m4

index 9c930e528cb51131b4d29847177bf32acec18881..2d48d82e63e661870c20e34876677caa62f05135 100644 (file)
@@ -196,6 +196,51 @@ module TestDemo(){ ////toplevel
     TestPiece2();
 }
   
+function Rectangle_corners(c0, sz) =
+  [ c0 + [ 0,     0     ],
+    c0 + [ sz[0], 0     ],
+    c0 + [ sz[0], sz[1] ],
+    c0 + [ 0,     sz[1] ] ];
+
+function Rectangle_corners2posts(c) =
+  [ c[0] + thehd_tr,
+    c[1] + thehd_tl,
+    c[2] + thehd_bl,
+    c[3] + thehd_br ];
+
+module Tile02(){ ////toplevel
+  sz = [100,170];
+  c0 = -sz;
+  c = Rectangle_corners(c0, sz);
+  posts = Rectangle_corners2posts(c);
+  difference(){
+    TileBase(c[0], c[2]);
+  }
+  Posts(posts);
+  RoundEdge(c[0], c[1]);
+  RoundEdge(c[3], c[0]);
+  RoundLeftCorner(c[0], c[1]);
+}
+
+module Tile12(){ ////toplevel
+  sz = [100,250];
+  c0 = [-sz[0], 0];
+  c = Rectangle_corners(c0, sz);
+  posts = Rectangle_corners2posts(c);
+  difference(){
+    TileBase(c[0], c[2]);
+  }
+  Posts(posts);
+  RoundEdge(c[2], c[3]);
+  RoundEdge(c[3], c[0]);
+  RoundLeftCorner(c[2], c[3]);
+}
+
+module Demo(){ ////toplevel
+  color("blue") Tile12();
+  color("red")  Tile02();
+}
+  
 //TestPiece1();
 //TestPiece2();
 //Demo();