X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=blobdiff_plain;f=splitpin.scad;h=931eb0002c94b0a52b734ad4854201b178b5a3c4;hp=7120037a088668db33445931418bfc84bae03438;hb=1c1a5489fb3e69a50b9ae2e039c4e175866073ca;hpb=38148b180154faadec3c3ce111836ecf1d88c31b diff --git a/splitpin.scad b/splitpin.scad index 7120037..931eb00 100644 --- a/splitpin.scad +++ b/splitpin.scad @@ -6,45 +6,72 @@ tau = 6.28318530718; function deg2rad(deg) = deg/360 * tau; function rad2deg(rad) = rad/tau * 360; -module SplitPin(w=1.5, holeminrad=4, thick=3, deviationrad=1.5, - mainlen=20, handlerad=10, handlelen=7){ +module SplitPin(w=1.5, holeminrad=3.5, thick=3, deviationrad=1.0, + mainlen=20, handlerad=10, handlelen=7) { spare = holeminrad - deviationrad - w; echo("splitpin spare",spare); %translate([0,mainlen+handlelen,0]) cylinder(r=spare, h=thick); %translate([0,mainlen,thick/2]) rotate([90,0,0]) cylinder(r=holeminrad, h=thick); - bent_x0 = w*1.5; - bent_x1 = holeminrad; - bent_dx = bent_x1 - bent_x0; - bent_y1 = mainlen; - bent_dy = bent_y1; - bent_rad = (bent_dy / bent_dx) * bent_dy; - bent_subang = atan(bent_dx / bent_dy); - actual_mainlen = bent_rad * deg2rad(bent_subang); - + bent_dx = holeminrad; unbent_dx = bent_dx + deviationrad; - unbent_subang = atan(unbent_dx / actual_mainlen); - unbent_rad = actual_mainlen / deg2rad(unbent_subang); - main_cx = w*1.5 + unbent_rad; + unbent_subang = atan(unbent_dx / mainlen); + unbent_rad = mainlen / deg2rad(unbent_subang); + + corner_x = unbent_rad * (1 - cos(unbent_subang)); + corner_y = unbent_rad * sin(unbent_subang); + + main_cx = unbent_rad; + +// translate([w*1.5, 0, 0]) { +// translate([corner_x, corner_y, 10]) %cube([10,10,10]); +// translate([bent_dx, 0, 10]) %cube([10,10,10]); +// translate([unbent_dx, 5, 10]) %cube([10,10,10]); +// } for (xmir=[0,1]) mirror([xmir,0,0]) { linear_extrude(height=thick) { FlatArc(0,0, w*0.5, w*1.5, 270-1,360); - FlatArc($fa=1, main_cx,0, unbent_rad, unbent_rad+w, - 180-unbent_subang, 180); - translate([unbent_rad * (1 - cos(unbent_subang)) + w*1.5, - unbent_rad * sin(unbent_subang)]) - rotate([0,0,-unbent_subang]) { - translate([-(w + deviationrad), -0.1]) - square(size=[w + deviationrad, w+0.1]); - FlatArc(-deviationrad + handlerad, w, - handlerad, handlerad+w, - 180-rad2deg(handlelen/handlerad), 180); + translate([w*1.5, 0, 0]) { + FlatArc($fa=1, main_cx,0, unbent_rad, unbent_rad+w, + 180-unbent_subang, 180); + translate([corner_x, corner_y]) + rotate([0,0,-unbent_subang]) { + translate([-(w + deviationrad), -0.1]) + square(size=[w + deviationrad, w+0.1]); + FlatArc(-deviationrad + handlerad, w, + handlerad, handlerad+w, + 180-rad2deg(handlelen/handlerad), 180, + $fa=0.25, $fn=60); + } + } + } + } +} + +module SplitPinCavity(w=1.5, holeminrad=3.5, thick=3, deviationrad=1.0, + mainlen=20, slop=0.5, insertby = 5) { + smallgap2 = holeminrad; + biggap2 = smallgap2 + deviationrad + slop; + toegap2 = w*1.5 + slop; + toeend = -mainlen-insertby; + + translate([0,thick/2,0]) rotate([90,0,0]) { + linear_extrude(height = thick + slop*2) { + for (xmir=[0,1]) mirror([xmir,0]) { + polygon([[-0.1, 1], + [biggap2, 1], + [smallgap2, -insertby], + [biggap2, -insertby], + [toegap2, toeend-1], + [-0.1, toeend-1]]); } } } } SplitPin(); +translate([30,0,0]) + SplitPinCavity();