-rw-r--r-- | fanduct.scad | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fanduct.scad b/fanduct.scad index 8d0414f..52aee0e 100644 --- a/fanduct.scad +++ b/fanduct.scad | |||
@@ -81,285 +81,284 @@ module fanduct(type=type,ductshape=ductshape,dual=dual) { | |||
81 | } | 81 | } |
82 | } | 82 | } |
83 | } | 83 | } |
84 | module dual() { | 84 | module dual() { |
85 | module hulls(spots=dual_spots) { | 85 | module hulls(spots=dual_spots) { |
86 | for(my=[0,1]) mirror([0,my,0]) for(pn=[0:1:len(spots)-2]) hull() { | 86 | for(my=[0,1]) mirror([0,my,0]) for(pn=[0:1:len(spots)-2]) hull() { |
87 | for(p=[spots[pn],spots[pn+1]]) translate(p) children(); | 87 | for(p=[spots[pn],spots[pn+1]]) translate(p) children(); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | if(what=="in") { | 90 | if(what=="in") { |
91 | hulls() cylinder(d=fanduct_w+2*fanduct_shell,h=fanduct_h+2*fanduct_shell); | 91 | hulls() cylinder(d=fanduct_w+2*fanduct_shell,h=fanduct_h+2*fanduct_shell); |
92 | }else if(what=="out") { | 92 | }else if(what=="out") { |
93 | sh = fanduct_w; sv = fanduct_h; | 93 | sh = fanduct_w; sv = fanduct_h; |
94 | smax = max(sh,sv); | 94 | smax = max(sh,sv); |
95 | translate([0,0,fanduct_shell]) hulls() { | 95 | translate([0,0,fanduct_shell]) hulls() { |
96 | cylinder(d=fanduct_w,h=fanduct_h/2); | 96 | cylinder(d=fanduct_w,h=fanduct_h/2); |
97 | translate([0,0,fanduct_h/2]) | 97 | translate([0,0,fanduct_h/2]) |
98 | scale([sh/smax,sh/smax,sv/smax]) | 98 | scale([sh/smax,sh/smax,sv/smax]) |
99 | intersection() { | 99 | intersection() { |
100 | sphere(d=smax,$fn=36); | 100 | sphere(d=smax,$fn=36); |
101 | translate([0,0,-1]) | 101 | translate([0,0,-1]) |
102 | cylinder(d=smax+2,h=smax+2,$fn=36); | 102 | cylinder(d=smax+2,h=smax+2,$fn=36); |
103 | } | 103 | } |
104 | } | 104 | } |
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
108 | if(dual) dual(); | 108 | if(dual) dual(); |
109 | else single(); | 109 | else single(); |
110 | } | 110 | } |
111 | 111 | ||
112 | // ***bumps for easier position adjustments in line with hotend | 112 | // ***bumps for easier position adjustments in line with hotend |
113 | module marks(what) { | 113 | module marks(what) { |
114 | if(what=="in") { | 114 | if(what=="in") { |
115 | for(y=[-1,1]) translate([0,dual?y*nozzles_apart/2:0,0]) | 115 | for(y=[-1,1]) translate([0,dual?y*nozzles_apart/2:0,0]) |
116 | hull() for(z=[0,-fanduct_shell-fanduct_h/2]) | 116 | hull() for(z=[0,-fanduct_shell-fanduct_h/2]) |
117 | translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) | 117 | translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) |
118 | rotate([90,0,0]) { | 118 | rotate([90,0,0]) { |
119 | cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); | 119 | cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); |
120 | for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) | 120 | for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) |
121 | sphere(r=fanduct_shell,$fn=30); | 121 | sphere(r=fanduct_shell,$fn=30); |
122 | } | 122 | } |
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | // ***output | 126 | // ***output |
127 | module output(what,type=type) { | 127 | module output(what,type=type) { |
128 | module guideline(xyxy) { | 128 | module guideline(xyxy) { |
129 | module pin(xy) { | 129 | module pin(xy) { |
130 | translate([xy[0],xy[1],0]) | 130 | translate([xy[0],xy[1],0]) |
131 | cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); | 131 | cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); |
132 | } | 132 | } |
133 | xyxyxy=concat(xyxy,[[0,dual?nozzles_apart/2:0]]); | 133 | xyxyxy=concat(xyxy,[[0,dual?nozzles_apart/2:0]]); |
134 | for(i=[0:1:len(xyxyxy)-2]) | 134 | for(i=[0:1:len(xyxyxy)-2]) |
135 | hull() for(j=[i,i+1]) pin(xyxyxy[j]); | 135 | hull() for(j=[i,i+1]) pin(xyxyxy[j]); |
136 | } | 136 | } |
137 | 137 | ||
138 | module circus(what) { | 138 | module circus(what) { |
139 | if(what=="in") { | 139 | if(what=="in") { |
140 | difference() { | 140 | difference() { |
141 | rotate_extrude($fn=smooth_f) | 141 | rotate_extrude($fn=smooth_f) |
142 | polygon([ | 142 | polygon([ |
143 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], | 143 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], |
144 | [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], | 144 | [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], |
145 | [fanduct_ir+fanduct_shell+fanduct_w/2,0], | 145 | [fanduct_ir+fanduct_shell+fanduct_w/2,0], |
146 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); | 146 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); |
147 | translate([0,0,-1]) | 147 | translate([0,0,-1]) |
148 | cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); | 148 | cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); |
149 | mirror([0,0,1]) | 149 | mirror([0,0,1]) |
150 | translate([0,0,-epsilon]) | 150 | translate([0,0,-epsilon]) |
151 | cylinder(r=fanduct_ir+2*fanduct_shell+fanduct_w+1,h=fanduct_elevation+.1+2); | 151 | cylinder(r=fanduct_ir+2*fanduct_shell+fanduct_w+1,h=fanduct_elevation+.1+2); |
152 | } | 152 | } |
153 | }else if(what=="out") { | 153 | }else if(what=="out") { |
154 | rotate_extrude($fn=smooth_f) | 154 | rotate_extrude($fn=smooth_f) |
155 | polygon([ | 155 | polygon([ |
156 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], | 156 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], |
157 | [fanduct_ir+fanduct_shell+1,fanduct_h/2], | 157 | [fanduct_ir+fanduct_shell+1,fanduct_h/2], |
158 | [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell], | 158 | [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell], |
159 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); | 159 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); |
160 | }else if(what=="airguides") { | 160 | }else if(what=="airguides") { |
161 | inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; | 161 | inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; |
162 | union() { | 162 | union() { |
163 | for(my=[0,1]) mirror([0,my,0]) { | 163 | for(my=[0,1]) mirror([0,my,0]) { |
164 | guideline([ | 164 | guideline([ |
165 | [-our,inlet_w/6], | 165 | [-our,inlet_w/6], |
166 | [-inr*sin(60),inr*cos(60)] | 166 | [-inr*sin(60),inr*cos(60)] |
167 | ]); | 167 | ]); |
168 | a0=30; as=15; a1=180; | 168 | a0=30; as=15; a1=180; |
169 | for(a=[a0+as:as:a1]) { | 169 | for(a=[a0+as:as:a1]) { |
170 | f = as/(a1-a+as); | 170 | f = as/(a1-a+as); |
171 | rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); | 171 | rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); |
172 | } | 172 | } |
173 | guideline([ | 173 | guideline([ |
174 | [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], | 174 | [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], |
175 | [-inr*cos(10),inr*sin(10)] | 175 | [-inr*cos(10),inr*sin(10)] |
176 | ]); | 176 | ]); |
177 | } | 177 | } |
178 | }/*union*/ | 178 | }/*union*/ |
179 | }/*airguides*/ | 179 | }/*airguides*/ |
180 | } | 180 | } |
181 | 181 | ||
182 | module jets(what) { | 182 | module jets(what) { |
183 | od = fanduct_h*2/3+fanduct_shell; | 183 | od = fanduct_h*2/3+fanduct_shell; |
184 | md = fanduct_ir+fanduct_shell+fanduct_w/2; | 184 | md = fanduct_ir+fanduct_shell+fanduct_w/2; |
185 | jww = 2*md*sin(jet_angle/2); | 185 | jww = 2*md*sin(jet_angle/2); |
186 | difference() { | 186 | difference() { |
187 | for(a=[0:120:359]) rotate([0,0,a]) { | 187 | for(a=[0:120:359]) rotate([0,0,a]) { |
188 | if(what=="in") { | 188 | if(what=="in") { |
189 | hull() { | 189 | hull() { |
190 | intersection() { | 190 | intersection() { |
191 | translate([md-fanduct_w/2,-jww/2,0]) | 191 | translate([md-fanduct_w/2,-jww/2,0]) |
192 | cube(size=[fanduct_shell+fanduct_w/2,jww,od]); | 192 | cube(size=[fanduct_shell+fanduct_w/2,jww,od]); |
193 | duct(what=what); | 193 | duct(what=what); |
194 | } | 194 | } |
195 | translate([0,0,-fanduct_elevation]) sphere(r=.5); | 195 | translate([0,0,-fanduct_elevation]) sphere(r=.5); |
196 | } | 196 | } |
197 | }else if(what=="out") { | 197 | }else if(what=="out") { |
198 | hull() { | 198 | hull() { |
199 | intersection() { | 199 | intersection() { |
200 | translate([md-fanduct_w/2,-jww/2+fanduct_shell,fanduct_shell]) | 200 | translate([md-fanduct_w/2,-jww/2+fanduct_shell,fanduct_shell]) |
201 | cube(size=[fanduct_w/2,jww-2*fanduct_shell,od-2*fanduct_shell]); | 201 | cube(size=[fanduct_w/2,jww-2*fanduct_shell,od-2*fanduct_shell]); |
202 | duct(what=what); | 202 | duct(what=what); |
203 | } | 203 | } |
204 | translate([0,0,-fanduct_elevation]) sphere(r=.2); | 204 | translate([0,0,-fanduct_elevation]) sphere(r=.2); |
205 | } | 205 | } |
206 | } | 206 | } |
207 | } | 207 | } |
208 | if(what=="in") { | 208 | if(what=="in") { |
209 | translate([0,0,-fanduct_elevation-2+epsilon]) | 209 | translate([0,0,-fanduct_elevation-2+epsilon]) |
210 | cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2); | 210 | cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2); |
211 | translate([0,0,-hotend_clearance]) | 211 | translate([0,0,-hotend_clearance]) |
212 | rotate([0,0,30]) | 212 | rotate([0,0,30]) |
213 | cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6); | 213 | cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6); |
214 | } | 214 | } |
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | module dual(what=what) { | 218 | module dual(what=what) { |
219 | module hulls(spots=dual_spots) { | 219 | module hulls(spots=dual_spots) { |
220 | for(my=[0,1]) mirror([0,my,0]) for(pn=[0:1:len(spots)-2]) hull() { | 220 | for(my=[0,1]) mirror([0,my,0]) for(pn=[0:1:len(spots)-2]) hull() { |
221 | for(p=[spots[pn],spots[pn+1]]) translate(p) children(0); | 221 | for(p=[spots[pn],spots[pn+1]]) translate(p) children(0); |
222 | children([1:$children-1]); | 222 | children([1:$children-1]); |
223 | } | 223 | } |
224 | } | 224 | } |
225 | if(what=="in") { | 225 | if(what=="in") { |
226 | cfn= 4; // clearance cutout $fn | 226 | cfn= 4; // clearance cutout $fn |
227 | difference() { | 227 | difference() { |
228 | hulls() { | 228 | hulls() { |
229 | cylinder(d=fanduct_w+2*fanduct_shell,h=2*fanduct_shell+fanduct_h/2); | 229 | cylinder(d=fanduct_w+2*fanduct_shell,h=2*fanduct_shell+fanduct_h/2); |
230 | translate([0,-nozzles_apart/2,-fanduct_elevation-fanduct_blowtarget]) sphere(d=.1); | 230 | translate([0,-nozzles_apart/2,-fanduct_elevation-fanduct_blowtarget]) sphere(d=.1); |
231 | } | 231 | } |
232 | translate([0,0,epsilon]) hull() for(my=[0:1]) mirror([0,my,0]) for(s=dual_spots) translate(s) | 232 | translate([0,0,epsilon]) hull() for(my=[0:1]) mirror([0,my,0]) for(s=dual_spots) translate(s) |
233 | mirror([0,0,1]) cylinder(d=fanduct_w+2*fanduct_shell+2,h=fanduct_elevation-fanduct_blowtarget+1); | 233 | mirror([0,0,1]) cylinder(d=fanduct_w+2*fanduct_shell+2,h=fanduct_elevation-fanduct_blowtarget+1); |
234 | for(s=[-1,1]) translate([0,s*nozzles_apart/2,-1]) | 234 | for(s=[-1,1]) translate([0,s*nozzles_apart/2,-1]) |
235 | rotate([0,0,180/cfn]) cylinder(r=hotend_clearance/cos(180/cfn),h=fanduct_h+2*fanduct_shell+2,$fn=cfn); | 235 | rotate([0,0,180/cfn]) cylinder(r=hotend_clearance/cos(180/cfn),h=fanduct_h+2*fanduct_shell+2,$fn=cfn); |
236 | } | 236 | } |
237 | }else if(what=="out") { | 237 | }else if(what=="out") { |
238 | hulls() { | 238 | hulls() { |
239 | translate([0,0,fanduct_shell]) cylinder(d=fanduct_w,h=fanduct_h/2-fanduct_shell/2); | 239 | translate([0,0,fanduct_shell]) cylinder(d=fanduct_w,h=fanduct_h/2-fanduct_shell/2); |
240 | translate([0,-nozzles_apart/2,-fanduct_elevation+fanduct_blowtarget]) sphere(d=.1); | 240 | translate([0,-nozzles_apart/2,-fanduct_elevation+fanduct_blowtarget]) sphere(d=.1); |
241 | } | 241 | } |
242 | }else if(what=="airguides") { | 242 | }else if(what=="airguides") { |
243 | far = fanduct_ir+fanduct_shell+fanduct_w; | 243 | far = fanduct_ir+fanduct_shell+fanduct_w; |
244 | near = fanduct_ir; | 244 | near = fanduct_ir; |
245 | union() { | 245 | union() { |
246 | for(my=[0,1]) mirror([0,my,0]) { | 246 | for(my=[0,1]) mirror([0,my,0]) { |
247 | guideline([ [-far ,0], [0, nozzles_apart/8] ]); | 247 | guideline([ [-far ,0], [0, nozzles_apart/8] ]); |
248 | guideline([ [-far ,inlet_w/2/4 ], | 248 | guideline([ [-far ,inlet_w/2/4 ], |
249 | [-near ,to_midduct/2] ]); | 249 | [-near ,to_midduct/2] ]); |
250 | guideline([ [-near-fanduct_w/3, to_midduct/2 ], | 250 | guideline([ [-near-fanduct_w/3, to_midduct/2 ], |
251 | [-near ,nozzles_apart/2+near ] ]); | 251 | [-near ,nozzles_apart/2+near ] ]); |
252 | guideline([ [0 ,nozzles_apart/2+near+fanduct_w*space_behind_nozzle/to_midduct] ]); | 252 | guideline([ [0 ,nozzles_apart/2+near+fanduct_w*space_behind_nozzle/to_midduct] ]); |
253 | } | 253 | } |
254 | } | 254 | } |
255 | } | 255 | } |
256 | } | 256 | } |
257 | 257 | ||
258 | if(dual) dual(what); | 258 | if(dual) dual(what); |
259 | else if(type=="circular") circus(what); | 259 | else if(type=="circular") circus(what); |
260 | else if(type=="3jets") jets(what); | 260 | else if(type=="3jets") jets(what); |
261 | } | 261 | } |
262 | 262 | ||
263 | // ***air intake | 263 | // ***air intake |
264 | module intake(what) { | 264 | module intake(what) { |
265 | module placeit() { | 265 | module placeit() { |
266 | translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) | 266 | translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) |
267 | rotate([0,-90,0]) | 267 | rotate([0,-90,0]) |
268 | children(); | 268 | children(); |
269 | } | 269 | } |
270 | if(what=="in") { | 270 | if(what=="in") { |
271 | placeit() translate([0,-inlet_w/2,0]) { | 271 | placeit() translate([0,-inlet_w/2,0]) { |
272 | difference() { | 272 | difference() { |
273 | cube(size=[inlet_h,inlet_w,inlet_long_l+fanduct_shell]); | 273 | cube(size=[inlet_h,inlet_w,inlet_long_l+fanduct_shell]); translate([inlet_h+fanduct_shell,0,inlet_long_l+fanduct_shell]) |
274 | translate([inlet_h+fanduct_shell,0,inlet_long_l+fanduct_shell]) | ||
275 | rotate([-90,0,0]) | 274 | rotate([-90,0,0]) |
276 | translate([0,0,-1]) | 275 | translate([0,0,-1]) |
277 | cylinder(r=inlet_h,h=inlet_w+2*fanduct_shell+2,$fn=inlet_h*4); | 276 | cylinder(r=inlet_h,h=inlet_w+2*fanduct_shell+2,$fn=inlet_h*4); |
278 | } | 277 | } |
279 | // supports | 278 | // supports |
280 | for(i=[-1,0,1]) | 279 | for(i=[-1,0,1]) |
281 | translate([-fanduct_shell, | 280 | translate([-fanduct_shell, |
282 | (i+1)*(inlet_w-extrusion_width)/2, | 281 | (i+1)*(inlet_w-extrusion_width)/2, |
283 | -inlet_away-fanduct_w/2]) | 282 | -inlet_away-fanduct_w/2]) |
284 | cube(size=[fanduct_shell+1, | 283 | cube(size=[fanduct_shell+1, |
285 | extrusion_width, | 284 | extrusion_width, |
286 | inlet_long_l+fanduct_shell+inlet_away+fanduct_w/2]); | 285 | inlet_long_l+fanduct_shell+inlet_away+fanduct_w/2]); |
287 | } | 286 | } |
288 | hull() { | 287 | hull() { |
289 | placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) | 288 | placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) |
290 | cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]); | 289 | cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]); |
291 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) | 290 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) |
292 | translate([0,-inlet_w/2-fanduct_shell/2,0]) | 291 | translate([0,-inlet_w/2-fanduct_shell/2,0]) |
293 | cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]); | 292 | cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]); |
294 | } | 293 | } |
295 | }else if(what=="out") { | 294 | }else if(what=="out") { |
296 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) | 295 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) |
297 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_long_l+fanduct_shell+1]); | 296 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_long_l+fanduct_shell+1]); |
298 | hull() { | 297 | hull() { |
299 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) | 298 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) |
300 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]); | 299 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]); |
301 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) | 300 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) |
302 | translate([0,-inlet_w/2+fanduct_shell,0]) | 301 | translate([0,-inlet_w/2+fanduct_shell,0]) |
303 | cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]); | 302 | cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]); |
304 | } | 303 | } |
305 | } | 304 | } |
306 | } | 305 | } |
307 | 306 | ||
308 | // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…) | 307 | // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…) |
309 | module tails(what) { | 308 | module tails(what) { |
310 | if(dual) { | 309 | if(dual) { |
311 | // XXX: not sure if it will ever be | 310 | // XXX: not sure if it will ever be |
312 | }else{ | 311 | }else{ |
313 | if(what=="in") { | 312 | if(what=="in") { |
314 | for(mx=[0,1]) mirror([mx,0,0]) | 313 | for(mx=[0,1]) mirror([mx,0,0]) |
315 | translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2]) | 314 | translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2]) |
316 | rotate([90,0,90]) | 315 | rotate([90,0,90]) |
317 | translate([0,0,-snapper_d/2]) | 316 | translate([0,0,-snapper_d/2]) |
318 | snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell); | 317 | snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell); |
319 | } | 318 | } |
320 | } | 319 | } |
321 | } | 320 | } |
322 | 321 | ||
323 | module parts(what) { | 322 | module parts(what) { |
324 | union() { | 323 | union() { |
325 | duct(what); | 324 | duct(what); |
326 | marks(what); | 325 | marks(what); |
327 | output(what); | 326 | output(what); |
328 | intake(what); | 327 | intake(what); |
329 | tails(what); | 328 | tails(what); |
330 | } | 329 | } |
331 | } | 330 | } |
332 | 331 | ||
333 | difference() { | 332 | difference() { |
334 | parts("in"); | 333 | parts("in"); |
335 | parts("out"); | 334 | parts("out"); |
336 | } | 335 | } |
337 | intersection() { | 336 | intersection() { |
338 | union() { | 337 | union() { |
339 | output("airguides"); | 338 | output("airguides"); |
340 | sphere(d=epsilon); | 339 | sphere(d=epsilon); |
341 | } | 340 | } |
342 | union() { | 341 | union() { |
343 | duct("in"); output("in"); intake("in"); | 342 | duct("in"); output("in"); intake("in"); |
344 | } | 343 | } |
345 | } | 344 | } |
346 | } | 345 | } |
347 | 346 | ||
348 | view="*"; // hcut|vcut|* | 347 | view="*"; // hcut|vcut|* |
349 | 348 | ||
350 | hinfinity=4*(fanduct_ir+fanduct_shell*2+fanduct_w+inlet_away); | 349 | hinfinity=4*(fanduct_ir+fanduct_shell*2+fanduct_w+inlet_away); |
351 | vinfinity=2*(fanduct_shell*2+fanduct_h+inlet_h); | 350 | vinfinity=2*(fanduct_shell*2+fanduct_h+inlet_h); |
352 | if(view=="hcut") { | 351 | if(view=="hcut") { |
353 | difference() { | 352 | difference() { |
354 | fanduct(); | 353 | fanduct(); |
355 | translate([-hinfinity/2,-hinfinity/2,fanduct_shell+fanduct_h/2]) | 354 | translate([-hinfinity/2,-hinfinity/2,fanduct_shell+fanduct_h/2]) |
356 | cube(size=[hinfinity,hinfinity,vinfinity]); | 355 | cube(size=[hinfinity,hinfinity,vinfinity]); |
357 | } | 356 | } |
358 | }else if(view=="vcut") { | 357 | }else if(view=="vcut") { |
359 | difference() { | 358 | difference() { |
360 | fanduct(); | 359 | fanduct(); |
361 | translate([-hinfinity/2,0,-vinfinity/2]) | 360 | translate([-hinfinity/2,0,-vinfinity/2]) |
362 | cube(size=[hinfinity,hinfinity,vinfinity]); | 361 | cube(size=[hinfinity,hinfinity,vinfinity]); |
363 | } | 362 | } |
364 | }else fanduct(); | 363 | }else fanduct(); |
365 | /* vim:set sw=1 ai: */ | 364 | /* vim:set sw=1 ai: */ |