chiark / gitweb /
fairphone-case: introduce Flip_hinge (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 21 Jan 2018 21:06:45 +0000 (21:06 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 21 Jan 2018 21:06:45 +0000 (21:06 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
fairphone-case.scad

index 39ad7c067ce84954a886c1af9619f11bbc6d8c88..8ced1eb53ea432e801a3e11d79c8373982246967 100644 (file)
@@ -457,6 +457,14 @@ module HingeLeverInnerProfile(){
   }
 }
 
+module Flip_hinge(){
+  hinge_origin = [0, -(phone_height - hppB[0]), hppB[1]];
+  translate(hinge_origin)
+    rotate([180,0,0])
+    translate(-hinge_origin)
+    children();
+}
+
 module HingePortion(x0,x1){
   Flip_rhs() Flip_bot(1)
     translate([x0,0,0])
@@ -767,18 +775,14 @@ module DemoFrame(){ ////toplevel
 }
 
 module DemoHingedFrame(){ ///toplevel
-  hinge_origin = [0, -(phone_height - hppB[0]), hppB[1]];
-
   color("red") TestFrameCase();
   translate([0,0, -2*hp_k])
   color("blue") intersection(){ Lid(); TestSelectFrame(); }
-  
-  translate(hinge_origin)
-    rotate([180,0,0])
-    translate(-hinge_origin) {
-      color("orange") HingeLever();
-      color("black") HingeScrews();
-    }
+
+  Flip_hinge(){
+    color("orange") HingeLever();
+    color("black") HingeScrews();
+  }
 }
 
 module DemoHinge(){ ////toplevel