chiark / gitweb /
fairphone-case: wip, have EdgeProfile
[reprap-play.git] / fairphone-case.scad
1 // -*- C -*-
2
3 phone_edge_thick = 9.0;
4 phone_total_thick = 12.0;
5 phone_backside_slope = 1.0; // larger means shallower
6
7 case_th_bottom = 2;
8 case_th_lid = 2;
9 case_th_side = 2;
10 case_th_lip = 1.2;
11
12 case_lip = 2;
13
14 $fa = 5;
15 $fs = 0.1;
16
17 // calculated
18
19 phone_backside_slope_thick = phone_total_thick - phone_edge_thick;
20
21 //lid_lip_overlap_width xxx bad name = ;
22 //lid_lip_inner_slope = [ 5, 5 ]; // xxx
23
24 epp0 = [0,0];
25 epp1 = [0, -phone_edge_thick];
26 epp2 = epp1 + phone_backside_slope_thick * [ phone_backside_slope, -1 ];
27 epp3 = epp2 + [10, 0];
28 epp4 = epp0 - [1,0] * (case_th_side - case_th_lip);
29 epp5 = epp0 + [1,0] * case_lip;
30 epp6 = epp5 + [0,1] * case_th_lip;
31
32 module rectfromto(a,b) { translate(a) square(b - a); }
33 module circleat(c,r) { translate(c) circle(r); }
34
35 module EdgeProfile(){
36   difference(){
37     hull(){
38       circleat(epp3, r=case_th_bottom);
39       circleat(epp2, r=case_th_bottom);
40       circleat(epp1, r=case_th_side);
41       circleat(epp4, r=case_th_lip);
42       rectfromto(epp0, epp6);
43     }
44     polygon([ epp6 + [10,10],
45               epp6 + [0,10],
46               epp5,
47               epp0,
48               epp1,
49               epp2,
50               epp3 + [10,0] ]);
51   }
52 }
53
54 EdgeProfile();