chiark / gitweb /
fairphone-case: DemoHinge: translate so default view is of hinges
[reprap-play.git] / fairphone-case.scad
index fbbbf99699efbaf3a68e0fcf0c220f0e51c3b310..43e847eac2c38680a402368d6ea5008475d2db61 100644 (file)
@@ -238,11 +238,15 @@ hex24 = hex20 + hingescrew_shaft_len + hinge_x_postscrew_gap;
 
 echo(hex20, hex21, hex22, hex23, hex24);
 //  6, 10.8725, 10.9975, 13.74, 18.75
-echo(hex20 - 6,
-     hex21 - 10.8725,
-     hex22 - 10.9975,
-     hex23 - 13.74,
-     hex24 - 18.75);
+module chk(act,exp) {
+  if (abs(act-exp) > 1e-9) echo("WRONG", act, exp);
+  else echo("ok", act);
+}
+chk(hex20, 6);
+chk(hex21, 10.8725);
+chk(hex22, 10.9975);
+chk(hex23, 13.74);
+chk(hex24, 18.75);
 //echo(hingescrew_portion_len);
 
 // catch
@@ -1160,9 +1164,11 @@ module DemoHingedFrame(){ ///toplevel
 }
 
 module DemoHinge(){ ////toplevel
-  DemoFrame();
-  translate([0,0, -hp_k*3])
-    DemoHingedFrame();
+  translate([ -0.5*phone_width, phone_height, hp_k*3 ]) {
+    DemoFrame();
+    translate([0,0, -hp_k*3])
+      DemoHingedFrame();
+  }
 }
 
 module DemoProfiles(){ ////toplevel