X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=blobdiff_plain;f=sewing-table.scad.m4;h=5a6aec036ea8e4c6841387de5f815e4e600e37e6;hp=630d48911b8a2f393c6bf5d848fdbc40d85ec53e;hb=d966533a620dcfd35e9aebd199212fcbba6ba83c;hpb=173a156f03a3d5dfccf04f354a07d2e14f661412 diff --git a/sewing-table.scad.m4 b/sewing-table.scad.m4 index 630d489..5a6aec0 100644 --- a/sewing-table.scad.m4 +++ b/sewing-table.scad.m4 @@ -150,7 +150,7 @@ module InterlockLobePlan(negative) { } } -module InterlockEdgePlan(negative, nlobes, length) { +module InterlockEdgePlan(negative, nlobes, length, dosquare=true) { for (lobei = [ 0 : nlobes-1 ]) { lobex = (length - thehd[0]*2) * (lobei ? lobei / (nlobes-1) : 0); translate([lobex, 0, 0]) { @@ -158,11 +158,13 @@ module InterlockEdgePlan(negative, nlobes, length) { } } - iadj = interlock_sq_adj; - slotshorter = negative ? 0 : interlock_fine_lenslop; - mirror([0, negative]) - translate([slotshorter, iadj]) - square([length - slotshorter*2, interlock_fine + iadj*2]); + if (dosquare) { + iadj = 0; + slotshorter = negative ? 0 : interlock_fine_lenslop; + mirror([0, negative]) + translate([slotshorter, iadj]) + square([length - slotshorter*2, interlock_fine + iadj*2]); + } } module InterlockEdge(left_cnr, right_cnr, negative=0, nlobes=2) { @@ -173,15 +175,29 @@ 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; + negsign = negative ? -1 : +1; + yprotr = negsign * protr; + INREFFRAME(left_cnr, right_cnr) { - for (vsect = [ // zstart zend ystart, yend + 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], ]) { - translate([0, 0, vsect[0]]) - linear_extrude(height=vsect[1]-vsect[0], convexity=10) - InterlockEdgePlan(negative, nlobes, length); + zs0 = vsect[0]; + zs1 = vsect[1]; + zsd = zs1-zs0; + ys0 = vsect[2]; + ys1 = vsect[3]; + ysd = ys1-ys0; + sl = ysd/zsd; + m = [ [ 1,0, 0, 0 ], + [ 0,1, -sl, -ys0 + negsign*interlock_sq_adj ], + [ 0,0, 1, zs0 ], + [ 0,0, 0, 1 ] ]; + multmatrix(m) + linear_extrude(height=zsd, convexity=10) + InterlockEdgePlan(negative, nlobes, length, !!ysd); } } }