From ff9d71eba4ddead909bfe6e1631837bb72bb241c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 2 Jan 2017 14:55:00 +0000 Subject: [PATCH] sewing-table: Interlock: introduce InterlockEdgePlan (nfc) --- sewing-table.scad.m4 | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/sewing-table.scad.m4 b/sewing-table.scad.m4 index 04e4598..6c44676 100644 --- a/sewing-table.scad.m4 +++ b/sewing-table.scad.m4 @@ -121,7 +121,10 @@ module RoundLeftCorner(this_cnr, right_cnr) { } } -module InterlockLobePlan(r, ymir) { +module InterlockLobePlan(negative) { + r = negative ? interlock_negative_rad : interlock_rad; + ymir = negative ? 0 : 1; + dx = sqrt(3) * r; $fn= 80; translate([thehd[0], 0]){ @@ -139,22 +142,24 @@ module InterlockLobePlan(r, ymir) { } } +module InterlockEdgePlan(negative, nlobes, length) { + for (lobei = [ 0 : nlobes-1 ]) { + lobex = (length - thehd[0]*2) * (lobei ? lobei / (nlobes-1) : 0); + translate([lobex, 0, 0]) { + InterlockLobePlan(negative); + } + } +} + module InterlockEdge(left_cnr, right_cnr, negative=0, nlobes=2) { - r = negative ? interlock_negative_rad : interlock_rad; plusth = negative * 1.0; - ymir = negative ? 0 : 1; INREFFRAME(left_cnr, right_cnr) { - translate([0, 0, plusth]){ - mirror([0,0,1]){ - linear_extrude(height=tile_th+plusth*2, convexity=10){ - for (lobei = [ 0 : nlobes-1 ]) { - lobex = (length - thehd[0]*2) * (lobei ? lobei / (nlobes-1) : 0); - translate([lobex, 0, 0]) { - InterlockLobePlan(r, ymir); - } - } - } + translate([0, 0, plusth]){ + mirror([0,0,1]){ + linear_extrude(height=tile_th+plusth*2, convexity=10){ + InterlockEdgePlan(negative, nlobes, length); + } } } } -- 2.30.2