chiark / gitweb /
fairphone-case: Introduce CaseAperture (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 21 Jan 2018 16:42:03 +0000 (16:42 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 21 Jan 2018 16:42:03 +0000 (16:42 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
fairphone-case.scad

index 116ebfd79e91d0b97157a02c66466d421aa9d1af..a42245321346e5bbccc666351ab82fd64659c415 100644 (file)
@@ -266,6 +266,16 @@ module AroundEdges(fill_zstart, fill_th, fill_downwards=0){
               [phone_width, -phone_height] + [-1,+1] * phone_cnr_rad);
 }
 
               [phone_width, -phone_height] + [-1,+1] * phone_cnr_rad);
 }
 
+module CaseAperture(pos, dia) { // pass $fn too
+  theta = 180/$fn;
+  translate([ pos[0] + bumper[0],
+             -epp2i[0],
+             -pos[1] ])
+    rotate([-90, theta, 0])
+    cylinder(r = jack_dia/2 / cos(theta),
+            h = 60);
+}
+
 module SideButton(y, y_ref_sign, l){
   // y_ref_sign:
   //   +1  measured from top    of actual phone to top    of button
 module SideButton(y, y_ref_sign, l){
   // y_ref_sign:
   //   +1  measured from top    of actual phone to top    of button
@@ -377,14 +387,8 @@ module Case(){ ////toplevel
         }
     }
 
         }
     }
 
-    // jack
-    translate([ jack_pos[0] + bumper[0],
-               -epp2i[0],
-               -jack_pos[1] ])
-      rotate([-90, 22.5, 0])
-      cylinder(r = jack_dia/2 / cos(22.5),
-              h = 60,
-              $fn=8);
+    // apertures along top edge
+    CaseAperture(jack_pos, jack_dia, $fn=8);
   }
 }
 
   }
 }