summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--fanduct.scad96
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
@@ -1,262 +1,298 @@
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
6function hypothenuse(a,b) = sqrt(pow(a,2)+pow(b,2)); 6function hypothenuse(a,b) = sqrt(pow(a,2)+pow(b,2));
7 7
8silicone_shell = 2; 8silicone_shell = 2;
9heater_clearance = max( 9heater_clearance = max(
10 hypothenuse(16/2 +silicone_shell, 20-4.5 +silicone_shell),// E3D v6 10 hypothenuse(16/2 +silicone_shell, 20-4.5 +silicone_shell),// E3D v6
11 hypothenuse(11.5-4.5 +silicone_shell, 15.5 +silicone_shell)// E3D volcano 11 hypothenuse(11.5-4.5 +silicone_shell, 15.5 +silicone_shell)// E3D volcano
12); 12);
13 13
14 fanduct_elevation = 3; // fanduct elevation above nozzle tip 14 fanduct_elevation = 3; // fanduct elevation above nozzle tip
15 fanduct_blowtarget = -2; // what to blow at 15 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
28inlet_long_l = inlet_short_l+inlet_h; 28inlet_long_l = inlet_short_l+inlet_h;
29hotend_clearance = heater_clearance; 29hotend_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
32 36
33smooth_f = 120; 37smooth_f = 120;
34 38
35type="3jets"; // "3jets" ; // circular|3jets 39 type="circular"; // circular|3jets
36ductshape="square"; // square|round 40 ductshape="square"; // square|round
37 41 dual=true; // dual or single
38 42
39module fanduct(type=type,ductshape=ductshape) { 43to_midduct = fanduct_ir+fanduct_shell+fanduct_w/2;
44dual_spots = [ [+space_behind_nozzle, -(to_midduct+nozzles_apart/2)],
45 [- to_midduct, -(to_midduct+nozzles_apart/2)],
46 [- to_midduct, 0] ];
40 47
48module 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 }
72 108
73 // ***bumps for easier position adjustments in line with hotend 109 // ***bumps for easier position adjustments in line with hotend
74 module marks(what) { 110 module marks(what) {
75 if(what=="in") { 111 if(what=="in") {
76 for(y=[-1,1]) 112 for(y=[-1,1])
77 hull() for(z=[0,-fanduct_shell-fanduct_h/2]) 113 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]) 114 translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z])
79 rotate([90,0,0]) { 115 rotate([90,0,0]) {
80 cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); 116 cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30);
81 for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) 117 for(z=[-1,1]) translate([0,0,z*fanduct_w/2])
82 sphere(r=fanduct_shell,$fn=30); 118 sphere(r=fanduct_shell,$fn=30);
83 } 119 }
84 } 120 }
85 } 121 }
86 122
87 // ***output 123 // ***output
88 module output(what,type=type) { 124 module output(what,type=type) {
89 module guideline(xyxy) { 125 module guideline(xyxy) {
90 module pin(xy) { 126 module pin(xy) {
91 translate([xy[0],xy[1],0]) 127 translate([xy[0],xy[1],0])
92 cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); 128 cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6);
93 } 129 }
94 xyxyxy=concat(xyxy,[[0,0]]); 130 xyxyxy=concat(xyxy,[[0,0]]);
95 for(i=[0:1:len(xyxyxy)-2]) 131 for(i=[0:1:len(xyxyxy)-2])
96 hull() for(j=[i,i+1]) pin(xyxyxy[j]); 132 hull() for(j=[i,i+1]) pin(xyxyxy[j]);
97 } 133 }
98 134
99 module circus(what) { 135 module circus(what) {
100 if(what=="in") { 136 if(what=="in") {
101 difference() { 137 difference() {
102 rotate_extrude($fn=smooth_f) 138 rotate_extrude($fn=smooth_f)
103 polygon([ 139 polygon([
104 [0,-fanduct_elevation+fanduct_blowtarget+epsilon], 140 [0,-fanduct_elevation+fanduct_blowtarget+epsilon],
105 [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], 141 [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2],
106 [fanduct_ir+fanduct_shell+fanduct_w/2,0], 142 [fanduct_ir+fanduct_shell+fanduct_w/2,0],
107 [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); 143 [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]);
108 translate([0,0,-1]) 144 translate([0,0,-1])
109 cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); 145 cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f);
110 mirror([0,0,1]) 146 mirror([0,0,1])
111 translate([0,0,-epsilon]) 147 translate([0,0,-epsilon])
112 cylinder(r=fanduct_ir+2*fanduct_shell+fanduct_w+1,h=fanduct_elevation+.1+2); 148 cylinder(r=fanduct_ir+2*fanduct_shell+fanduct_w+1,h=fanduct_elevation+.1+2);
113 } 149 }
114 }else if(what=="out") { 150 }else if(what=="out") {
115 rotate_extrude($fn=smooth_f) 151 rotate_extrude($fn=smooth_f)
116 polygon([ 152 polygon([
117 [0,-fanduct_elevation+fanduct_blowtarget+epsilon], 153 [0,-fanduct_elevation+fanduct_blowtarget+epsilon],
118 [fanduct_ir+fanduct_shell+1,fanduct_h/2], 154 [fanduct_ir+fanduct_shell+1,fanduct_h/2],
119 [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell], 155 [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell],
120 [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); 156 [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]);
121 }else if(what=="airguides") { 157 }else if(what=="airguides") {
122 inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; 158 inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w;
123 union() { 159 union() {
124 for(my=[0,1]) mirror([0,my,0]) { 160 for(my=[0,1]) mirror([0,my,0]) {
125 guideline([ 161 guideline([
126 [-our,inlet_w/6], 162 [-our,inlet_w/6],
127 [-inr*sin(60),inr*cos(60)] 163 [-inr*sin(60),inr*cos(60)]
128 ]); 164 ]);
129 a0=30; as=15; a1=180; 165 a0=30; as=15; a1=180;
130 for(a=[a0+as:as:a1]) { 166 for(a=[a0+as:as:a1]) {
131 f = as/(a1-a+as); 167 f = as/(a1-a+as);
132 rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); 168 rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]);
133 } 169 }
134 guideline([ 170 guideline([
135 [-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],
136 [-inr*cos(10),inr*sin(10)] 172 [-inr*cos(10),inr*sin(10)]
137 ]); 173 ]);
138 } 174 }
139 }/*union*/ 175 }/*union*/
140 }/*airguides*/ 176 }/*airguides*/
141 } 177 }
142 178
143 module jets(what) { 179 module jets(what) {
144 od = fanduct_h*2/3+fanduct_shell; 180 od = fanduct_h*2/3+fanduct_shell;
145 md = fanduct_ir+fanduct_shell+fanduct_w/2; 181 md = fanduct_ir+fanduct_shell+fanduct_w/2;
146 jww = 2*md*sin(jet_angle/2); 182 jww = 2*md*sin(jet_angle/2);
147 difference() { 183 difference() {
148 for(a=[0:120:359]) rotate([0,0,a]) { 184 for(a=[0:120:359]) rotate([0,0,a]) {
149 if(what=="in") { 185 if(what=="in") {
150 hull() { 186 hull() {
151 intersection() { 187 intersection() {
152 translate([md-fanduct_w/2,-jww/2,0]) 188 translate([md-fanduct_w/2,-jww/2,0])
153 cube(size=[fanduct_shell+fanduct_w/2,jww,od]); 189 cube(size=[fanduct_shell+fanduct_w/2,jww,od]);
154 duct(what=what); 190 duct(what=what);
155 } 191 }
156 translate([0,0,-fanduct_elevation]) sphere(r=.5); 192 translate([0,0,-fanduct_elevation]) sphere(r=.5);
157 } 193 }
158 }else if(what=="out") { 194 }else if(what=="out") {
159 hull() { 195 hull() {
160 intersection() { 196 intersection() {
161 translate([md-fanduct_w/2,-jww/2+fanduct_shell,fanduct_shell]) 197 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]); 198 cube(size=[fanduct_w/2,jww-2*fanduct_shell,od-2*fanduct_shell]);
163 duct(what=what); 199 duct(what=what);
164 } 200 }
165 translate([0,0,-fanduct_elevation]) sphere(r=.2); 201 translate([0,0,-fanduct_elevation]) sphere(r=.2);
166 } 202 }
167 } 203 }
168 } 204 }
169 if(what=="in") { 205 if(what=="in") {
170 translate([0,0,-fanduct_elevation-2+epsilon]) 206 translate([0,0,-fanduct_elevation-2+epsilon])
171 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);
172 translate([0,0,-hotend_clearance]) 208 translate([0,0,-hotend_clearance])
173 rotate([0,0,30]) 209 rotate([0,0,30])
174 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);
175 } 211 }
176 } 212 }
177 } 213 }
178 214
179 if(type=="circular") circus(what); 215 if(type=="circular") circus(what);
180 else if(type=="3jets") jets(what); 216 else if(type=="3jets") jets(what);
181 } 217 }
182 218
183 // ***air intake 219 // ***air intake
184 module intake(what) { 220 module intake(what) {
185 module placeit() { 221 module placeit() {
186 translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) 222 translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell])
187 rotate([0,-90,0]) 223 rotate([0,-90,0])
188 children(); 224 children();
189 } 225 }
190 if(what=="in") { 226 if(what=="in") {
191 placeit() translate([0,-inlet_w/2,0]) { 227 placeit() translate([0,-inlet_w/2,0]) {
192 difference() { 228 difference() {
193 cube(size=[inlet_h,inlet_w,inlet_long_l+fanduct_shell]); 229 cube(size=[inlet_h,inlet_w,inlet_long_l+fanduct_shell]);
194 translate([inlet_h+fanduct_shell,0,inlet_long_l+fanduct_shell]) 230 translate([inlet_h+fanduct_shell,0,inlet_long_l+fanduct_shell])
195 rotate([-90,0,0]) 231 rotate([-90,0,0])
196 translate([0,0,-1]) 232 translate([0,0,-1])
197 cylinder(r=inlet_h,h=inlet_w+2*fanduct_shell+2,$fn=inlet_h*4); 233 cylinder(r=inlet_h,h=inlet_w+2*fanduct_shell+2,$fn=inlet_h*4);
198 } 234 }
199 // supports 235 // supports
200 for(i=[-1,0,1]) 236 for(i=[-1,0,1])
201 translate([-fanduct_shell, 237 translate([-fanduct_shell,
202 (i+1)*(inlet_w-extrusion_width)/2, 238 (i+1)*(inlet_w-extrusion_width)/2,
203 -inlet_away-fanduct_w/2]) 239 -inlet_away-fanduct_w/2])
204 cube(size=[fanduct_shell, 240 cube(size=[fanduct_shell,
205 extrusion_width, 241 extrusion_width,
206 inlet_long_l+fanduct_shell+inlet_away+fanduct_w/2]); 242 inlet_long_l+fanduct_shell+inlet_away+fanduct_w/2]);
207 } 243 }
208 hull() { 244 hull() {
209 placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) 245 placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0])
210 cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]); 246 cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]);
211 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) 247 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0])
212 translate([0,-inlet_w/2-fanduct_shell/2,0]) 248 translate([0,-inlet_w/2-fanduct_shell/2,0])
213 cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]); 249 cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]);
214 } 250 }
215 }else if(what=="out") { 251 }else if(what=="out") {
216 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) 252 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0])
217 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_long_l+fanduct_shell+1]); 253 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_long_l+fanduct_shell+1]);
218 hull() { 254 hull() {
219 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) 255 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0])
220 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]); 256 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]);
221 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) 257 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell])
222 translate([0,-inlet_w/2+fanduct_shell,0]) 258 translate([0,-inlet_w/2+fanduct_shell,0])
223 cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]); 259 cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]);
224 } 260 }
225 } 261 }
226 } 262 }
227 263
228 // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…) 264 // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…)
229 module tails(what) { 265 module tails(what) {
230 if(what=="in") { 266 if(what=="in") {
231 for(mx=[0,1]) mirror([mx,0,0]) 267 for(mx=[0,1]) mirror([mx,0,0])
232 translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2]) 268 translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2])
233 rotate([90,0,90]) 269 rotate([90,0,90])
234 translate([0,0,-snapper_d/2]) 270 translate([0,0,-snapper_d/2])
235 snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell); 271 snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell);
236 } 272 }
237 } 273 }
238 274
239 module parts(what) { 275 module parts(what) {
240 union() { 276 union() {
241 duct(what); 277 duct(what);
242 marks(what); 278 marks(what);
243 output(what); 279 output(what);
244 intake(what); 280 intake(what);
245 tails(what); 281 tails(what);
246 } 282 }
247 } 283 }
248 284
249 difference() { 285 difference() {
250 parts("in"); 286 parts("in");
251 parts("out"); 287 parts("out");
252 } 288 }
253 intersection() { 289 intersection() {
254 union() { 290 union() {
255 output("airguides"); 291 output("airguides");
256 sphere(d=epsilon); 292 sphere(d=epsilon);
257 } 293 }
258 union() { 294 union() {
259 duct("in"); output("in"); intake("in"); 295 duct("in"); output("in"); intake("in");
260 } 296 }
261 } 297 }
262} 298}