chiark / gitweb /
simplephone-case: reduce thick
[reprap-play.git] / simplephone-case.scad
1 // -*- C -*-
2
3 psz = [
4        120,
5        56 + 5,
6        15 + 3,
7        ];
8
9 thick = [
10          2,
11          2,
12          2.5,
13          ];
14
15 btn_x = 58;
16 btn_dia = 13;
17 btn_yprop = 0.23;
18
19 abtn_x = 45;
20 abtn_sz = [ 11, 13 ];
21
22 screen_xbot = 67;
23 screen_sz = [ 45, 46 ];
24
25 thumb_xbot = 90;
26 thumb_dia = 25;
27
28 rail_ysz = 2.5;
29 rail_zsz = 2.5;
30
31 case_x_less = 0; //case_x_less = 10;
32
33 // calculated
34
35 ym = psz[1]/2;
36
37 module Case(){
38   difference(){
39     mirror([1,0,0])
40       translate(-thick)
41       cube(psz
42            + 2*thick
43            - [1,0,0] * (thick[0])
44            - [case_x_less, 0, 0]);
45
46     for (yp= [ btn_yprop, 1-btn_yprop ])
47       translate([ -btn_x,
48                   yp * psz[1],
49                   0.5 * psz[2] ])
50         cylinder(r= btn_dia/2, h=20);
51
52     translate([ -abtn_x,
53                 btn_yprop * psz[1],
54                 psz[2] ])
55       cube(concat(abtn_sz, [ thick[2]*3 ]), center=true);
56
57     mirror([1,0,0])
58       translate([ screen_xbot,
59                   (psz[1] - screen_sz[1])/2,
60                   psz[2]-1 ])
61       cube(concat(screen_sz, [ thick[2]+2 ]));
62
63     hull(){
64       for (x=[ thumb_xbot+thumb_dia/2, psz[0]+10 ])
65         translate([ -x,
66                     ym,
67                     -thick[2]-1 ])
68           cylinder(r= thumb_dia/2,
69                    h= thick[2] + 2,
70                    $fn= 20);
71     }
72
73     mirror([1,0,0])
74       difference(){
75         cube(psz + [1,0,0]);
76
77         for (m=[0,1]) {
78           translate([0,ym,0]) mirror([0,m,0]) translate([0,-ym,0])
79             translate([-1,-1, psz[2]-rail_zsz])
80             cube([psz[0]+1, rail_ysz+1, rail_zsz+1]);
81         }
82       }
83   }
84 }
85
86 Case();