chiark / gitweb /
68923392680e470b43d450667f2307cef06baad5
[reprap-play.git] / flyscreen-handle.scad
1 // -*- C -*-
2
3 opening_height = 7.84;
4 opening_depth = 7.88;
5 openingcnr_dia = 2.75;
6 opening_topprotr = 1.54;
7
8 gap = 0.25;
9
10 retain_empir_angle = 20;
11 retain_empir_stalkw = 1.0;
12 retain_rad = 1.5;
13
14 bot_overlap = 5;
15 bot_w = 3;
16
17 handle_d = 2;
18 handle_w = 8;
19 handle_rh = 2;
20 handle_rcut = 3;
21
22 cutout_gap = 1.5;
23
24 // calculated
25
26 ins_irad = openingcnr_dia/2 + gap;
27 ins_orad = openingcnr_dia/2 + opening_height - gap;
28 ins_th = ins_orad - ins_irad;
29
30 handle_x0 = ins_irad;
31 handle_h = bot_overlap + ins_th;
32 handle_y0 = -ins_orad-bot_overlap;
33 handle_y1 = handle_y0 + handle_h;
34
35 handle_x1 = handle_x0 + bot_w + handle_w;
36
37 module InsertSection(){
38   translate([-ins_orad, 0]) square([ins_th, opening_topprotr]);
39   translate([0, -ins_orad]) square([ins_irad+1, ins_th]);
40   intersection(){
41     translate([0.1,0.1]) mirror([1,1]) square([100,100]);
42     difference(){
43       circle(r= ins_orad);
44       circle(r= ins_irad, $fn=20);
45     }
46   }
47 }
48
49 module HandleSection(){
50   difference(){
51     hull(){
52       translate([handle_x0, handle_y0])
53         square([bot_w, handle_h]);
54       for (y= [handle_y1 - handle_rh/2,
55                handle_y1 - ins_th + handle_rh/2]) {
56         translate([handle_x1 - handle_rh/2, y])
57           circle(r= handle_rh/2, $fn=20);
58       }
59     }
60     hull(){
61       for (x= [handle_x0 + bot_w + handle_rcut/2,
62                handle_x1 - handle_rh/2 - handle_rcut/2]) {
63         translate([x, handle_y1])
64           circle(r = handle_rcut/2, $fn=20);
65       }
66     }
67   }
68   hull(){
69     for (y= [handle_y1 -   handle_rh/2,
70              handle_y1 - 3*handle_rh/2])
71       translate([handle_x1 - handle_rh/2, y])
72         circle(r = handle_rh/2, $fn=20);
73   }
74 }
75
76 module RetainSection(){
77   rotate(180-retain_empir_angle)
78     translate([0,ins_orad]) circle(r=retain_rad, $fn=20);
79 }
80
81 module RetainCutout(){
82   rotate(180-retain_empir_angle)
83     translate([0,ins_orad]) {
84     difference(){
85       circle(r=retain_rad + cutout_gap, $fn=20);
86       rotate(180 + retain_empir_angle/2)
87         translate([0, -retain_empir_stalkw])
88         square([100, retain_empir_stalkw*2]);
89     }
90   }
91 }  
92
93 module WithRetainSection(){
94   difference(){
95     InsertSection();
96     RetainCutout();
97   }
98   HandleSection();
99   RetainSection();
100 }
101
102 module Demo(){
103   difference(){
104     InsertSection();
105     RetainCutout();
106   }
107   HandleSection();
108   color("red") RetainSection();
109 }
110
111 module Test(){
112   linear_extrude(height=2) WithRetainSection();
113 }
114
115 //Demo();
116 //WithRetainSection();
117 Test();