summaryrefslogtreecommitdiffabout
path: root/fanduct.scad
Unidiff
Diffstat (limited to 'fanduct.scad') (more/less context) (ignore whitespace changes)
-rw-r--r--fanduct.scad66
1 files changed, 61 insertions, 5 deletions
diff --git a/fanduct.scad b/fanduct.scad
index 52aee0e..a17b261 100644
--- a/fanduct.scad
+++ b/fanduct.scad
@@ -1,30 +1,30 @@
1use <snapper.scad>; 1use <snapper.scad>;
2 extrusion_width=.5; layer_height=.2; // print parameters 2 extrusion_width=.5; layer_height=.2; // print parameters
3 3
4 epsilon=.005; // for finer cuts 4 epsilon=.005; // for finer cuts
5 5
6 type="circular"; // circular|3jets 6 type="simple"; // circular|3jets
7 ductshape="square"; // square|round 7 ductshape="square"; // square|round
8 dual=true; // dual or single 8 dual=true; // dual or single
9 9
10 nozzles_apart = 18; // distance between nozzles for dual hotend 10 nozzles_apart = 18; // distance between nozzles for dual hotend
11 space_behind_nozzle = 10;// space behind the nozzle where we're allowed to go 11 space_behind_nozzle = 10;// space behind the nozzle where we're allowed to go
12 // without the fear of hitting carriage 12 // without the fear of hitting carriage
13 13
14 inlet_w = 12.5; // inlet width 14 inlet_w = 12.5; // inlet width
15 inlet_h = 17; // inlet height 15 inlet_h = 17; // inlet height
16 inlet_short_l = 7;// inlet length of protrusion (or depth of intrusion:)) 16 inlet_short_l = 7;// inlet length of protrusion (or depth of intrusion:))
17 inlet_away = 15;// how far away inlet is 17 inlet_away = 15;// how far away inlet is
18 18
19inlet_long_l = inlet_short_l+inlet_h; 19inlet_long_l = inlet_short_l+inlet_h;
20function hypothenuse(a,b) = sqrt(pow(a,2)+pow(b,2)); 20function hypothenuse(a,b) = sqrt(pow(a,2)+pow(b,2));
21 21
22silicone_shell = 2; 22silicone_shell = 2;
23heater_clearance = dual 23heater_clearance = dual
24 ? max(20,15.5) - 4.5 + silicone_shell 24 ? max(20,15.5) - 4.5 + silicone_shell
25 : max( 25 : max(
26 hypothenuse(16/2 +silicone_shell, 20-4.5 +silicone_shell),// E3D v6 26 hypothenuse(16/2 +silicone_shell, 20-4.5 +silicone_shell),// E3D v6
27 hypothenuse(11.5-4.5 +silicone_shell, 15.5 +silicone_shell)// E3D volcano 27 hypothenuse(11.5-4.5 +silicone_shell, 15.5 +silicone_shell)// E3D volcano
28 ); 28 );
29 29
30 fanduct_elevation = 3; // fanduct elevation above nozzle tip 30 fanduct_elevation = 3; // fanduct elevation above nozzle tip
@@ -83,51 +83,83 @@ module fanduct(type=type,ductshape=ductshape,dual=dual) {
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 module dual_simple() {
108 for(my=[0,1]) mirror([0,my,0])
109 if(what=="in") {
110 sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell;
111 translate([0,nozzles_apart/2,0])
112 intersection() {
113 rotate_extrude($fn=smooth_f)
114 translate([fanduct_ir,0]) square([sh,sv]);
115 translate([-fanduct_ir-sh-1,0,-1])
116 cube(size=[fanduct_ir+sh+2,fanduct_ir+sh+2,sv+2]);
117 }
118 translate([-fanduct_ir-sh,-epsilon,0])
119 cube(size=[sh,nozzles_apart/2+2*epsilon,sv]);
120 translate([0,sh/2+fanduct_ir+nozzles_apart/2,0]) cylinder(d=sh,h=sv,$fn=36);
121 }else if(what=="out") {
122 sh = fanduct_w; sv = fanduct_h;
123 translate([0,nozzles_apart/2,fanduct_shell])
124 intersection() {
125 rotate_extrude($fn=smooth_f)
126 translate([fanduct_ir+fanduct_shell,0]) square([sh,sv]);
127 translate([-fanduct_ir-2*fanduct_shell-sh-1,-1,0])
128 cube(size=[fanduct_ir+2*fanduct_shell+sh+2,fanduct_ir+2*fanduct_shell+sh+2,sv]);
129 }
130 translate([-fanduct_ir-fanduct_shell-sh,-epsilon,fanduct_shell])
131 cube(size=[sh,nozzles_apart/2+2*epsilon,sv]);
132 translate([0,sh/2+fanduct_shell+fanduct_ir+nozzles_apart/2,fanduct_shell])
133 cylinder(d=sh,h=sv,$fn=36);
134 }
135 }
107 136
108 if(dual) dual(); 137 if(dual) {
109 else single(); 138 if(type=="simple")
139 dual_simple();
140 else dual();
141 }else single();
110 } 142 }
111 143
112 // ***bumps for easier position adjustments in line with hotend 144 // ***bumps for easier position adjustments in line with hotend
113 module marks(what) { 145 module marks(what) {
114 if(what=="in") { 146 if(what=="in") {
115 for(y=[-1,1]) translate([0,dual?y*nozzles_apart/2:0,0]) 147 for(y=[-1,1]) translate([0,dual?y*nozzles_apart/2:0,0])
116 hull() for(z=[0,-fanduct_shell-fanduct_h/2]) 148 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]) 149 translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z])
118 rotate([90,0,0]) { 150 rotate([90,0,0]) {
119 cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); 151 cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30);
120 for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) 152 for(z=[-1,1]) translate([0,0,z*fanduct_w/2])
121 sphere(r=fanduct_shell,$fn=30); 153 sphere(r=fanduct_shell,$fn=30);
122 } 154 }
123 } 155 }
124 } 156 }
125 157
126 // ***output 158 // ***output
127 module output(what,type=type) { 159 module output(what,type=type) {
128 module guideline(xyxy) { 160 module guideline(xyxy) {
129 module pin(xy) { 161 module pin(xy) {
130 translate([xy[0],xy[1],0]) 162 translate([xy[0],xy[1],0])
131 cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); 163 cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6);
132 } 164 }
133 xyxyxy=concat(xyxy,[[0,dual?nozzles_apart/2:0]]); 165 xyxyxy=concat(xyxy,[[0,dual?nozzles_apart/2:0]]);
@@ -234,50 +266,74 @@ module fanduct(type=type,ductshape=ductshape,dual=dual) {
234 for(s=[-1,1]) translate([0,s*nozzles_apart/2,-1]) 266 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); 267 rotate([0,0,180/cfn]) cylinder(r=hotend_clearance/cos(180/cfn),h=fanduct_h+2*fanduct_shell+2,$fn=cfn);
236 } 268 }
237 }else if(what=="out") { 269 }else if(what=="out") {
238 hulls() { 270 hulls() {
239 translate([0,0,fanduct_shell]) cylinder(d=fanduct_w,h=fanduct_h/2-fanduct_shell/2); 271 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); 272 translate([0,-nozzles_apart/2,-fanduct_elevation+fanduct_blowtarget]) sphere(d=.1);
241 } 273 }
242 }else if(what=="airguides") { 274 }else if(what=="airguides") {
243 far = fanduct_ir+fanduct_shell+fanduct_w; 275 far = fanduct_ir+fanduct_shell+fanduct_w;
244 near = fanduct_ir; 276 near = fanduct_ir;
245 union() { 277 union() {
246 for(my=[0,1]) mirror([0,my,0]) { 278 for(my=[0,1]) mirror([0,my,0]) {
247 guideline([ [-far ,0], [0, nozzles_apart/8] ]); 279 guideline([ [-far ,0], [0, nozzles_apart/8] ]);
248 guideline([ [-far ,inlet_w/2/4 ], 280 guideline([ [-far ,inlet_w/2/4 ],
249 [-near ,to_midduct/2] ]); 281 [-near ,to_midduct/2] ]);
250 guideline([ [-near-fanduct_w/3, to_midduct/2 ], 282 guideline([ [-near-fanduct_w/3, to_midduct/2 ],
251 [-near ,nozzles_apart/2+near ] ]); 283 [-near ,nozzles_apart/2+near ] ]);
252 guideline([ [0 ,nozzles_apart/2+near+fanduct_w*space_behind_nozzle/to_midduct] ]); 284 guideline([ [0 ,nozzles_apart/2+near+fanduct_w*space_behind_nozzle/to_midduct] ]);
253 } 285 }
254 } 286 }
255 } 287 }
256 } 288 }
257 289
258 if(dual) dual(what); 290 module dual_simple(what=what) {
259 else if(type=="circular") circus(what); 291 for(my=[0:1]) mirror([0,my,0]) if(what=="in") {
292 difference() {
293 hull() {
294 translate([0,nozzles_apart/2+fanduct_ir+fanduct_shell+fanduct_w/2,0])
295 cylinder(d=fanduct_w+2*fanduct_shell,h=fanduct_h*2/3+2*fanduct_shell);
296 translate([0,nozzles_apart/2,-fanduct_elevation+fanduct_blowtarget])
297 rotate([0,90,0]) cylinder(r=.5,h=fanduct_w*2,center=true);
298 }
299 rr = 2*(fanduct_ir+fanduct_shell*2+fanduct_w+2);
300 translate([-rr/2,0,0]) mirror([0,0,1]) cube(size=[rr,rr,rr]);
301 }
302 }else if(what=="out") {
303 hull() {
304 translate([0,nozzles_apart/2+fanduct_ir+fanduct_shell+fanduct_w/2,fanduct_shell])
305 cylinder(d=fanduct_w,h=fanduct_h*2/3);
306 translate([0,nozzles_apart/2,-fanduct_elevation+fanduct_blowtarget])
307 rotate([0,90,0]) cylinder(d=.5,h=fanduct_w*2,center=true);
308 }
309 }
310 }
311
312 if(dual) {
313 if(type=="simple") dual_simple(what);
314 else dual(what);
315 }else if(type=="circular") circus(what);
260 else if(type=="3jets") jets(what); 316 else if(type=="3jets") jets(what);
261 } 317 }
262 318
263 // ***air intake 319 // ***air intake
264 module intake(what) { 320 module intake(what) {
265 module placeit() { 321 module placeit() {
266 translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) 322 translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell])
267 rotate([0,-90,0]) 323 rotate([0,-90,0])
268 children(); 324 children();
269 } 325 }
270 if(what=="in") { 326 if(what=="in") {
271 placeit() translate([0,-inlet_w/2,0]) { 327 placeit() translate([0,-inlet_w/2,0]) {
272 difference() { 328 difference() {
273 cube(size=[inlet_h,inlet_w,inlet_long_l+fanduct_shell]); translate([inlet_h+fanduct_shell,0,inlet_long_l+fanduct_shell]) 329 cube(size=[inlet_h,inlet_w,inlet_long_l+fanduct_shell]); translate([inlet_h+fanduct_shell,0,inlet_long_l+fanduct_shell])
274 rotate([-90,0,0]) 330 rotate([-90,0,0])
275 translate([0,0,-1]) 331 translate([0,0,-1])
276 cylinder(r=inlet_h,h=inlet_w+2*fanduct_shell+2,$fn=inlet_h*4); 332 cylinder(r=inlet_h,h=inlet_w+2*fanduct_shell+2,$fn=inlet_h*4);
277 } 333 }
278 // supports 334 // supports
279 for(i=[-1,0,1]) 335 for(i=[-1,0,1])
280 translate([-fanduct_shell, 336 translate([-fanduct_shell,
281 (i+1)*(inlet_w-extrusion_width)/2, 337 (i+1)*(inlet_w-extrusion_width)/2,
282 -inlet_away-fanduct_w/2]) 338 -inlet_away-fanduct_w/2])
283 cube(size=[fanduct_shell+1, 339 cube(size=[fanduct_shell+1,