-rw-r--r-- | fanduct.scad | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fanduct.scad b/fanduct.scad index 7a9e205..3e2a15e 100644 --- a/fanduct.scad +++ b/fanduct.scad | |||
@@ -16,193 +16,193 @@ fanduct_blowtarget = -2; // what to blow at | |||
16 | fanduct_h = 6; // inner height of the duct | 16 | fanduct_h = 6; // inner height of the duct |
17 | fanduct_w = 7; // inner width of the duct | 17 | fanduct_w = 7; // inner width of the duct |
18 | fanduct_shell=1.2; // shell thickness | 18 | fanduct_shell=1.2; // shell thickness |
19 | fanduct_ir = heater_clearance+5; // inner radius | 19 | fanduct_ir = heater_clearance+5; // inner radius |
20 | 20 | ||
21 | jet_angle = 60-2; // angular width of the jet | 21 | jet_angle = 60-2; // angular width of the jet |
22 | 22 | ||
23 | inlet_w = 12.5; // inlet width | 23 | inlet_w = 12.5; // inlet width |
24 | inlet_h = 17; // inlet height | 24 | inlet_h = 17; // inlet height |
25 | inlet_short_l = 7;// inlet length of protrusion (or depth of intrusion:)) | 25 | inlet_short_l = 7;// inlet length of protrusion (or depth of intrusion:)) |
26 | inlet_away = 15;// how far away inlet is | 26 | inlet_away = 15;// how far away inlet is |
27 | 27 | ||
28 | inlet_long_l = inlet_short_l+inlet_h; | 28 | inlet_long_l = inlet_short_l+inlet_h; |
29 | hotend_clearance = heater_clearance; | 29 | hotend_clearance = heater_clearance; |
30 | 30 | ||
31 | snapper_d = 8; snapper_overlap=0.2;// snip snap | 31 | snapper_d = 8; snapper_overlap=0.2;// snip snap |
32 | 32 | ||
33 | smooth_f = 120; | 33 | smooth_f = 120; |
34 | 34 | ||
35 | type="3jets"; // "3jets" ; // circular|3jets | 35 | type="3jets"; // "3jets" ; // circular|3jets |
36 | ductshape="square"; // square|round | 36 | ductshape="square"; // square|round |
37 | 37 | ||
38 | 38 | ||
39 | module fanduct(type=type,ductshape=ductshape) { | 39 | module fanduct(type=type,ductshape=ductshape) { |
40 | 40 | ||
41 | // ***duct is all around! | 41 | // ***duct is all around! |
42 | module duct(what) { | 42 | module duct(what) { |
43 | if(what=="in") { | 43 | if(what=="in") { |
44 | sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; | 44 | sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; |
45 | smax = max(sh,sv); | 45 | smax = max(sh,sv); |
46 | rotate_extrude($fn=smooth_f) | 46 | rotate_extrude($fn=smooth_f) |
47 | if(ductshape=="round") | 47 | if(ductshape=="round") |
48 | translate([sh/2+fanduct_ir,sv/2]) | 48 | translate([sh/2+fanduct_ir,sv/2]) |
49 | scale([sh/smax,sv/smax]) | 49 | scale([sh/smax,sv/smax]) |
50 | circle(d=smax,$fn=4*smax); | 50 | circle(d=smax,$fn=4*smax); |
51 | else if(ductshape=="square") | 51 | else if(ductshape=="square") |
52 | translate([fanduct_ir,0]) | 52 | translate([fanduct_ir,0]) |
53 | square([sh,sv]); | 53 | square([sh,sv]); |
54 | }else if(what=="out") { | 54 | }else if(what=="out") { |
55 | sh = fanduct_w; sv = fanduct_h; | 55 | sh = fanduct_w; sv = fanduct_h; |
56 | smax = max(sh,sv); | 56 | smax = max(sh,sv); |
57 | rotate_extrude($fn=smooth_f) | 57 | rotate_extrude($fn=smooth_f) |
58 | if(ductshape=="round") | 58 | if(ductshape=="round") |
59 | translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) | 59 | translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) |
60 | scale([sh/smax,sv/smax]) | 60 | scale([sh/smax,sv/smax]) |
61 | circle(d=smax,$fn=4*smax); | 61 | circle(d=smax,$fn=4*smax); |
62 | else if(ductshape=="square") | 62 | else if(ductshape=="square") |
63 | translate([fanduct_ir+fanduct_shell,fanduct_shell]) | 63 | translate([fanduct_ir+fanduct_shell,fanduct_shell]) |
64 | union() { | 64 | union() { |
65 | square([sh,sv/2]); | 65 | square([sh,sv/2]); |
66 | translate([sh/2,sv/2]) | 66 | translate([sh/2,sv/2]) |
67 | scale([sh/smax,sv/smax]) | 67 | scale([sh/smax,sv/smax]) |
68 | circle(d=smax,$fn=36); | 68 | circle(d=smax,$fn=36); |
69 | } | 69 | } |
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | // ***bumps for easier position adjustments in line with hotend | 73 | // ***bumps for easier position adjustments in line with hotend |
74 | module marks(what) { | 74 | module marks(what) { |
75 | if(what=="in") { | 75 | if(what=="in") { |
76 | for(y=[-1,1]) | 76 | for(y=[-1,1]) |
77 | hull() for(z=[0,-fanduct_shell-fanduct_h/2]) | 77 | hull() for(z=[0,-fanduct_shell-fanduct_h/2]) |
78 | translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) | 78 | translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) |
79 | rotate([90,0,0]) { | 79 | rotate([90,0,0]) { |
80 | cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); | 80 | cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); |
81 | for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) | 81 | for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) |
82 | sphere(r=fanduct_shell,$fn=30); | 82 | sphere(r=fanduct_shell,$fn=30); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | // ***output | 87 | // ***output |
88 | module output(what,type=type) { | 88 | module output(what,type=type) { |
89 | module guideline(xyxy) { | 89 | module guideline(xyxy) { |
90 | module pin(xy) { | 90 | module pin(xy) { |
91 | translate([xy[0],xy[1],0]) | 91 | translate([xy[0],xy[1],0]) |
92 | cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); | 92 | cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); |
93 | } | 93 | } |
94 | xyxyxy=concat(xyxy,[[0,0]]); | 94 | xyxyxy=concat(xyxy,[[0,0]]); |
95 | for(i=[0:1:len(xyxyxy)-2]) | 95 | for(i=[0:1:len(xyxyxy)-2]) |
96 | hull() for(j=[i,i+1]) pin(xyxyxy[j]); | 96 | hull() for(j=[i,i+1]) pin(xyxyxy[j]); |
97 | } | 97 | } |
98 | 98 | ||
99 | module circus(what) { | 99 | module circus(what) { |
100 | if(what=="in") { | 100 | if(what=="in") { |
101 | difference() { | 101 | difference() { |
102 | rotate_extrude($fn=smooth_f) | 102 | rotate_extrude($fn=smooth_f) |
103 | polygon([ | 103 | polygon([ |
104 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], | 104 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], |
105 | [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], | 105 | [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], |
106 | [fanduct_ir+fanduct_shell+fanduct_w/2,0], | 106 | [fanduct_ir+fanduct_shell+fanduct_w/2,0], |
107 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); | 107 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); |
108 | translate([0,0,-1]) | 108 | translate([0,0,-1]) |
109 | cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); | 109 | cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); |
110 | mirror([0,0,1]) | 110 | mirror([0,0,1]) |
111 | translate([0,0,-epsilon]) | 111 | translate([0,0,-epsilon]) |
112 | cylinder(r=fanduct_ir+fanduct_shell+1,h=fanduct_elevation+.1+2); | 112 | cylinder(r=fanduct_ir+2*fanduct_shell+fanduct_w+1,h=fanduct_elevation+.1+2); |
113 | } | 113 | } |
114 | }else if(what=="out") { | 114 | }else if(what=="out") { |
115 | rotate_extrude($fn=smooth_f) | 115 | rotate_extrude($fn=smooth_f) |
116 | polygon([ | 116 | polygon([ |
117 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], | 117 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], |
118 | [fanduct_ir+fanduct_shell+1,fanduct_h/2], | 118 | [fanduct_ir+fanduct_shell+1,fanduct_h/2], |
119 | [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell], | 119 | [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell], |
120 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); | 120 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); |
121 | }else if(what=="airguides") { | 121 | }else if(what=="airguides") { |
122 | inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; | 122 | inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; |
123 | union() { | 123 | union() { |
124 | for(my=[0,1]) mirror([0,my,0]) { | 124 | for(my=[0,1]) mirror([0,my,0]) { |
125 | guideline([ | 125 | guideline([ |
126 | [-our,inlet_w/6], | 126 | [-our,inlet_w/6], |
127 | [-inr*sin(60),inr*cos(60)] | 127 | [-inr*sin(60),inr*cos(60)] |
128 | ]); | 128 | ]); |
129 | a0=30; as=15; a1=180; | 129 | a0=30; as=15; a1=180; |
130 | for(a=[a0+as:as:a1]) { | 130 | for(a=[a0+as:as:a1]) { |
131 | f = as/(a1-a+as); | 131 | f = as/(a1-a+as); |
132 | rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); | 132 | rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); |
133 | } | 133 | } |
134 | guideline([ | 134 | guideline([ |
135 | [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], | 135 | [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], |
136 | [-inr*cos(10),inr*sin(10)] | 136 | [-inr*cos(10),inr*sin(10)] |
137 | ]); | 137 | ]); |
138 | } | 138 | } |
139 | }/*union*/ | 139 | }/*union*/ |
140 | }/*airguides*/ | 140 | }/*airguides*/ |
141 | } | 141 | } |
142 | 142 | ||
143 | module jets(what) { | 143 | module jets(what) { |
144 | od = fanduct_h*2/3+fanduct_shell; | 144 | od = fanduct_h*2/3+fanduct_shell; |
145 | md = fanduct_ir+fanduct_shell+fanduct_w/2; | 145 | md = fanduct_ir+fanduct_shell+fanduct_w/2; |
146 | jww = 2*md*sin(jet_angle/2); | 146 | jww = 2*md*sin(jet_angle/2); |
147 | difference() { | 147 | difference() { |
148 | for(a=[0:120:359]) rotate([0,0,a]) { | 148 | for(a=[0:120:359]) rotate([0,0,a]) { |
149 | if(what=="in") { | 149 | if(what=="in") { |
150 | hull() { | 150 | hull() { |
151 | intersection() { | 151 | intersection() { |
152 | translate([md-fanduct_w/2,-jww/2,0]) | 152 | translate([md-fanduct_w/2,-jww/2,0]) |
153 | cube(size=[fanduct_shell+fanduct_w/2,jww,od]); | 153 | cube(size=[fanduct_shell+fanduct_w/2,jww,od]); |
154 | duct(what=what); | 154 | duct(what=what); |
155 | } | 155 | } |
156 | translate([0,0,-fanduct_elevation]) sphere(r=.5); | 156 | translate([0,0,-fanduct_elevation]) sphere(r=.5); |
157 | } | 157 | } |
158 | }else if(what=="out") { | 158 | }else if(what=="out") { |
159 | hull() { | 159 | hull() { |
160 | intersection() { | 160 | intersection() { |
161 | translate([md-fanduct_w/2,-jww/2+fanduct_shell,fanduct_shell]) | 161 | translate([md-fanduct_w/2,-jww/2+fanduct_shell,fanduct_shell]) |
162 | cube(size=[fanduct_w/2,jww-2*fanduct_shell,od-2*fanduct_shell]); | 162 | cube(size=[fanduct_w/2,jww-2*fanduct_shell,od-2*fanduct_shell]); |
163 | duct(what=what); | 163 | duct(what=what); |
164 | } | 164 | } |
165 | translate([0,0,-fanduct_elevation]) sphere(r=.2); | 165 | translate([0,0,-fanduct_elevation]) sphere(r=.2); |
166 | } | 166 | } |
167 | } | 167 | } |
168 | } | 168 | } |
169 | if(what=="in") { | 169 | if(what=="in") { |
170 | translate([0,0,-fanduct_elevation-2+epsilon]) | 170 | translate([0,0,-fanduct_elevation-2+epsilon]) |
171 | cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2); | 171 | cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2); |
172 | translate([0,0,-hotend_clearance]) | 172 | translate([0,0,-hotend_clearance]) |
173 | rotate([0,0,30]) | 173 | rotate([0,0,30]) |
174 | cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6); | 174 | cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6); |
175 | } | 175 | } |
176 | } | 176 | } |
177 | } | 177 | } |
178 | 178 | ||
179 | if(type=="circular") circus(what); | 179 | if(type=="circular") circus(what); |
180 | else if(type=="3jets") jets(what); | 180 | else if(type=="3jets") jets(what); |
181 | } | 181 | } |
182 | 182 | ||
183 | // ***air intake | 183 | // ***air intake |
184 | module intake(what) { | 184 | module intake(what) { |
185 | module placeit() { | 185 | module placeit() { |
186 | translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) | 186 | translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) |
187 | rotate([0,-90,0]) | 187 | rotate([0,-90,0]) |
188 | children(); | 188 | children(); |
189 | } | 189 | } |
190 | if(what=="in") { | 190 | if(what=="in") { |
191 | placeit() translate([0,-inlet_w/2,0]) { | 191 | placeit() translate([0,-inlet_w/2,0]) { |
192 | difference() { | 192 | difference() { |
193 | cube(size=[inlet_h,inlet_w,inlet_long_l+fanduct_shell]); | 193 | cube(size=[inlet_h,inlet_w,inlet_long_l+fanduct_shell]); |
194 | translate([inlet_h+fanduct_shell,0,inlet_long_l+fanduct_shell]) | 194 | translate([inlet_h+fanduct_shell,0,inlet_long_l+fanduct_shell]) |
195 | rotate([-90,0,0]) | 195 | rotate([-90,0,0]) |
196 | translate([0,0,-1]) | 196 | translate([0,0,-1]) |
197 | cylinder(r=inlet_h,h=inlet_w+2*fanduct_shell+2,$fn=inlet_h*4); | 197 | cylinder(r=inlet_h,h=inlet_w+2*fanduct_shell+2,$fn=inlet_h*4); |
198 | } | 198 | } |
199 | // supports | 199 | // supports |
200 | for(i=[-1,0,1]) | 200 | for(i=[-1,0,1]) |
201 | translate([-fanduct_shell, | 201 | translate([-fanduct_shell, |
202 | (i+1)*(inlet_w-extrusion_width)/2, | 202 | (i+1)*(inlet_w-extrusion_width)/2, |
203 | -inlet_away-fanduct_w/2]) | 203 | -inlet_away-fanduct_w/2]) |
204 | cube(size=[fanduct_shell, | 204 | cube(size=[fanduct_shell, |
205 | extrusion_width, | 205 | extrusion_width, |
206 | inlet_long_l+fanduct_shell+inlet_away+fanduct_w/2]); | 206 | inlet_long_l+fanduct_shell+inlet_away+fanduct_w/2]); |
207 | } | 207 | } |
208 | hull() { | 208 | hull() { |