chiark / gitweb /
fairphone-case: make lid_close_clearance_skew into a variable
[reprap-play.git] / fairphone-case.scad
index d3eafb38d3c2c6088c20871ec8a7fee1690c4284..0b2ad4dbf2e2d483b616aea150ac838c4d1e951f 100644 (file)
@@ -336,6 +336,8 @@ lpp13 = [ lpp12[0],            lpp12[1] + lp_r12 ];
 
 case_bottom_z = epp2o[1] - case_th_bottom;
 
+lid_close_clearance_skew = 1.3;
+
 // button profile
 bppM = epp4 + [0,5];
 bppN = [ 0.5 * (epp0[0] + epp4[0]), bppM[1] ];
@@ -521,6 +523,15 @@ module LidEdgeProfile(){
   }
 }
 
+module LidEdgeFoldClearanceProfile(){
+  polygon([ lpp10,
+           lpp11,
+           lpp11 + [-20,  0],
+           lpp11 + [-20, 20],
+           lpp11 + [+20, 20],
+           lpp10 + [+20,  0] ]);
+}
+
 module ButtonCoverProfile(){
   intersection(){
     polygon(concat([ bppM, bppP, bppO, bppJ ],
@@ -824,7 +835,7 @@ module HingePortion(x0,x1){
     mirror([1,0,0])
     rotate([90,0,-90])
     linear_extrude(height=x1-x0)
-    children(0);
+    children();
 }
 
 module CatchPortion(width){
@@ -1064,8 +1075,19 @@ module Lid(){ ////toplevel
   skew_centre = [0, lpp11[0], lpp11[1]];
   difference(){
     union(){
-      LidAroundEdges()
-       LidEdgeProfile();
+      intersection(){
+       LidAroundEdges()
+         LidEdgeProfile();
+
+       translate(skew_centre)
+         multmatrix([[ 1, 0, 0, 0 ],
+                     [ 0, 1, -lid_close_clearance_skew, 0 ],
+                     [ 0, 0, 1, 0 ],
+                     [ 0, 0, 0, 1 ]])
+         translate(-skew_centre)
+         LidAroundEdges()
+         LidEdgeFoldClearanceProfile();
+      }
 
       // button covers
       Buttons(){
@@ -1082,7 +1104,10 @@ module Lid(){ ////toplevel
       }
 
       // hinge arms
-      HingePortion(hex20, hex21) HingeLidProfile();
+      HingePortion(hex20, hex21) {
+       LidEdgeProfile();
+       HingeLidProfile();
+      }
 
       // catch
       CatchPortion(catch_width)