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

index a81bb6127a4c9ee92bf9fc8b3a8fd6bedbf6ae8d..42de8f9373364a52dd89e6eb795f739cd9658cab 100644 (file)
@@ -372,49 +372,50 @@ module TestLength(){ ////toplevel
   }
 }
 
+module TestSelectWidth(){
+  translate([-30, -(phone_height - 25), -20])
+    mirror([0, 1, 0])
+    cube([200, 50, 40]);
+}
+
 module TestWidth(){ ////toplevel
   intersection(){
     Case();
-    translate([-30, -(phone_height - 25), -20])
-      mirror([0, 1, 0])
-      cube([200, 50, 40]);
+    TestSelectWidth();
   }
 }
 
 module TestLidWidthPrint(){ ////toplevel
-  rotate([0,180.0])
-    intersection(){
-      Lid();
-      translate([-30, -(phone_height - 25), -20])
-       mirror([0, 1, 0])
-       cube([200, 50, 40]);
-    }
+  rotate([0,180.0]) TestLidWidth();
+}
+
+module TestSelectCamera(){
+  CaseBase_rhsflip(1)
+    translate([0,0,-25])
+    linear_extrude(height = 50)
+    mirror([0, 1, 0])
+    rectfromto([-20, -20],
+              camera_pos_br + [ 5, 5 ]);
 }
 
 module TestCamera(){ ////toplevel
   intersection(){
     Case();
-    CaseBase_rhsflip(1)
-      translate([0,0,-25])
-      linear_extrude(height = 50)
-      mirror([0, 1, 0])
-      rectfromto([-20, -20],
-                camera_pos_br + [ 5, 5 ]);
+    TestSelectCamera();
   }
 }
 
-module TestLidByCameraPrint(){ ////toplevel
-  rotate([180,0,0]) intersection(){
+module TestLidByCamera(){ ////toplevel
+  intersection(){
     Lid();
-    CaseBase_rhsflip(1)
-      translate([0,0,-25])
-      linear_extrude(height = 50)
-      mirror([0, 1, 0])
-      rectfromto([-20, -20],
-                camera_pos_br + [ 5, 5 ]);
+    TestSelectCamera();
   }
 }
 
+module TestLidByCameraPrint(){ ////toplevel
+  rotate([180,0,0]) TestLidByCamera();
+}
+
 module OneKeeper(){ ////toplevel
   translate([0, -phone_cnr_rad, 0])
     rotate([90, 0, 0])