chiark / gitweb /
wardrobe-hook: straight-on version: seems to work
[reprap-play.git] / wardrobe-hook.scad
index 331121cffc1772c73cefc8d38e703252bbb990eb..532ec44322a17ae456f1c3b7af3d44636c6ec2c1 100644 (file)
@@ -114,13 +114,37 @@ module Hook(){ ////toplevel
   }
 }
 
-// frontbackly version, everything prefixed with f or F
+// straight-on version, everything prefixed with s or S
+
+shookcy = -(stemlen-hookoutrad);
+sstemleny = -shookcy;
+sbend_raw = tangents_intersect_beta([0,0],tuberad,
+                                   [0,shookcy],hookinrad);
+sbend = angle_map_range(360-sbend_raw, -180);
+
+module SPlan(){
+  ClipPlan(sbend, sstemleny);
+  FArcSegment(0,shookcy, hookinrad,hookoutrad,
+             270 - hookcurl,
+             hookcurl + 90 - sbend);
+}
 
-fstemleny = -hookcy;
-fbend = atan((tuberad - hookinrad) / fstemleny);
+module SElevation(){
+  boty = shookcy - hookoutrad - 1;
+  polygon([[-1,         tubeheight],
+          [topwidth,   tubeheight],
+          [topwidth,   elmid[1]],
+          [hookwidth,  shookcy],
+          [hookwidth,  boty],
+          [-1,         boty]]);
+}
 
-module FPlan(){
-  ClipPlan(fbend, fstemleny);
+module SHook(){
+  intersection(){
+    linear_extrude(height=topwidth) SPlan();
+    rotate([0,-90,0]) translate([0,0,-100]) linear_extrude(height=200)
+      SElevation();
+  }
 }
 
 // toplevels etc.
@@ -129,7 +153,9 @@ module RightHook(){ ////toplevel
   mirror([1,0,0]) Hook();
 }
 
-FPlan();
-translate([60,0,0]) Plan();
+translate([-30,0,0]) SHook();
+//SPlan();
+//translate([30,0,0]) SElevation();
+//translate([120,0,0]) ElevationCore();
 //ElevationCore();
 //RightHook();