chiark / gitweb /
cliphook wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Aug 2012 16:05:30 +0000 (17:05 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Aug 2012 16:05:30 +0000 (17:05 +0100)
cliphook.scad [new file with mode: 0644]
pronsolerc

diff --git a/cliphook.scad b/cliphook.scad
new file mode 100644 (file)
index 0000000..de9c4ae
--- /dev/null
@@ -0,0 +1,56 @@
+
+tau = 6.283;
+function rads2degs(rads) = rads * 360/tau;
+
+function ClipHook_r2(w,g,l,ye,k) = w/2 + g + w/2;
+function ClipHook_r3(w,g,l,ye,k) = k * ClipHook_r2(w,g,l,ye,k);
+function ClipHook_yce(w,g,l,ye,k) = g/2 + w + g + w/2 - ClipHook_r3(w,g,l,ye,k);
+function ClipHook_xe(w,g,l,ye,k) =
+       sqrt(pow( ClipHook_r3(w,g,l,ye,k),      2) -
+            pow( ClipHook_yce(w,g,l,ye,k) + ye, 2));
+
+module ClipHook(w=1.2, g=0.2, l=0.0, ye=0, k=3.0, h=3.5) {
+  r2 =  ClipHook_r2(w,g,l,ye,k);
+  r3 =  ClipHook_r3(w,g,l,ye,k);
+  yce = ClipHook_yce(w,g,l,ye,k);
+  xe =  ClipHook_xe(w,g,l,ye,k);
+
+  xc = -l/2;
+  yc = g/w + w/2;
+
+  echo("ClipHook(w g l ye k h) ", w, g, l, ye, k, h);
+  echo("ClipHook r2 r3 yce xe =", r2, r3, yce, xe);
+
+  $fn = 20;
+
+  module jcirc(x,y) { translate([x,y,0]) circle(r=w/2); }
+  module jarc(cx,cy,r,a1=0,a2=tau) {
+    astep = (a2-a1)/6;
+    size = 5*(r+w/2);
+    translate([cx,cy,0]) {
+      intersection() {
+       difference() {
+               circle(r=r+w/2);
+               translate([0,0,-1])
+                       circle(r=r-w/2, h=h+2);
+       }
+       scale(size,size) {
+         for (ai=[0:4]) {
+           echo(" jarc ", a1,a2, astep, ai, rads2degs(a1 + astep*ai) );
+           rotate(rads2degs(a1 + astep*ai)) {
+             polygon([ [0,0], [1,0],
+                       [cos(rads2degs(astep*2)),sin(rads2degs(astep*2))] ]);
+           }
+         }
+       }
+      }
+    }
+  }
+
+  linear_extrude(height=h) {
+    jcirc(-xc, -yc);
+    jarc(xc, yc, r2, tau*0.25, tau*0.75);
+  }
+}
+
+ClipHook(l=3);
index c7bd345..979daff 100644 (file)
@@ -13,7 +13,7 @@ button 11 "UP" G1 Z6 F200
 button 12 "FR" G1 X15 Y135 F12000
 set last_bed_temperature 70.0
 set baudrate 115200
-set last_file_path /home/reprap/dl-things.git/th-10254
+set last_file_path /home/reprap/play
 set xy_feedrate 3000
 set z_feedrate 200
 set e_feedrate 1500