chiark / gitweb /
fairphone-case: use prop_recess_under in case
[reprap-play.git] / fairphone-case.scad
index 1728ea027661c0560a3a86867dcf34e4a888b742..ad36f45a262f5cb054742da1901eb9e5e38007eb 100644 (file)
@@ -117,7 +117,7 @@ prop_recess_slop = 0.200; // each side
 prop_end_dia = 0.5;
 prop_main_th = 3;
 prop_taper_len = 6;
-prop_main_width = 3;
+prop_main_width = 4;
 prop_side_gap = 0.75; // each side
 prop_lidrecess_behind = 0.75;
 prop_caserecess_behind = 0.75;
@@ -263,8 +263,8 @@ prcp2 = [ epp4[0] + prop_buildout_less,
 
 prop_caserecess_buildout_r = -1; // prcp2[0] - epp2o[0];
 
-prcp1 = [ epp2o[0],
-         epp2i[1] - prc_r3 ];
+prcp1 = [ epp2o[0] + prc_r3 + prop_caserecess_behind,
+         epp2i[1] - prc_r3 - prop_recess_under];
 
 // prop recess in lid
 
@@ -627,10 +627,10 @@ function prop_x(gamma) = hp_k / (2 * sin(gamma/2)) - hppT[0];
 module PropProfileAssignments(gamma){
   // https://en.wikipedia.org/wiki/Solution_of_triangles#Two_sides_and_the_included_angle_given_(SAS)
   x = prop_x(gamma);
-  p = phone_height - prlp10[0] - hppB[0];
+  p = phone_height + prlp10[0] - hppB[0];
   b = p + x;
 
-  q = phone_height - hppT[0]; // $prpp7[0] is 0 by definition
+  q = phone_height - hppT[0] - prcp1[0]; // $prpp7[0] is 0 by definition
   a = q + x;
   c = sqrt(a*a + b*b - 2*a*b*cos(gamma));
   $prp_alpha = acos( (b*b + c*c - a*a) / (2*b*c) );
@@ -644,7 +644,7 @@ module PropProfileAssignments(gamma){
   v1 = [ [ cos(psi), -sin(psi) ],    // x
         [ sin(psi),  cos(psi) ] ];  // y
 
-  $prpp7 = [0, c + (lpp13[1] - $prpp10[1]) ];
+  $prpp7 = [0, c + (lpp13[1] - $prpp10[1] - hp_k) ];
 
   $prp_r1 = prc_r1;
   $prp_r11 = prop_main_th/2;
@@ -681,7 +681,7 @@ module PropProfile(gamma, cut=0, rot=0){ ////toplevel
        translate($prpp8)
          intersection(){
            circle($prp_r8);
-           polygon([[-20,-0], [0,0], [20,20]]);
+           polygon([[-20,-0], [20,20], [0,0]]);
          }
        rectfromto($prpp6, $prpp9);
        translate($prpp5) intersection(){
@@ -821,9 +821,9 @@ module Case(){ ////toplevel
     // prop recess
     Flip_rhs(1)
       translate([prop_x_pos,0,0])
+      mirror([0,1,0])
       rotate([90,0,90])
       linextr(-prop_recess_hw, +prop_recess_hw)
-      mirror([1,0])
       hull(){
         for (d=[ [0,0], [0,-1], [+1,-1/prop_caserecess_taper] ])
          circleat(prcp1 + 20*d,
@@ -866,9 +866,9 @@ module Lid(){ ////toplevel
 
     // prop recess
     translate([prop_x_pos, -prlp10[0], prlp10[1]])
+      mirror([0,1,0])
       rotate([90,0,90])
       linextr(-prop_recess_hw, +prop_recess_hw)
-      mirror([1,0])
       hull()
       for (pa = prop_angles)
        PropProfile(pa, 1,1);