chiark / gitweb /
805fe0fe3247f6540a3979205783647390d04ef8
[reprap-play.git] / earring-stand.scad
1 // -*- C -*-
2
3 eclip_inner_rad = 2.5;
4 eclip_gap_rad = 0.5;
5 eclip_prong_th = 3;
6 eclip_outer_strt = 0.5;
7 eclip_inner_xstrt = 0.5;
8
9 eclip_ult_angle = 44;
10 eclip_base_epsilon = 0.5;
11
12 test_alpha = 10;
13
14 // calculated
15
16 include <utils.scad>
17
18 eclip_inner_strt = eclip_outer_strt + eclip_inner_xstrt;
19
20 r0 = eclip_inner_rad;
21 r1 = r0 + eclip_inner_rad;
22 r2 = r1 + eclip_prong_th;
23 r2e = r1 + eclip_base_epsilon;
24
25 ppxl = -(r0 / sqrt(2)) + (eclip_inner_strt / sqrt(2));
26
27 $fn=70;
28
29 module EclipLPlanCore(alpha){
30   FArcSegment(0,0, r1,r2,
31               180-eclip_ult_angle, eclip_ult_angle-alpha +1);
32
33   difference(){
34     hull(){
35       intersection(){
36         circle(r2);
37         rotate(-alpha) mirror([1,1]) square([r2e, 50]);
38      }
39       rotate(-alpha) mirror([1,1]) square([r2e, r2]);
40     }
41     circle(r1);
42   }
43 }
44
45 module EclipLPlan(alpha){
46   rotate(alpha) EclipLPlanCore(alpha);
47 }
48
49 module EclipPPlan(main_th){
50   intersection(){
51     hull(){
52       circle(r0);
53       rotate(90-eclip_ult_angle) square([r0,r0]);
54     }
55     translate([-(r0+.1), -(r0+.1)])
56       square([(r0+.1) + main_th + ppxl, r2*2]);
57   }
58   translate([ppxl, 0]) square([main_th, r2]);
59 }
60
61 color("red") EclipLPlan(test_alpha);
62 color("blue") rotate(test_alpha) EclipPPlan(1.5);