chiark / gitweb /
trailerhubcap for print
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 9 Sep 2012 15:03:39 +0000 (16:03 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 9 Sep 2012 15:03:39 +0000 (16:03 +0100)
trailerhubcap.scad

index e3bcd4d6abbfc3dfaa6550a39b8f58842677a385..e3eb46bc3d2edb1d61042578129a7b60a8585eed 100644 (file)
@@ -1,15 +1,73 @@
-mainrad = 28.4;
+maindia = 28.4;
 poleholeh = 5.0;
 polecovth = 0.4;
 poleholerad = 6;
-  
+
+mainoverlap = 1.5;
+
+hookbasew = 4;
+hookfullw = 6;
+hookheight = 4;
+hookwidth = 5;
+
+fingernaildepth = 5;
+fingernailheight = 2.5;
+fingernailwidth = 6;
+
+bigrad = maindia/2 + mainoverlap;
 mainth = poleholeh + polecovth;
+hooklessdepth = hookfullw - hookbasew;
+
+module base() {
+  rotate_extrude(convexity=10)
+    mirror([1,0,0])
+    polygon(points=[[-bigrad, 0],
+                   [-bigrad + mainth, -mainth],
+                   [0, -mainth],
+                   [0, -poleholeh],
+                   [-poleholerad, -poleholeh],
+                   [-poleholerad, 0]]);
+}
+
+module fingernails() {
+  for (ang=[60,180,300])
+    rotate([0,0,ang])
+      translate([bigrad - fingernaildepth,
+                -fingernailwidth/2,
+                -fingernailheight])
+      cube([fingernaildepth + 1, fingernailwidth, fingernailheight + 1]);
+}
+
+module hookrim() {
+  rotate_extrude(convexity=10)
+    mirror([1,0,0])
+    translate([-maindia/2, 0, 0])
+    polygon(points=[[hooklessdepth, 0],
+                   [hookfullw, 0],
+                   [hookfullw, hookheight],
+                   [0, hookheight],
+                   [0, hooklessdepth]]);
+}
+
+module hooktriangles() {
+  for (ang=[0,120,240]) {
+    rotate([0,0,ang]) {
+      translate([0,0,-1]) {
+       linear_extrude(height=hookheight+2) {
+         polygon(points=[[0, 0],
+                         [maindia/2 + 1, -hookwidth],
+                         [maindia/2 + 1, +hookwidth]]);
+       }
+      }
+    }
+  }
+}
 
-rotate_extrude(convexity=10)
-  mirror([1,0,0])
-  polygon(points=[[-mainrad/2, 0],
-                 [-mainrad/2 + mainth, -mainth],
-                 [0, -mainth],
-                 [0, -poleholeh],
-                 [-poleholerad, -poleholeh],
-                 [-poleholerad, 0]]);
+difference(){
+  base();
+  fingernails();
+}
+intersection(){
+  hookrim();
+  hooktriangles();
+}