From 3851c067c96a87753e3abafc1a4d2724f989135d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 16 Sep 2020 00:04:08 +0100 Subject: [PATCH] pin-hinge: wip Signed-off-by: Ian Jackson --- pin-hinge.scad | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/pin-hinge.scad b/pin-hinge.scad index c17ce81..4eba185 100644 --- a/pin-hinge.scad +++ b/pin-hinge.scad @@ -34,21 +34,30 @@ module PlanDemo(){ translate([0,0,1]) color("red") HingePinPlan(); } -module HingePositive(l, behind){ - linextr_x_yz(0, l) - HingeProngPlan(behind); -} - -module HingeNegative(l){ +module HingePinUnitCell(l) { eff_l = l + $hinge_inter_gap; pairs = floor(eff_l / (2*($hinge_prong_minwidth + $hinge_inter_gap))); stride = eff_l / pairs; - prong_width = stride/2 - $hinge_inter_gap; - linextr_x_yz(-0.1, l+0.1) - HingePinPlan(); + $hinge__prong_width = stride/2 - $hinge_inter_gap; for (i=[0:pairs-1]) { translate(stride * i * [1,0,0]) - linextr_x_yz(0 + (i==0 ? -0.1 : 0), prong_width + $hinge_inter_gap) + children(0); + } +} + +module HingePositive(l, behind){ + HingePinUnitCell(l){ + linextr_x_yz(0, $hinge__prong_width) + HingeProngPlan(behind); + } +} + +module HingeNegative(l){ + linextr_x_yz(-0.1, l+0.1) + HingePinPlan(); + HingePinUnitCell(l){ + linextr_x_yz($hinge__prong_width, + $hinge__prong_width*2 + 2*$hinge_inter_gap) HingeGapPlan(); } } -- 2.30.2