chiark / gitweb /
sewing-table: Interlock: tongue/groove wip, seems to mostly work, need to make match...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Jan 2017 15:42:13 +0000 (15:42 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Jan 2017 15:42:13 +0000 (15:42 +0000)
sewing-table.scad.m4

index 34f1c7d40257572e94296f44b70add6a37f4b600..c2ae19d6712084357c91af1b4b87850e16102fcc 100644 (file)
@@ -173,23 +173,25 @@ module InterlockEdge(left_cnr, right_cnr, negative=0, nlobes=2) {
   z1 = -tile_th/2 - protr / interlock_fine_slope;
   z3 = -tile_th/2 + protr / interlock_fine_slope;
 
   z1 = -tile_th/2 - protr / interlock_fine_slope;
   z3 = -tile_th/2 + protr / interlock_fine_slope;
 
+  yprotr = negative ? -protr : protr;
+
   INREFFRAME(left_cnr, right_cnr) {
     for (vsect = [ // zs0            zs1      ys0,            ys1
                  [ -tile_th-plusth, plusth,  0,              0],
   INREFFRAME(left_cnr, right_cnr) {
     for (vsect = [ // zs0            zs1      ys0,            ys1
                  [ -tile_th-plusth, plusth,  0,              0],
-                 [ z1,              z2,      0, protr],
-                 [ z2,              z3,      protr, 0],
+                 [ z1,              z2,      0, yprotr],
+                 [ z2,              z3,      yprotr, 0],
                  ]) {
       zs0 = vsect[0];
       zs1 = vsect[1];
       zsd = zs1-zs0;
       ys0 = vsect[2];
                  ]) {
       zs0 = vsect[0];
       zs1 = vsect[1];
       zsd = zs1-zs0;
       ys0 = vsect[2];
-      ys1 = vsect[2];
+      ys1 = vsect[3];
       ysd = ys1-ys0;
       ysd = ys1-ys0;
-      m = [ [ 1,0,0,0 ],
-           [ 0,1,0,0 ],
-           [ 0,0,1,zs0 ],
-           [ 0,0,0,1 ] ];
-      echo(m);
+      sl = ysd/zsd;
+      m = [ [ 1,0,   0,    0 ],
+           [ 0,1, -sl, -ys0 ],
+           [ 0,0,   1,  zs0 ],
+           [ 0,0,   0,    1 ] ];
       multmatrix(m)
        linear_extrude(height=zsd, convexity=10)
        InterlockEdgePlan(negative, nlobes, length);
       multmatrix(m)
        linear_extrude(height=zsd, convexity=10)
        InterlockEdgePlan(negative, nlobes, length);