chiark / gitweb /
simplephone-case: wip rounding
[reprap-play.git] / simplephone-case.scad
index 95a8fae3432e8cf80759722c3c57160a13fee858..caf465e496b3d2a20b80dcb414cc36d5f390f946 100644 (file)
@@ -8,7 +8,7 @@ psz = [
 
 thick = [
         2,
-        3,
+        2,
         2.5,
         ];
 
@@ -19,18 +19,50 @@ btn_yprop = 0.23;
 abtn_x = 45;
 abtn_sz = [ 11, 13 ];
 
+screen_xbot = 67;
+screen_sz = [ 45, 46 ];
+
+thumb_xbot = 90;
+thumb_dia = 25;
+
 rail_ysz = 2.5;
 rail_zsz = 2.5;
 
+case_x_less = 0; //case_x_less = 10;
+
+inner_cnr_rad = 2.0;
+
 // calculated
 
 ym = psz[1]/2;
 
+module RoundedProfile(sz, cnr_rad){
+  hull(){
+    for (x=[ cnr_rad, sz[0]-cnr_rad ])
+      for (y=[ cnr_rad, sz[1]-cnr_rad ])
+       translate([x,y])
+         circle(r= cnr_rad, $fn=20);
+  }
+}
+
+module RoundedCube(sz, cnr_rad){
+  hull(){
+    for (x=[ cnr_rad, sz[0]-cnr_rad ])
+      for (y=[ cnr_rad, sz[1]-cnr_rad ])
+       for (z=[ cnr_rad, sz[2]-cnr_rad ])
+         translate([x,y,z])
+           sphere(r= cnr_rad, $fn=20);
+  }
+}
+
 module Case(){
   difference(){
     mirror([1,0,0])
       translate(-thick)
-      cube(psz + 2*thick - [1,0,0] * (thick[0]));
+      cube(psz
+          + 2*thick
+          - [1,0,0] * (thick[0])
+          - [case_x_less, 0, 0]);
 
     for (yp= [ btn_yprop, 1-btn_yprop ])
       translate([ -btn_x,
@@ -41,7 +73,23 @@ module Case(){
     translate([ -abtn_x,
                btn_yprop * psz[1],
                psz[2] ])
-      cube(concat(abtn_sz, thick[2]*3), center=true);
+      cube(concat(abtn_sz, [ thick[2]*3 ]), center=true);
+
+    mirror([1,0,0])
+      translate([ screen_xbot,
+                 (psz[1] - screen_sz[1])/2,
+                 psz[2]-1 ])
+      cube(concat(screen_sz, [ thick[2]+2 ]));
+
+    hull(){
+      for (x=[ thumb_xbot+thumb_dia/2, psz[0]+10 ])
+       translate([ -x,
+                   ym,
+                   -thick[2]-1 ])
+         cylinder(r= thumb_dia/2,
+                  h= thick[2] + 2,
+                  $fn= 20);
+    }
 
     mirror([1,0,0])
       difference(){
@@ -57,3 +105,4 @@ module Case(){
 }
 
 Case();
+//RoundedCube(psz, inner_cnr_rad);