-rw-r--r-- | fanduct.scad | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/fanduct.scad b/fanduct.scad index b9689c9..0cd89f7 100644 --- a/fanduct.scad +++ b/fanduct.scad | |||
@@ -167,97 +167,124 @@ module fanduct(type=type,ductshape=ductshape,dual=dual) { | |||
167 | f = as/(a1-a+as); | 167 | f = as/(a1-a+as); |
168 | rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); | 168 | rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); |
169 | } | 169 | } |
170 | guideline([ | 170 | guideline([ |
171 | [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], | 171 | [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], |
172 | [-inr*cos(10),inr*sin(10)] | 172 | [-inr*cos(10),inr*sin(10)] |
173 | ]); | 173 | ]); |
174 | } | 174 | } |
175 | }/*union*/ | 175 | }/*union*/ |
176 | }/*airguides*/ | 176 | }/*airguides*/ |
177 | } | 177 | } |
178 | 178 | ||
179 | module jets(what) { | 179 | module jets(what) { |
180 | od = fanduct_h*2/3+fanduct_shell; | 180 | od = fanduct_h*2/3+fanduct_shell; |
181 | md = fanduct_ir+fanduct_shell+fanduct_w/2; | 181 | md = fanduct_ir+fanduct_shell+fanduct_w/2; |
182 | jww = 2*md*sin(jet_angle/2); | 182 | jww = 2*md*sin(jet_angle/2); |
183 | difference() { | 183 | difference() { |
184 | for(a=[0:120:359]) rotate([0,0,a]) { | 184 | for(a=[0:120:359]) rotate([0,0,a]) { |
185 | if(what=="in") { | 185 | if(what=="in") { |
186 | hull() { | 186 | hull() { |
187 | intersection() { | 187 | intersection() { |
188 | translate([md-fanduct_w/2,-jww/2,0]) | 188 | translate([md-fanduct_w/2,-jww/2,0]) |
189 | cube(size=[fanduct_shell+fanduct_w/2,jww,od]); | 189 | cube(size=[fanduct_shell+fanduct_w/2,jww,od]); |
190 | duct(what=what); | 190 | duct(what=what); |
191 | } | 191 | } |
192 | translate([0,0,-fanduct_elevation]) sphere(r=.5); | 192 | translate([0,0,-fanduct_elevation]) sphere(r=.5); |
193 | } | 193 | } |
194 | }else if(what=="out") { | 194 | }else if(what=="out") { |
195 | hull() { | 195 | hull() { |
196 | intersection() { | 196 | intersection() { |
197 | translate([md-fanduct_w/2,-jww/2+fanduct_shell,fanduct_shell]) | 197 | translate([md-fanduct_w/2,-jww/2+fanduct_shell,fanduct_shell]) |
198 | cube(size=[fanduct_w/2,jww-2*fanduct_shell,od-2*fanduct_shell]); | 198 | cube(size=[fanduct_w/2,jww-2*fanduct_shell,od-2*fanduct_shell]); |
199 | duct(what=what); | 199 | duct(what=what); |
200 | } | 200 | } |
201 | translate([0,0,-fanduct_elevation]) sphere(r=.2); | 201 | translate([0,0,-fanduct_elevation]) sphere(r=.2); |
202 | } | 202 | } |
203 | } | 203 | } |
204 | } | 204 | } |
205 | if(what=="in") { | 205 | if(what=="in") { |
206 | translate([0,0,-fanduct_elevation-2+epsilon]) | 206 | translate([0,0,-fanduct_elevation-2+epsilon]) |
207 | cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2); | 207 | cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2); |
208 | translate([0,0,-hotend_clearance]) | 208 | translate([0,0,-hotend_clearance]) |
209 | rotate([0,0,30]) | 209 | rotate([0,0,30]) |
210 | cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6); | 210 | cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6); |
211 | } | 211 | } |
212 | } | 212 | } |
213 | } | 213 | } |
214 | 214 | ||
215 | if(type=="circular") circus(what); | 215 | module dual(what=what) { |
216 | module hulls(spots=dual_spots) { | ||
217 | for(my=[0,1]) mirror([0,my,0]) for(pn=[0:1:len(spots)-2]) hull() { | ||
218 | for(p=[spots[pn],spots[pn+1]]) translate(p) children(0); | ||
219 | children([1:$children-1]); | ||
220 | } | ||
221 | } | ||
222 | if(what=="in") { | ||
223 | difference() { | ||
224 | hulls() { | ||
225 | cylinder(d=fanduct_w+2*fanduct_shell,h=2*fanduct_shell+fanduct_h/2); | ||
226 | translate([0,-nozzles_apart/2,-fanduct_elevation-fanduct_blowtarget]) sphere(d=.1); | ||
227 | } | ||
228 | translate([0,0,epsilon]) hull() for(my=[0:1]) mirror([0,my,0]) for(s=dual_spots) translate(s) | ||
229 | mirror([0,0,1]) cylinder(d=fanduct_w+2*fanduct_shell+2,h=fanduct_elevation-fanduct_blowtarget+1); | ||
230 | for(s=[-1,1]) translate([0,s*nozzles_apart/2,-1]) | ||
231 | cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); | ||
232 | } | ||
233 | }else if(what=="out") { | ||
234 | hulls() { | ||
235 | translate([0,0,fanduct_shell]) cylinder(d=fanduct_w,h=fanduct_h/2-fanduct_shell/2); | ||
236 | translate([0,-nozzles_apart/2,-fanduct_elevation+fanduct_blowtarget]) sphere(d=.1); | ||
237 | } | ||
238 | } | ||
239 | } | ||
240 | |||
241 | if(dual) dual(what); | ||
242 | else if(type=="circular") circus(what); | ||
216 | else if(type=="3jets") jets(what); | 243 | else if(type=="3jets") jets(what); |
217 | } | 244 | } |
218 | 245 | ||
219 | // ***air intake | 246 | // ***air intake |
220 | module intake(what) { | 247 | module intake(what) { |
221 | module placeit() { | 248 | module placeit() { |
222 | translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) | 249 | translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) |
223 | rotate([0,-90,0]) | 250 | rotate([0,-90,0]) |
224 | children(); | 251 | children(); |
225 | } | 252 | } |
226 | if(what=="in") { | 253 | if(what=="in") { |
227 | placeit() translate([0,-inlet_w/2,0]) { | 254 | placeit() translate([0,-inlet_w/2,0]) { |
228 | difference() { | 255 | difference() { |
229 | cube(size=[inlet_h,inlet_w,inlet_long_l+fanduct_shell]); | 256 | cube(size=[inlet_h,inlet_w,inlet_long_l+fanduct_shell]); |
230 | translate([inlet_h+fanduct_shell,0,inlet_long_l+fanduct_shell]) | 257 | translate([inlet_h+fanduct_shell,0,inlet_long_l+fanduct_shell]) |
231 | rotate([-90,0,0]) | 258 | rotate([-90,0,0]) |
232 | translate([0,0,-1]) | 259 | translate([0,0,-1]) |
233 | cylinder(r=inlet_h,h=inlet_w+2*fanduct_shell+2,$fn=inlet_h*4); | 260 | cylinder(r=inlet_h,h=inlet_w+2*fanduct_shell+2,$fn=inlet_h*4); |
234 | } | 261 | } |
235 | // supports | 262 | // supports |
236 | for(i=[-1,0,1]) | 263 | for(i=[-1,0,1]) |
237 | translate([-fanduct_shell, | 264 | translate([-fanduct_shell, |
238 | (i+1)*(inlet_w-extrusion_width)/2, | 265 | (i+1)*(inlet_w-extrusion_width)/2, |
239 | -inlet_away-fanduct_w/2]) | 266 | -inlet_away-fanduct_w/2]) |
240 | cube(size=[fanduct_shell, | 267 | cube(size=[fanduct_shell, |
241 | extrusion_width, | 268 | extrusion_width, |
242 | inlet_long_l+fanduct_shell+inlet_away+fanduct_w/2]); | 269 | inlet_long_l+fanduct_shell+inlet_away+fanduct_w/2]); |
243 | } | 270 | } |
244 | hull() { | 271 | hull() { |
245 | placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) | 272 | placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) |
246 | cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]); | 273 | cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]); |
247 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) | 274 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) |
248 | translate([0,-inlet_w/2-fanduct_shell/2,0]) | 275 | translate([0,-inlet_w/2-fanduct_shell/2,0]) |
249 | cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]); | 276 | cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]); |
250 | } | 277 | } |
251 | }else if(what=="out") { | 278 | }else if(what=="out") { |
252 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) | 279 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) |
253 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_long_l+fanduct_shell+1]); | 280 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_long_l+fanduct_shell+1]); |
254 | hull() { | 281 | hull() { |
255 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) | 282 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) |
256 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]); | 283 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]); |
257 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) | 284 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) |
258 | translate([0,-inlet_w/2+fanduct_shell,0]) | 285 | translate([0,-inlet_w/2+fanduct_shell,0]) |
259 | cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]); | 286 | cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]); |
260 | } | 287 | } |
261 | } | 288 | } |
262 | } | 289 | } |
263 | 290 | ||