summaryrefslogtreecommitdiffabout
path: root/fanduct.scad
Unidiff
Diffstat (limited to 'fanduct.scad') (more/less context) (show whitespace changes)
-rw-r--r--fanduct.scad42
1 files changed, 22 insertions, 20 deletions
diff --git a/fanduct.scad b/fanduct.scad
index a17b261..ba63717 100644
--- a/fanduct.scad
+++ b/fanduct.scad
@@ -5,125 +5,127 @@ epsilon=.005; // for finer cuts
5 5
6 type="simple"; // 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
31 fanduct_blowtarget = -2; // what to blow at 31 fanduct_blowtarget = -2; // what to blow at
32 fanduct_h = 6; // inner height of the duct 32 fanduct_h = 6; // inner height of the duct
33 fanduct_w = 7; // inner width of the duct 33 fanduct_w = 7; // inner width of the duct
34 fanduct_shell=1.2; // shell thickness 34 fanduct_shell=1.2; // shell thickness
35 fanduct_ir = heater_clearance+5; // inner radius 35 fanduct_ir = heater_clearance+5; // inner radius
36 36
37 jet_angle = 60-2; // angular width of the jet 37 jet_angle = 60-2; // angular width of the jet
38 38
39hotend_clearance = heater_clearance; 39hotend_clearance = heater_clearance;
40 40
41 snapper_d = 8; snapper_overlap=0.2;// snip snap 41 snapper_d = 8; snapper_overlap=0.2;// snip snap
42 42
43draft=true; 43draft=true;
44smooth_f = draft? 30 : 120; 44smooth_f = draft? 30 : 120;
45 45
46to_midduct = fanduct_ir+fanduct_shell+fanduct_w/2; 46to_midduct = fanduct_ir+fanduct_shell+fanduct_w/2;
47dual_spots = [ [+space_behind_nozzle, -(to_midduct+nozzles_apart/2)], 47dual_spots = [ [+space_behind_nozzle, -(to_midduct+nozzles_apart/2)],
48 [- to_midduct, -(to_midduct+nozzles_apart/2)], 48 [- to_midduct, -(to_midduct+nozzles_apart/2)],
49 [- to_midduct, 0] ]; 49 [- to_midduct, 0] ];
50 50
51module fanduct(type=type,ductshape=ductshape,dual=dual) { 51module fanduct(type=type,ductshape=ductshape,dual=dual) {
52 // ***duct is all around! 52 // ***duct is all around!
53
53 module duct(what) { 54 module duct(what) {
54 module single() { 55 module ductshape(what,sh,sv,r) {
55 if(what=="in") {
56 sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell;
57 smax = max(sh,sv); 56 smax = max(sh,sv);
58 rotate_extrude($fn=smooth_f) 57 translate([what=="in"?0:fanduct_shell,what=="in"?0:fanduct_shell])
59 if(ductshape=="round") 58 if(ductshape=="round") {
60 translate([sh/2+fanduct_ir,sv/2]) 59 translate([sh/2+r,sv/2])
61 scale([sh/smax,sv/smax]) 60 scale([sh/smax,sv/smax])
62 circle(d=smax,$fn=4*smax); 61 circle(d=smax,$fn=4*smax);
63 else if(ductshape=="square") 62 }else if(ductshape=="square") {
64 translate([fanduct_ir,0]) 63 translate([r,0])
64 if(what=="in")
65 square([sh,sv]); 65 square([sh,sv]);
66 }else if(what=="out") { 66 else if(what=="out") union() {
67 sh = fanduct_w; sv = fanduct_h;
68 smax = max(sh,sv);
69 rotate_extrude($fn=smooth_f)
70 if(ductshape=="round")
71 translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell])
72 scale([sh/smax,sv/smax])
73 circle(d=smax,$fn=4*smax);
74 else if(ductshape=="square")
75 translate([fanduct_ir+fanduct_shell,fanduct_shell])
76 union() {
77 square([sh,sv/2]); 67 square([sh,sv/2]);
78 translate([sh/2,sv/2]) 68 translate([sh/2,sv/2])
79 scale([sh/smax,sv/smax]) 69 scale([sh/smax,sv/smax])
80 circle(d=smax,$fn=36); 70 circle(d=smax,$fn=4*smax);
71 }
72 }
81 } 73 }
74 module single() {
75 if(what=="in") {
76 sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell;
77 rotate_extrude($fn=smooth_f)
78 ductshape(what=what,sh=sh,sv=sv,r=fanduct_ir);
79 }else if(what=="out") {
80 sh = fanduct_w; sv = fanduct_h;
81 smax = max(sh,sv);
82 rotate_extrude($fn=smooth_f)
83 ductshape(what=what,sh=sh,sv=sv,r=fanduct_ir);
82 } 84 }
83 } 85 }
84 module dual() { 86 module dual() {
85 module hulls(spots=dual_spots) { 87 module hulls(spots=dual_spots) {
86 for(my=[0,1]) mirror([0,my,0]) for(pn=[0:1:len(spots)-2]) hull() { 88 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(); 89 for(p=[spots[pn],spots[pn+1]]) translate(p) children();
88 } 90 }
89 } 91 }
90 if(what=="in") { 92 if(what=="in") {
91 hulls() cylinder(d=fanduct_w+2*fanduct_shell,h=fanduct_h+2*fanduct_shell); 93 hulls() cylinder(d=fanduct_w+2*fanduct_shell,h=fanduct_h+2*fanduct_shell);
92 }else if(what=="out") { 94 }else if(what=="out") {
93 sh = fanduct_w; sv = fanduct_h; 95 sh = fanduct_w; sv = fanduct_h;
94 smax = max(sh,sv); 96 smax = max(sh,sv);
95 translate([0,0,fanduct_shell]) hulls() { 97 translate([0,0,fanduct_shell]) hulls() {
96 cylinder(d=fanduct_w,h=fanduct_h/2); 98 cylinder(d=fanduct_w,h=fanduct_h/2);
97 translate([0,0,fanduct_h/2]) 99 translate([0,0,fanduct_h/2])
98 scale([sh/smax,sh/smax,sv/smax]) 100 scale([sh/smax,sh/smax,sv/smax])
99 intersection() { 101 intersection() {
100 sphere(d=smax,$fn=36); 102 sphere(d=smax,$fn=36);
101 translate([0,0,-1]) 103 translate([0,0,-1])
102 cylinder(d=smax+2,h=smax+2,$fn=36); 104 cylinder(d=smax+2,h=smax+2,$fn=36);
103 } 105 }
104 } 106 }
105 } 107 }
106 } 108 }
107 module dual_simple() { 109 module dual_simple() {
108 for(my=[0,1]) mirror([0,my,0]) 110 for(my=[0,1]) mirror([0,my,0])
109 if(what=="in") { 111 if(what=="in") {
110 sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; 112 sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell;
111 translate([0,nozzles_apart/2,0]) 113 translate([0,nozzles_apart/2,0])
112 intersection() { 114 intersection() {
113 rotate_extrude($fn=smooth_f) 115 rotate_extrude($fn=smooth_f)
114 translate([fanduct_ir,0]) square([sh,sv]); 116 translate([fanduct_ir,0]) square([sh,sv]);
115 translate([-fanduct_ir-sh-1,0,-1]) 117 translate([-fanduct_ir-sh-1,0,-1])
116 cube(size=[fanduct_ir+sh+2,fanduct_ir+sh+2,sv+2]); 118 cube(size=[fanduct_ir+sh+2,fanduct_ir+sh+2,sv+2]);
117 } 119 }
118 translate([-fanduct_ir-sh,-epsilon,0]) 120 translate([-fanduct_ir-sh,-epsilon,0])
119 cube(size=[sh,nozzles_apart/2+2*epsilon,sv]); 121 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); 122 translate([0,sh/2+fanduct_ir+nozzles_apart/2,0]) cylinder(d=sh,h=sv,$fn=36);
121 }else if(what=="out") { 123 }else if(what=="out") {
122 sh = fanduct_w; sv = fanduct_h; 124 sh = fanduct_w; sv = fanduct_h;
123 translate([0,nozzles_apart/2,fanduct_shell]) 125 translate([0,nozzles_apart/2,fanduct_shell])
124 intersection() { 126 intersection() {
125 rotate_extrude($fn=smooth_f) 127 rotate_extrude($fn=smooth_f)
126 translate([fanduct_ir+fanduct_shell,0]) square([sh,sv]); 128 translate([fanduct_ir+fanduct_shell,0]) square([sh,sv]);
127 translate([-fanduct_ir-2*fanduct_shell-sh-1,-1,0]) 129 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]); 130 cube(size=[fanduct_ir+2*fanduct_shell+sh+2,fanduct_ir+2*fanduct_shell+sh+2,sv]);
129 } 131 }