5 module FArcSegment_mask(beta) {
6 for (i=[0 : 0.75 : 3]) {
10 [cos(beta/4), sin(beta/4)]]);
14 module FArcSegment(xc,yc,inrad,outrad,alpha,delta) {
18 circle(r=outrad, $fn=70);
19 circle(r=inrad, $fn=70);
21 rotate(alpha) scale(outrad*2) {
22 FArcSegment_mask(delta);
29 tubeheight = 30 + tubeslop;
30 tubewidth = 15 + tubeslop;
44 tuberad = tubewidth/2;
45 bend = atan(tuberad/stemlen);
46 mainoutrad = tuberad + mainthick;
47 hookoutrad = hookinrad + hookwidth;
48 hookcy = -(stemlen - hookoutrad);
50 eltop = [topwidth/2, -tuberad + tubeheight + mainthick + 0.1];
51 elmid = [topwidth/2, -tuberad];
52 ellow = tangent_intersect_b([0,hookcy], hookinrad, elmid);
53 ellowextra = 180 - tangent_intersect_beta([0,hookcy], hookinrad, elmid);
55 module ClipPlan(qbend, qstemleny){
56 dy = tubeheight - tuberad*2;
57 FArcSegment(0, dy, tuberad, mainoutrad, -1, 181);
58 FArcSegment(0, 0, tuberad, mainoutrad, -qbend, qbend+1);
59 translate([tuberad, 0]) square(center=false, size=[mainthick,dy]);
60 FArcSegment(0, 0, tuberad, tuberad + clipthick, 360-clipang, clipang+1);
61 rotate(-qbend) translate([tuberad, 0]) mirror([0,1])
62 square(center=false, size=[mainthick, qstemleny/cos(qbend)]);
66 ClipPlan(bend,stemlen);
69 module ElevationCore(){
70 FArcSegment(0, hookcy, hookinrad, hookoutrad,
72 90 + hookcurl + ellowextra);
73 translate([-hookoutrad*sqrt(0.5),
74 hookcy - hookoutrad*sqrt(0.5) + 0.1])
76 square(center=false, size=[topwidth, stemlen + tubeheight + 20]);
77 polygon([[-hookoutrad, ellow[1]],
84 // after here is all 3D
88 translate([0,0, -(topwidth+10)/2])
89 linear_extrude(height=topwidth+10) Plan();
92 linear_extrude(height=100)
98 translate([-100,-100,0]) cube(center=false,size=[200,200,200]);
101 taperangle = -270 + tangent_intersect_beta([-hookcy, 0],
103 [-eltop[1], -eltop[0]]);
104 module Hook(){ ////toplevel
106 rotate([taperangle,0,0])
107 translate([0,-eltop[1],0])
109 translate([0,0,topwidth/2])
110 rotate([taperangle*2,0,0])
112 translate([0,0,-topwidth/2])
113 mirror([0,0,1]) PlaneAbove(0);
117 // straight-on version, everything prefixed with s or S
119 shookcy = -(stemlen-hookoutrad);
120 sstemleny = -shookcy;
121 sbend_raw = tangents_intersect_beta([0,0],tuberad,
122 [0,shookcy],hookinrad);
123 sbend = angle_map_range(360-sbend_raw, -180);
126 ClipPlan(sbend, sstemleny);
127 FArcSegment(0,shookcy, hookinrad,hookoutrad,
129 hookcurl + 90 - sbend);
134 module RightHook(){ ////toplevel
135 mirror([1,0,0]) Hook();
139 translate([60,0,0]) ElevationCore();