chiark / gitweb /
flyscreen-handle: adjustments from v5 fit measurements
[reprap-play.git] / flyscreen-handle.scad
1 // -*- C -*-
2
3 opening_height = 7.84 - 0.3 + 0.60;
4 opening_depth = 6.0; // 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 = 0.8;
12 retain_rad = 1.65;
13 retain_empir_inward = 0.65;
14
15 hgap_empir_adjust = -0.5 -2.50;
16
17 topprotr_rad = 0.35;
18
19 bot_overlap = 5;
20 bot_w = 3;
21
22 handle_w = 8;
23 handle_rh = 3;
24 handle_rcut = 3;
25
26 cutout_gap = 1.5;
27
28 total_len = 35;
29 retaining_len = 10;
30 overret_gaplen = 5;
31
32 overret_hch = 5;
33
34 // calculated
35
36 ins_irad = openingcnr_dia/2 + gap;
37 ins_orad = openingcnr_dia/2 + opening_height - gap;
38 ins_th = ins_orad - ins_irad;
39
40 handle_x0 = ins_irad + hgap_empir_adjust;
41 handle_h = bot_overlap + ins_th;
42 handle_y0 = -ins_orad-bot_overlap;
43 handle_y1 = handle_y0 + handle_h;
44
45 handle_x1 = handle_x0 + bot_w + handle_w;
46
47 topprotr_y = -ins_irad + opening_topprotr;
48
49 module InsertSection(){
50   hull(){
51     translate([-ins_irad, -ins_irad])
52       mirror([1,0])
53       square([opening_depth - ins_irad, 0.1]);
54     translate([-ins_irad - topprotr_rad,
55                topprotr_y - topprotr_rad])
56       circle(r=topprotr_rad, $fn=10);
57   }
58   translate([0, -ins_orad]) square([ins_irad+1, ins_th]);
59   intersection(){
60     translate([0.1, -ins_irad + 0.1])
61       mirror([1,1])
62       square([100, opening_depth]);
63     difference(){
64       circle(r= ins_orad);
65       circle(r= ins_irad, $fn=20);
66     }
67   }
68 }
69
70 module HandleSection(){
71   difference(){
72     hull(){
73       translate([handle_x0, handle_y0])
74         square([bot_w, handle_h]);
75       for (y= [handle_y1 - handle_rh/2,
76                handle_y1 - ins_th + handle_rh/2]) {
77         translate([handle_x1 - handle_rh/2, y])
78           circle(r= handle_rh/2, $fn=20);
79       }
80     }
81     hull(){
82       for (x= [handle_x0 + bot_w + handle_rcut/2,
83                handle_x1 - handle_rh/2 - handle_rcut/2]) {
84         translate([x, handle_y1])
85           circle(r = handle_rcut/2, $fn=20);
86       }
87     }
88   }
89   hull(){
90     for (y= [handle_y1 -   handle_rh/2,
91              handle_y1 - 3*handle_rh/2])
92       translate([handle_x1 - handle_rh/2, y])
93         circle(r = handle_rh/2, $fn=20);
94   }
95 }
96
97 module RetainSection(){
98   rotate(180-retain_empir_angle)
99     translate([0, ins_orad - retain_empir_inward])
100     circle(r=retain_rad, $fn=20);
101 }
102
103 module RetainCutout(gapping=false){
104   rotate(180-retain_empir_angle)
105     translate([0, ins_orad - retain_empir_inward]) {
106     difference(){
107       circle(r=retain_rad + cutout_gap, $fn=20);
108       if (!gapping)
109         rotate(180 + retain_empir_angle/2)
110           translate([0, -retain_empir_stalkw])
111           square([100, retain_empir_stalkw*2]);
112     }
113   }
114 }  
115
116 module GappingSection(){
117   difference(){
118     InsertSection();
119     RetainCutout(true);
120   }
121   HandleSection();
122 }
123
124 module WithRetainSection(){
125   difference(){
126     union(){
127       InsertSection();
128       HandleSection();
129     }
130     RetainCutout();
131   }
132   RetainSection();
133 }
134
135 module BasicSection(){
136   InsertSection();
137   HandleSection();
138 }
139
140 module Handle(){
141   bs0 = retaining_len + overret_gaplen;
142   bs1 = bs0 + overret_hch;
143   linear_extrude(height=total_len, convexity=100) GappingSection();
144   linear_extrude(height=retaining_len, convexity=100) WithRetainSection();
145   translate([0,0, bs1]) linear_extrude(height= total_len - bs1)
146     BasicSection();
147   translate([0,0, bs1+0.1]) mirror([0,0,1]) {
148     intersection_for (sl=[0,1]) {
149       multmatrix([[1,0,0,0],
150                   [0,1,sl*0.65,0],
151                   [0,0,1,0],
152                   [0,0,0,1]])
153         linear_extrude(height= overret_gaplen+1, convexity=100)
154         BasicSection();
155     }
156   }
157 }
158
159 module Demo(){
160   color("red") translate([0,0,-3]) BasicSection();
161   color("blue") translate([0,0,3]) WithRetainSection();
162 }
163
164 module Test(){
165   linear_extrude(height=2) {
166     WithRetainSection();
167     translate([0, -handle_y0 + topprotr_y + 10])
168       BasicSection();
169   }
170 }
171
172 //Demo();
173 //HandleSection();
174 //InsertSection();
175 //WithRetainSection();
176 //BasicSection();
177 //GappingSection();
178 //Test();
179 Demo();
180 //Handle();