chiark / gitweb /
fairphone-case: working LidEdgeFoldClearanceProfile
[reprap-play.git] / fairphone-case.scad
index 75c45ad2ae347610c4dc4d4c9e053e0eb5f2791a..b781957575f5c684fd266d355dbcc854857e9e6c 100644 (file)
@@ -521,6 +521,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 ],
@@ -561,10 +570,6 @@ module ButtonPlan(l, deep, cut){
   I0 = [ E0[0], H[1] ];
   I1 = [ E1[0], H[1] ];
 
-  multmatrix([[ 1, $button_plan_shear ? 0.4 : 0, 0 ],
-             [ 0,1,0 ],
-             [ 0,0,1 ],
-             ]){
   hull(){
     for (m=[0,1]) mirror([m,0])
       circleat(H, r0 - epsilon);
@@ -582,7 +587,6 @@ module ButtonPlan(l, deep, cut){
       circleat(D, r0 + epsilon);
     }
   }
-  }
 }
 
 module CatchCatchProfile(){
@@ -693,7 +697,6 @@ module SideButton(y, y_ref_sign, l, suppress_over_keeper=0){
 
 module LidButtonishLeg(y, y_ref_sign, l=buttonishleg_default_l_is_fudge) {
   $button_leg_only = true;
-  $button_plan_shear = true;
   SideButton(y, y_ref_sign, l) children();
 }
 
@@ -1061,11 +1064,28 @@ module LidAdhocMultiprintFrame(phase){
   }
 }
 
+module LidAroundEdges(){
+  AroundEdges(lpp10[1], lpp13[1] - lpp10[1], 0)
+    children();
+}
+
 module Lid(){ ////toplevel
+  skew_centre = [0, lpp11[0], lpp11[1]];
   difference(){
     union(){
-      AroundEdges(lpp10[1], lpp13[1] - lpp10[1], 0)
-        LidEdgeProfile();
+      intersection(){
+       LidAroundEdges()
+         LidEdgeProfile();
+
+       translate(skew_centre)
+         multmatrix([[ 1, 0, 0, 0 ],
+                     [ 0, 1, -2, 0 ],
+                     [ 0, 0, 1, 0 ],
+                     [ 0, 0, 0, 1 ]])
+         translate(-skew_centre)
+         LidAroundEdges()
+         LidEdgeFoldClearanceProfile();
+      }
 
       // button covers
       Buttons(){
@@ -1429,7 +1449,7 @@ module DemoHingeAngle(ang1,ang2){
 }
 
 module DemoHingeAngles(){ ////toplevel
-  angles = [ 0, 6, 12, 16, 24, 36 ];
+  angles = [ 0, 4, 8, 12 ];
   echo("angles",angles);
   for (i=[0 : len(angles)-1]) {
     translate(i * [0, 0, 30]) {