chiark / gitweb /
fairphone-case: hinge: take max of r1 and r2
[reprap-play.git] / fairphone-case.scad
index 39ad7c067ce84954a886c1af9619f11bbc6d8c88..bcd8eb8a25757bd2416b0295c73aee733e78eae0 100644 (file)
@@ -26,14 +26,14 @@ jack_dia = 9.1 + .5; // some jack I had lying around
 noisecancelmic_pos = [ 19.54, 7.37 ];   // from rhs
 noisecancelmic_dia = 1.75;
 
-fingerpushhole_dias = [ 14, 17 ];
+fingerpushhole_dias = [ 15, 18 ];
 
 rearspeaker_pos_bl = [ 12.64, 18.72 ];
 rearspeaker_size   = [  3.76,  7.36 ];
 
-microusb_above = 4.48 + 0.50;
-microusb_below = 1.82 + 0.50;
-microusb_width = 10.60 + 1.00;
+microusb_above = 3.27 - 0.25;
+microusb_below = 0.0;
+microusb_width = 16.12 + 0.25;
 
 case_th_bottom = 2.5;
 case_th_lid = 2.5;
@@ -145,9 +145,12 @@ bppJ = [ bppN[0], bppL[1] ];
 
 // hinge plan
 hp_rn = hingescrew_nut_dia/2;
-hp_r2 = hp_rn + lever_cover_th;
+hp_r2_min = hp_rn + lever_cover_th;
 hp_rs = hingescrew_shaft_dia/2;
-hp_r1 = hp_rs + hingemount_th;
+hp_r1_min = hp_rs + hingemount_th;
+
+hp_r1 = max(hp_r1_min, hp_r2_min);
+hp_r2 = hp_r1;
 
 hppU = lpp13;
 hppS = epp2o + [0,-1] * case_th_bottom;
@@ -155,8 +158,8 @@ hp_k = 0.5 * (hppU[1] - hppS[1] + foldover_gap);
 
 hppM = [ epp4[0] - foldover_lever_gap - hp_r2,
         0.5 * (hppU + hppS)[1] ];
-hppT = hppM + 0.5 * [0,+1] * hp_k;
-hppB = hppM + 0.5 * [0,-1] * hp_k;
+hppT = [ hppM[0], hppU[1] - hp_r1 ];
+hppB = hppT + [0,-1] * hp_k;
 
 // hinge elevation x coords
 
@@ -457,6 +460,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])
@@ -594,6 +605,10 @@ module HingeLever(){ ////toplevel
 
     // bores for the screws
     HingeScrews();
+
+    // space for the charging cable
+    MicroUSB();
+    Flip_hinge() MicroUSB();
   }
 }
 
@@ -767,18 +782,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