X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=pin-hinge.scad;h=81d527e478ad50a5550861ae5cecc98bac011b78;hb=de0d2480befba2bf00f2adce8575efafc8c738be;hp=9fa22de01e7866a11a728bf0befdf84b9e529301;hpb=79d55f448acdc6a73fe9e891ea0c0cc1e5e2a492;p=reprap-play.git diff --git a/pin-hinge.scad b/pin-hinge.scad index 9fa22de..81d527e 100644 --- a/pin-hinge.scad +++ b/pin-hinge.scad @@ -1,8 +1,11 @@ // -*- C -*- -$hinge_pin_dia = 0.795 + 0.35; +include + +$hinge_pin_dia = 0.795 + 0.75; $hinge_main_dia = 4.0; $hinge_inter_gap = 0.50; +$hinge_prong_minwidth = 3.0; $hinge_noncrit_gap = 1.0; $fa = 3; @@ -13,14 +16,11 @@ module HingePinPlan(){ } module HingeProngPlan(behind){ - difference(){ - hull(){ - circle(r= $hinge_main_dia/2); - polygon([[0,0], - [-$hinge_main_dia/2, -behind], - [+$hinge_main_dia/2, -behind]]); - } - HingePinPlan(); + hull(){ + circle(r= $hinge_main_dia/2); + polygon([[0,0], + [-$hinge_main_dia/2, -behind], + [+$hinge_main_dia/2, -behind]]); } } @@ -31,6 +31,70 @@ module HingeGapPlan() { module PlanDemo(){ HingeProngPlan(5); %HingeGapPlan(); + translate([0,0,1]) color("red") HingePinPlan(); +} + +module HingePinUnitCell(l) { + eff_l = l + $hinge_inter_gap; + pairs = floor(eff_l / (2*($hinge_prong_minwidth + $hinge_inter_gap))); + stride = eff_l / pairs; + $hinge__prong_width = stride/2 - $hinge_inter_gap; + for (i=[0:pairs-1]) { + translate(stride * i * [1,0,0]) + 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(); + } +} + +test_l = 30; +test_wb = 12; +test_h = 12; + +test_face_gap = 0.75; + +module Demo(){ + difference(){ + HingePositive(test_l, test_h/2); + %HingeNegative(test_l); + } +} + +module TestBody(){ + linextr_x_yz(0, test_l){ + offset(delta = -test_face_gap/2) + polygon([[0,0], + [-test_wb/2, -test_h], + [+test_wb/2, -test_h]]); + } +} + +module Test(){ + difference(){ + union(){ + TestBody(); + HingePositive(test_l, test_h/2); + } + HingeNegative(test_l); + } } -PlanDemo(); +//PlanDemo(); +//Demo(); +//TestBody(); +Test();