-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 | |||
@@ -177,189 +177,188 @@ module fanduct(type=type,ductshape=ductshape,dual=dual) { | |||
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: */ |