chiark / gitweb /
bike-phone-mount: wip
[reprap-play.git] / bike-phone-mount.scad
index 0ffd347a0001ae22c7b706790df2df0ef7f9dfc7..576e7494433b3ffa505c857ac842edde28bf8cf1 100644 (file)
@@ -10,8 +10,12 @@ neck_width = 26.5 - 0.45;
 neck_depth = 28.5 - 0.45;
 neck_length = 1.5 + 0.50;
 
+demo_ceil = 5;
+
 slope = 0.35;
 
+// calculated
+
 nep0 = [0,0];
 nep1 = nep0 + [0,1] * neck_length;
 nep7 = nep0 + [1,0] * lip_depth;
@@ -22,11 +26,10 @@ nep6 = nep7 + [0,-1] * lip_height;
 nep5 = [ nep4[0], nep6[1] ];
 nepm = [ nep0[0], nep3[1] ];
 
-total_height = nep2[1] - nep6[0];
+total_height = nep2[1] - nep6[1];
 nep_z_offset = -nep2[1];
 nep_side_offset = [ neck_width/2, nep_z_offset ];
-nep_rear_offset = [ neck_depth/2, nep_z_offset ];
-inner_pos = [-0.1, -total_height];
+nep_rear_offset = [ neck_depth, nep_z_offset ];
 
 module NeckEdgePlan() {
   polygon([ nep0,
@@ -40,14 +43,38 @@ module NeckEdgePlan() {
 }
 
 module Neck() {
-  for (m=[0,1]) {
-    mirror([m,0]) {
-      translate(nep_side_offset) NeckEdgePlan();
-      rectfromto(inner_pos,
-                nep_side_offset + nepm);
+  intersection(){
+    linextr_y_xz(-100,100,convexity=10){
+      for (m=[0,1]) {
+       mirror([m,0]) {
+         translate(nep_side_offset) NeckEdgePlan();
+         rectfromto([-0.1, -total_height],
+                    nep_side_offset + nepm);
+       }
+      }
     }
+    linextr_x_yz(-100,100,convexity=10){
+      translate(nep_rear_offset) NeckEdgePlan();
+      rectfromto([0, -total_height],
+                nep_rear_offset + nepm);
+    }
+  }
+}
+
+module DemoCeil() {
+  linextr(0, 0.8) {
+    rectfromto
+      ([ -(neck_width/2 + demo_ceil), -demo_ceil ],
+       [ +(neck_width/2 + demo_ceil), neck_depth + demo_ceil]);
   }
 }
 
+module Demo(){
+  Neck();
+  DemoCeil();
+}
+
 //NeckEdgePlan();
-Neck();
+//Neck();
+//DemoCeil();
+Demo();