chiark / gitweb /
simplephone-case: abtn
[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          3,
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 rail_ysz = 2.5;
23 rail_zsz = 2.5;
24
25 // calculated
26
27 ym = psz[1]/2;
28
29 module Case(){
30   difference(){
31     mirror([1,0,0])
32       translate(-thick)
33       cube(psz + 2*thick - [1,0,0] * (thick[0]));
34
35     for (yp= [ btn_yprop, 1-btn_yprop ])
36       translate([ -btn_x,
37                   yp * psz[1],
38                   0.5 * psz[2] ])
39         cylinder(r= btn_dia/2, h=20);
40
41     translate([ -abtn_x,
42                 btn_yprop * psz[1],
43                 psz[2] ])
44       cube(concat(abtn_sz, thick[2]*3), center=true);
45
46     mirror([1,0,0])
47       difference(){
48         cube(psz + [1,0,0]);
49
50         for (m=[0,1]) {
51           translate([0,ym,0]) mirror([0,m,0]) translate([0,-ym,0])
52             translate([-1,-1, psz[2]-rail_zsz])
53             cube([psz[0]+1, rail_ysz+1, rail_zsz+1]);
54         }
55       }
56   }
57 }
58
59 Case();