-rw-r--r-- | fanduct.scad | 96 |
1 files changed, 66 insertions, 30 deletions
diff --git a/fanduct.scad b/fanduct.scad index 3e2a15e..b9689c9 100644 --- a/fanduct.scad +++ b/fanduct.scad | |||
@@ -30,2 +30,6 @@ hotend_clearance = heater_clearance; | |||
30 | 30 | ||
31 | nozzles_apart = 18; // distance between nozzles for dual hotend | ||
32 | space_behind_nozzle = 15;// space behind the nozzle where we're allowed to go | ||
33 | // without the fear of hitting carriage | ||
34 | |||
31 | snapper_d = 8; snapper_overlap=0.2;// snip snap | 35 | snapper_d = 8; snapper_overlap=0.2;// snip snap |
@@ -34,38 +38,70 @@ smooth_f = 120; | |||
34 | 38 | ||
35 | type="3jets"; // "3jets" ; // circular|3jets | 39 | type="circular"; // circular|3jets |
36 | ductshape="square"; // square|round | 40 | ductshape="square"; // square|round |
37 | 41 | dual=true; // dual or single | |
38 | 42 | ||
39 | module fanduct(type=type,ductshape=ductshape) { | 43 | to_midduct = fanduct_ir+fanduct_shell+fanduct_w/2; |
44 | dual_spots = [ [+space_behind_nozzle, -(to_midduct+nozzles_apart/2)], | ||
45 | [- to_midduct, -(to_midduct+nozzles_apart/2)], | ||
46 | [- to_midduct, 0] ]; | ||
40 | 47 | ||
48 | module fanduct(type=type,ductshape=ductshape,dual=dual) { | ||
41 | // ***duct is all around! | 49 | // ***duct is all around! |
42 | module duct(what) { | 50 | module duct(what) { |
43 | if(what=="in") { | 51 | module single() { |
44 | sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; | 52 | if(what=="in") { |
45 | smax = max(sh,sv); | 53 | sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; |
46 | rotate_extrude($fn=smooth_f) | 54 | smax = max(sh,sv); |
47 | if(ductshape=="round") | 55 | rotate_extrude($fn=smooth_f) |
48 | translate([sh/2+fanduct_ir,sv/2]) | 56 | if(ductshape=="round") |
49 | scale([sh/smax,sv/smax]) | 57 | translate([sh/2+fanduct_ir,sv/2]) |
50 | circle(d=smax,$fn=4*smax); | ||
51 | else if(ductshape=="square") | ||
52 | translate([fanduct_ir,0]) | ||
53 | square([sh,sv]); | ||
54 | }else if(what=="out") { | ||
55 | sh = fanduct_w; sv = fanduct_h; | ||
56 | smax = max(sh,sv); | ||
57 | rotate_extrude($fn=smooth_f) | ||
58 | if(ductshape=="round") | ||
59 | translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) | ||
60 | scale([sh/smax,sv/smax]) | ||
61 | circle(d=smax,$fn=4*smax); | ||
62 | else if(ductshape=="square") | ||
63 | translate([fanduct_ir+fanduct_shell,fanduct_shell]) | ||
64 | union() { | ||
65 | square([sh,sv/2]); | ||
66 | translate([sh/2,sv/2]) | ||
67 | scale([sh/smax,sv/smax]) | 58 | scale([sh/smax,sv/smax]) |
68 | circle(d=smax,$fn=36); | 59 | circle(d=smax,$fn=4*smax); |
69 | } | 60 | else if(ductshape=="square") |
61 | translate([fanduct_ir,0]) | ||
62 | square([sh,sv]); | ||
63 | }else if(what=="out") { | ||
64 | sh = fanduct_w; sv = fanduct_h; | ||
65 | smax = max(sh,sv); | ||
66 | rotate_extrude($fn=smooth_f) | ||
67 | if(ductshape=="round") | ||
68 | translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) | ||
69 | scale([sh/smax,sv/smax]) | ||
70 | circle(d=smax,$fn=4*smax); | ||
71 | else if(ductshape=="square") | ||
72 | translate([fanduct_ir+fanduct_shell,fanduct_shell]) | ||
73 | union() { | ||
74 | square([sh,sv/2]); | ||
75 | translate([sh/2,sv/2]) | ||
76 | scale([sh/smax,sv/smax]) | ||
77 | circle(d=smax,$fn=36); | ||
78 | } | ||
79 | } | ||
80 | } | ||
81 | module dual() { | ||
82 | module hulls(spots=dual_spots) { | ||
83 | for(my=[0,1]) mirror([0,my,0]) for(pn=[0:1:len(spots)-2]) hull() { | ||
84 | for(p=[spots[pn],spots[pn+1]]) translate(p) children(); | ||
85 | } | ||
86 | } | ||
87 | if(what=="in") { | ||
88 | hulls() cylinder(d=fanduct_w+2*fanduct_shell,h=fanduct_h+2*fanduct_shell); | ||
89 | }else if(what=="out") { | ||
90 | sh = fanduct_w; sv = fanduct_h; | ||
91 | smax = max(sh,sv); | ||
92 | translate([0,0,fanduct_shell]) hulls() { | ||
93 | cylinder(d=fanduct_w,h=fanduct_h/2); | ||
94 | translate([0,0,fanduct_h/2]) | ||
95 | scale([sh/smax,sh/smax,sv/smax]) | ||
96 | intersection() { | ||
97 | sphere(d=smax,$fn=36); | ||
98 | translate([0,0,-1]) | ||
99 | cylinder(d=smax+2,h=smax+2,$fn=36); | ||
100 | } | ||
101 | } | ||
102 | } | ||
70 | } | 103 | } |
104 | |||
105 | if(dual) dual(); | ||
106 | else single(); | ||
71 | } | 107 | } |