chiark / gitweb /
fairphone-case: move keeper to lhs
[reprap-play.git] / fairphone-case.scad
index 64fe13d8e308f6b13ff4ee8eb74ec15ff56713b0..2a1d649ff16c5ab3c9ca01d93cecfa8a56c8ed26 100644 (file)
@@ -56,6 +56,8 @@ keeper_gap_z_bot = 0.75;
 keeper_gap_x     = 0.25;
 keeper_gap_x_holes = 0.75;
 
+keeper_side = 0; // 0 = lhs; 1 = rhs
+
 case_lip = 1.25;
 
 lid_gap_x = 0.25;
@@ -189,7 +191,8 @@ hex20 = max(epp2o[0],
            kppd[0] + hingescrew_head_th + keeper_gap_x_holes);
 hex21 = hex20 + hingescrew_portion_len;
 hex22 = hex21 + hinge_x_gap;
-hex23 = hex22 + hingescrew_portion_len;
+hex23 = hex22 + hingescrew_portion_len
+  - hingescrew_nut_thick; // bodge, need to divvy this up more sensibly
 hex24 = hex20 + hingescrew_shaft_len + hinge_x_postscrew_gap;
 echo(hex20, hex21, hex22, hex23, hex24);
 echo(hingescrew_portion_len);
@@ -422,7 +425,7 @@ module Buttons(){
   Flip_rhs(1) SideButton(15.580, +1, 8.9) children(); // power
   Flip_rhs(1) SideButton(48.700, -1, 8.920) children(); // camera
   Flip_rhs(0) SideButton(30.800, +1, 21.96) children(); // volume
-  Flip_rhs(   ) LidButtonishLeg(20, -1) children();
+  Flip_rhs(   ) LidButtonishLeg(14, -1) children();
 //  Flip_rhs(0) LidButtonishLeg(20, +1, 20) children();
 }
 
@@ -518,10 +521,10 @@ module HingeLeverOuterProfile(){
 module HingeLeverInnerProfile(){
   for (c = [hppT, hppB]) {
     hull()
-      for (x=[0,20])
-       translate([x,0])
-         circleat(c, hp_rn);
-       circleat(hppB, hp_rn);
+      for (x=[-20,20])
+       for (y=[0, c[1] - hppM[1]])
+         translate([x,y])
+           circleat(c, hp_rn);
   }
 }
 
@@ -560,7 +563,7 @@ module Case(){ ////toplevel
       CaseBase();
 
       // ledge (fixed keeper)
-      intersection(){
+      Flip_rhs(1-keeper_side) intersection(){
        rotate([90, 0, 0])
          linear_extrude(height = phone_height + phone_cnr_rad * 2)
          KeeperProfile(1);
@@ -569,7 +572,6 @@ module Case(){ ////toplevel
        translate([0,0, -25])
          linear_extrude(height = 50)
          hull()
-         // Flip_rhs() // actually, we only care about the LH
          Flip_bot()
          circleat([+1,-1] * phone_cnr_rad, phone_cnr_rad + case_th_side/2);
       }
@@ -579,7 +581,7 @@ module Case(){ ////toplevel
     }
 
     // slot for keeper
-    Flip_rhs(1)
+    Flip_rhs(keeper_side)
       translate([0, -phone_cnr_rad, 0])
       rotate([90, 0, 0])
       linear_extrude(height = phone_height + phone_cnr_rad * 2)
@@ -605,7 +607,7 @@ module Case(){ ////toplevel
            if ($button_leg_only)
              rotate([-90,90,0])
                translate([phone_width/2, -400, kppe[1]])
-               mirror([$rhsflip,0,0]) cube([400, 800, 50]);
+               mirror([1-abs($rhsflip - keeper_side),0,0]) cube([400, 800, 50]);
          }
          translate([0,0, -bppR[0]])
            linear_extrude(height= 20)
@@ -827,11 +829,6 @@ module TestFrameLidPrint(){ ////toplevel
   }
 }
 
-module Keeper(){ ////toplevel
-  Flip_rhs()
-    OneKeeper();
-}
-
 module ButtonPlanForDemo(z, deep, cut){
   translate([0,0,z])
     ButtonPlan(8, deep, cut);