chiark / gitweb /
fairphone-case: fix CodeBase_*flip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 19 Jan 2018 21:21:13 +0000 (21:21 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 19 Jan 2018 21:21:13 +0000 (21:21 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
fairphone-case.scad

index ce8ad76b92aad21900835c04b326df6fb271f37d..47d92f0d23b15c519b65dc043aed94999ecd8849 100644 (file)
@@ -57,23 +57,31 @@ module EdgeProfile(){
 }
 
 module CaseBase_rhsflip(rhs) {
-  translate([phone_width/2, -phone_cnr_rad, 0])
+  translate([phone_width/2, 0, 0])
     mirror([rhs,0,0])
-    translate([-phone_width/2,0,0])
+    translate([-phone_width/2, 0, 0])
     children();
 }
 
+module CaseBase_botflip(bot) {
+  translate([0, -phone_height/2, 0])
+    mirror([0, bot, 0])
+    translate([0, phone_height/2, 0])
+    children();
+}  
+
 module CaseBase(){
   for (rhs=[0,1]) {
     CaseBase_rhsflip(rhs){
-      rotate([90,0,0])
-       linear_extrude(height = phone_height - phone_cnr_rad)
+      translate([0, -phone_cnr_rad, 0])
+       rotate([90,0,0])
+       linear_extrude(height = phone_height - phone_cnr_rad*2)
        EdgeProfile();
     }
   }
   for (rhs=[0,1]) {
     CaseBase_rhsflip(rhs){
-      translate([+1,0] * phone_cnr_rad)
+      translate([+1,-1] * phone_cnr_rad)
        intersection(){
          rotate_extrude()
            intersection(){
@@ -87,10 +95,14 @@ module CaseBase(){
         }
     }
   }
-  translate([ phone_width - phone_cnr_rad, 0,0 ])
-    rotate([90,0,-90])
-    linear_extrude(height = phone_width - phone_cnr_rad*2)
-    EdgeProfile();
+  for (bot=[0,1]) {
+    CaseBase_botflip(bot){
+      translate([ phone_width - phone_cnr_rad, 0,0 ])
+       rotate([90,0,-90])
+       linear_extrude(height = phone_width - phone_cnr_rad*2)
+       EdgeProfile();
+    }
+  }
 }
 
 //EdgeProfile();