chiark / gitweb /
fairphone-case: refactor tests (nfc)
[reprap-play.git] / fairphone-case.scad
index 15ac7fce9bc25025fec92d99c4b1b7a48cc7b243..42de8f9373364a52dd89e6eb795f739cd9658cab 100644 (file)
@@ -161,6 +161,8 @@ module ButtonPlan(l, deep, cut){
   G = T + [0,10];
 
   B0 = C + [0,-1] * button_cutout_depth;
+  B1 = B0 + [0,1] * epsilon;
+
   r0 = 0.5 * (T[1] - B0[1]);
   A = [  -(l + button_l_fudge)/2 + r0, 0.5 * (T[1] + B0[1]) ];
   H = A + [0,-1] * delta;
@@ -183,7 +185,7 @@ module ButtonPlan(l, deep, cut){
       polygon([ E1,
                I1,
                H,
-               B0,
+               B1,
                G,
                F,
                D
@@ -370,37 +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 TestLidByCamera(){ ////toplevel
+  intersection(){
+    Lid();
+    TestSelectCamera();
+  }
+}
+
+module TestLidByCameraPrint(){ ////toplevel
+  rotate([180,0,0]) TestLidByCamera();
+}
+
 module OneKeeper(){ ////toplevel
   translate([0, -phone_cnr_rad, 0])
     rotate([90, 0, 0])