chiark / gitweb /
simplephone-case: adjust cnr
[reprap-play.git] / simplephone-case.scad
index 95593388de4bb6fdd04dcdcdc7e0333e834dcdf0..40045d921b3884f2481a2351a3e5d7bb10201298 100644 (file)
@@ -2,7 +2,7 @@
 
 psz = [
        120,
-       56 + 5,
+       56 + 5 - 3.75,
        15 + 3,
        ];
 
@@ -12,33 +12,44 @@ thick = [
         1.5,
         ];
 
-btn_x = 58;
+btn_x = 59.6;
 btn_dia = 13;
-btn_yprop = 0.23;
+btn_y = 14.03;
 
-abtn_x = 45;
+abtn_x = 46.85;
 abtn_sz = [ 11, 13 ];
 
-screen_xbot = 67;
-screen_sz = [ 45, 46 ];
+screen_xbot = 79;
+screen_sz = [ 35, 46 ];
 
 thumb_xbot = 90;
 thumb_dia = 25;
 
+vol_xbot = 87.4;
+vol_xtop = 106.7;
+vol_depth = 1.0;
+vol_zsz = 9;
+vol_zoff = 0;
+
 rail_ysz = 2.5;
 rail_zsz = 2.5;
 
 case_x_less = 0; //case_x_less = 10;
 
-inner_cnr_rad = 3.0;
+inner_cnr_rad = 4.0;
 
 // calculated
 
+btn_yprop = btn_y / psz[1];
+echo(btn_yprop);
+
 ym = psz[1]/2;
 outer_cnr_rad = inner_cnr_rad + thick[2];
 
 x_sliced = outer_cnr_rad * (1-sin(45));
 
+$screen = true;
+
 module RoundedProfile(sz, cnr_rad){
   hull(){
     for (x=[ cnr_rad, sz[0]-cnr_rad ])
@@ -49,12 +60,14 @@ module RoundedProfile(sz, cnr_rad){
 }
 
 module RoundedCube(sz, cnr_rad){
-  hull(){
+  if ($test)
+    cube(sz);
+  else 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);
+           sphere(r= cnr_rad, $fn=40);
   }
 }
 
@@ -81,7 +94,8 @@ module Case(){
                psz[2] ])
       cube(concat(abtn_sz, [ thick[2]*3 ]), center=true);
 
-    mirror([1,0,0])
+    if ($screen)
+      mirror([1,0,0])
       translate([ screen_xbot,
                  (psz[1] - screen_sz[1])/2,
                  psz[2]-1 ])
@@ -97,6 +111,10 @@ module Case(){
                   $fn= 20);
     }
 
+    mirror([1,0,0])
+      translate([ (vol_xbot+vol_xtop)/2, 0, psz[2]/2 + vol_zoff ])
+      cube([ vol_xtop-vol_xbot, vol_depth*2, vol_zsz ], center=true);
+
     translate([ thick[0], -10, -10 ])
       cube([ 10, psz[1]+20, psz[2]+20 ]);
 
@@ -116,5 +134,14 @@ module Case(){
   }
 }
 
+module TestLoop(){
+  intersection(){
+    Case($screen=false);
+    translate([ -vol_xbot, 0,0 ])
+      cube([ 4, 200,200 ], center=true);
+  }
+}
+
 Case();
+//TestLoop();
 //RoundedCube(psz, inner_cnr_rad);