3 include <cliphook.scad>
6 function deg2rad(deg) = deg/360 * tau;
7 function rad2deg(rad) = rad/tau * 360;
9 module SplitPin(w=1.5, holeminrad=3.5, thick=3, deviationrad=1.0,
10 mainlen=20, handlerad=10, handlelen=7) {
11 spare = holeminrad - deviationrad - w;
12 echo("splitpin spare",spare);
13 %translate([0,mainlen+handlelen,0]) cylinder(r=spare, h=thick);
14 %translate([0,mainlen,thick/2]) rotate([90,0,0])
15 cylinder(r=holeminrad, h=thick);
18 unbent_dx = bent_dx + deviationrad;
20 unbent_subang = atan(unbent_dx / mainlen);
21 unbent_rad = mainlen / deg2rad(unbent_subang);
23 corner_x = unbent_rad * (1 - cos(unbent_subang));
24 corner_y = unbent_rad * sin(unbent_subang);
28 // translate([w*1.5, 0, 0]) {
29 // translate([corner_x, corner_y, 10]) %cube([10,10,10]);
30 // translate([bent_dx, 0, 10]) %cube([10,10,10]);
31 // translate([unbent_dx, 5, 10]) %cube([10,10,10]);
34 for (xmir=[0,1]) mirror([xmir,0,0]) {
35 linear_extrude(height=thick) {
36 FlatArc(0,0, w*0.5, w*1.5, 270-1,360);
37 translate([w*1.5, 0, 0]) {
38 FlatArc($fa=1, main_cx,0, unbent_rad, unbent_rad+w,
39 180-unbent_subang, 180);
40 translate([corner_x, corner_y])
41 rotate([0,0,-unbent_subang]) {
42 translate([-(w + deviationrad), -0.1])
43 square(size=[w + deviationrad, w+0.1]);
44 FlatArc(-deviationrad + handlerad, w,
45 handlerad, handlerad+w,
46 180-rad2deg(handlelen/handlerad), 180,
54 module SplitPinCavity(w=1.5, holeminrad=3.5, thick=3, deviationrad=1.0,
55 mainlen=20, slop=0.5, insertby = 5) {
56 smallgap2 = holeminrad;
57 biggap2 = smallgap2 + deviationrad + slop;
58 toegap2 = w*1.5 + slop;
59 toeend = -mainlen-insertby;
61 //translate([-biggap2, -thick/2, -mainlen-1])
62 linear_extrude(height = thick + slop*2) {
63 polygon([[-biggap2, -insertby], [-biggap2, 1],
64 [biggap2, 1], [biggap2, -insertby],
65 [toegap2, toeend-1], [-toegap2, toeend-1]]);
68 // cube([biggap, thick, mainlen+2]);