chiark / gitweb /
fairphone-case: some toplevels etc.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 20 Jan 2018 00:19:31 +0000 (00:19 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 20 Jan 2018 00:19:31 +0000 (00:19 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
fairphone-case.scad

index 08b0b1e..76427b1 100644 (file)
@@ -9,6 +9,9 @@ phone_edge_thick = 9.0;
 phone_total_thick = 12.0;
 phone_backside_slope = 1.0; // larger means shallower
 
+camera_pos_tl = [  7.5, 13.5 ]; // measured from tl corner
+camera_pos_br = [ 24.0, 39.5 ]; // tl/br as seen from back
+
 case_th_bottom = 2;
 case_th_lid = 2;
 case_th_side = 2;
@@ -76,8 +79,8 @@ module EdgeProfile(){
   }
 }
 
-module CaseBase_rhsflip() {
-  for (rhs=[0,1]) {
+module CaseBase_rhsflip(yn=[0,1]) {
+  for (rhs=yn) {
     translate([phone_width/2, 0, 0])
       mirror([rhs,0,0])
       translate([-phone_width/2, 0, 0])
@@ -95,12 +98,14 @@ module CaseBase_botflip() {
 }  
 
 module CaseBase(){
+  // sides
   CaseBase_rhsflip(){
     translate([0, -phone_cnr_rad, 0])
       rotate([90,0,0])
       linear_extrude(height = phone_height - phone_cnr_rad*2)
       EdgeProfile();
   }
+  // corners
   CaseBase_rhsflip() CaseBase_botflip() {
     translate([+1,-1] * phone_cnr_rad)
       intersection(){
@@ -115,17 +120,26 @@ module CaseBase(){
          cube([10,10,40]);
       }
   }
+  // top and bottom
   CaseBase_botflip(){
     translate([ phone_width - phone_cnr_rad, 0,0 ])
       rotate([90,0,-90])
       linear_extrude(height = phone_width - phone_cnr_rad*2)
       EdgeProfile();
   }
+  // fill
+  translate([0,0, epp3[1]])
+    mirror([0,0, 1])
+    linear_extrude(height = case_th_bottom)
+    rectfromto([+1,-1] * phone_cnr_rad,
+              [phone_width, -phone_height] + [-1,+1] * phone_cnr_rad);
 }
 
-module Case(){
+module Case(){ ////toplevel
   difference(){
     CaseBase();
+
+    // slots for keeper
     CaseBase_rhsflip()
       translate([0, -phone_cnr_rad, 0])
       rotate([90, 0, 0])
@@ -135,19 +149,52 @@ module Case(){
        rectfromto([ -keeper_gap_x,    -keeper_gap_z_bot ],
                   [ keeper_gap_x_holes,    +keeper_gap_z_top ]);
       }
+
+    // front camera
+    CaseBase_rhsflip([1])
+      mirror([0, 0, 1])
+      linear_extrude(height = 20)
+      mirror([0, 1, 0])
+      rectfromto(camera_pos_tl, camera_pos_br);
   }
 }
 
-module Keeper(){
-  CaseBase_rhsflip()
-    translate([0, -phone_cnr_rad, 0])
+module TestLength(){ ////toplevel
+  intersection(){
+    Case();
+    translate([-30, -200, -20])
+    cube([30 + 15, 250, 40]);
+  }
+}
+
+module TestWidth(){ ////toplevel
+  intersection(){
+    Case();
+    translate([-30, -(phone_height - 25), -20])
+      mirror([0, 1, 0])
+      cube([200, 50, 40]);
+  }
+}
+
+module OneKeeper(){ ////toplevel
+  translate([0, -phone_cnr_rad, 0])
     rotate([90, 0, 0])
     linear_extrude(height = phone_height - phone_cnr_rad * 2)
     KeeperProfile();
 }
 
+module OneKeeperPrint(){ ////toplevel
+  rotate([0,180,0])
+    OneKeeper();
+}
+
+module Keeper(){ ////toplevel
+  CaseBase_rhsflip()
+    OneKeeper();
+}
+
 //EdgeProfile();
 //KeeperProfile();
 //CaseBase();
-%Case();
-Keeper();
+//%Case();
+//Keeper();