summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2016-06-11 14:08:31 (UTC)
committer Michael Krelin <hacker@klever.net>2016-06-11 14:08:31 (UTC)
commit0398dd6a4e41ec26d48ad02caffc319f34cbfcb1 (patch) (unidiff)
tree6b5c5cb97ac2ad98179ebddd5db08757994eaa29
parent81e4c02f584b5404628cda56502d0eedbc93b8f1 (diff)
downloadfanductory-0398dd6a4e41ec26d48ad02caffc319f34cbfcb1.zip
fanductory-0398dd6a4e41ec26d48ad02caffc319f34cbfcb1.tar.gz
fanductory-0398dd6a4e41ec26d48ad02caffc319f34cbfcb1.tar.bz2
selectable round/square duct section
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--fanduct.scad29
1 files changed, 21 insertions, 8 deletions
diff --git a/fanduct.scad b/fanduct.scad
index 53630a3..746f753 100644
--- a/fanduct.scad
+++ b/fanduct.scad
@@ -1,102 +1,115 @@
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_l = 7; // inlet length of protrusion (or depth of intrusion:)) 25 inlet_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
28hotend_clearance = heater_clearance; 28hotend_clearance = heater_clearance;
29 29
30 snapper_d = 8; snapper_overlap=0.2;// snip snap 30 snapper_d = 8; snapper_overlap=0.2;// snip snap
31 31
32smooth_f = 120; 32smooth_f = 120;
33 33
34type="3jets"; // "3jets" ; // circular|3jets 34type="3jets"; // "3jets" ; // circular|3jets
35ductshape="square"; // square|round
35 36
36 37
37module fanduct(type=type) { 38module fanduct(type=type,ductshape=ductshape) {
38 39
39 // ***duct is all around! 40 // ***duct is all around!
40 module duct(what) { 41 module duct(what) {
41 if(what=="in") { 42 if(what=="in") {
42 sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; 43 sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell;
43 smax = max(sh,sv); 44 smax = max(sh,sv);
44 rotate_extrude($fn=smooth_f) 45 rotate_extrude($fn=smooth_f)
45 translate([sh/2+fanduct_ir,sv/2]) 46 if(ductshape=="round")
46 scale([sh/smax,sv/smax]) 47 translate([sh/2+fanduct_ir,sv/2])
47 circle(d=smax,$fn=4*smax); 48 scale([sh/smax,sv/smax])
49 circle(d=smax,$fn=4*smax);
50 else if(ductshape=="square")
51 translate([fanduct_ir,0])
52 square([sh,sv]);
48 }else if(what=="out") { 53 }else if(what=="out") {
49 sh = fanduct_w; sv = fanduct_h; 54 sh = fanduct_w; sv = fanduct_h;
50 smax = max(sh,sv); 55 smax = max(sh,sv);
51 rotate_extrude($fn=smooth_f) 56 rotate_extrude($fn=smooth_f)
52 translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) 57 if(ductshape=="round")
53 scale([sh/smax,sv/smax]) 58 translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell])
54 circle(d=smax,$fn=4*smax); 59 scale([sh/smax,sv/smax])
60 circle(d=smax,$fn=4*smax);
61 else if(ductshape=="square")
62 translate([fanduct_ir+fanduct_shell,fanduct_shell])
63 union() {
64 square([fanduct_w,fanduct_h/2]);
65 translate([fanduct_w/2,fanduct_h-fanduct_w/2])
66 rotate([0,0,90]) circle(d=fanduct_w,$fn=36);
67 }
55 } 68 }
56 } 69 }
57 70
58 // ***bumps for easier position adjustments in line with hotend 71 // ***bumps for easier position adjustments in line with hotend
59 module marks(what) { 72 module marks(what) {
60 if(what=="in") { 73 if(what=="in") {
61 for(y=[-1,1]) 74 for(y=[-1,1])
62 hull() for(z=[0,-fanduct_shell-fanduct_h/2]) 75 hull() for(z=[0,-fanduct_shell-fanduct_h/2])
63 translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) 76 translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z])
64 rotate([90,0,0]) { 77 rotate([90,0,0]) {
65 cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); 78 cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30);
66 for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) 79 for(z=[-1,1]) translate([0,0,z*fanduct_w/2])
67 sphere(r=fanduct_shell,$fn=30); 80 sphere(r=fanduct_shell,$fn=30);
68 } 81 }
69 } 82 }
70 } 83 }
71 84
72 // ***output 85 // ***output
73 module output(what,type=type) { 86 module output(what,type=type) {
74 module guideline(xyxy) { 87 module guideline(xyxy) {
75 module pin(xy) { 88 module pin(xy) {
76 translate([xy[0],xy[1],0]) 89 translate([xy[0],xy[1],0])
77 cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); 90 cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6);
78 } 91 }
79 xyxyxy=concat(xyxy,[[0,0]]); 92 xyxyxy=concat(xyxy,[[0,0]]);
80 for(i=[0:1:len(xyxyxy)-2]) 93 for(i=[0:1:len(xyxyxy)-2])
81 hull() for(j=[i,i+1]) pin(xyxyxy[j]); 94 hull() for(j=[i,i+1]) pin(xyxyxy[j]);
82 } 95 }
83 96
84 module circus(what) { 97 module circus(what) {
85 if(what=="in") { 98 if(what=="in") {
86 difference() { 99 difference() {
87 rotate_extrude($fn=smooth_f) 100 rotate_extrude($fn=smooth_f)
88 polygon([ 101 polygon([
89 [0,-fanduct_elevation+fanduct_blowtarget+epsilon], 102 [0,-fanduct_elevation+fanduct_blowtarget+epsilon],
90 [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], 103 [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2],
91 [fanduct_ir+fanduct_shell+fanduct_w/2,0], 104 [fanduct_ir+fanduct_shell+fanduct_w/2,0],
92 [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); 105 [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]);
93 translate([0,0,-1]) 106 translate([0,0,-1])
94 cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); 107 cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f);
95 mirror([0,0,1]) 108 mirror([0,0,1])
96 translate([0,0,-epsilon]) 109 translate([0,0,-epsilon])
97 cylinder(r=fanduct_ir+fanduct_shell+1,h=fanduct_elevation+.1+2); 110 cylinder(r=fanduct_ir+fanduct_shell+1,h=fanduct_elevation+.1+2);
98 } 111 }
99 }else if(what=="out") { 112 }else if(what=="out") {
100 rotate_extrude($fn=smooth_f) 113 rotate_extrude($fn=smooth_f)
101 polygon([ 114 polygon([
102 [0,-fanduct_elevation+fanduct_blowtarget+epsilon], 115 [0,-fanduct_elevation+fanduct_blowtarget+epsilon],
@@ -195,66 +208,66 @@ module fanduct(type=type) {
195 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) 208 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0])
196 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_l+fanduct_shell+1]); 209 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_l+fanduct_shell+1]);
197 hull() { 210 hull() {
198 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) 211 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0])
199 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]); 212 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]);
200 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) 213 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell])
201 translate([0,-inlet_w/2+fanduct_shell,0]) 214 translate([0,-inlet_w/2+fanduct_shell,0])
202 cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]); 215 cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]);
203 } 216 }
204 } 217 }
205 } 218 }
206 219
207 // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…) 220 // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…)
208 module tails(what) { 221 module tails(what) {
209 if(what=="in") { 222 if(what=="in") {
210 for(mx=[0,1]) mirror([mx,0,0]) 223 for(mx=[0,1]) mirror([mx,0,0])
211 translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2]) 224 translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2])
212 rotate([90,0,90]) 225 rotate([90,0,90])
213 translate([0,0,-snapper_d/2]) 226 translate([0,0,-snapper_d/2])
214 snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell); 227 snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell);
215 } 228 }
216 } 229 }
217 230
218 module parts(what) { 231 module parts(what) {
219 union() { 232 union() {
220 duct(what); 233 duct(what);
221 marks(what); 234 marks(what);
222 output(what); 235 output(what);
223 intake(what); 236 intake(what);
224 tails(what); 237 tails(what);
225 } 238 }
226 } 239 }
227 240
228 difference() { 241 difference() {
229 parts("in"); 242 parts("in");
230 parts("out"); 243 parts("out");
231 } 244 }
232 intersection() { 245 intersection() {
233 union() { 246 union() {
234 output("airguides"); 247 output("airguides");
235 sphere(d=epsilon); 248 sphere(d=epsilon);
236 } 249 }
237 union() { 250 union() {
238 duct("in"); output("in"); intake("in"); 251 duct("in"); output("in"); intake("in");
239 } 252 }
240 } 253 }
241} 254}
242 255
243view="full"; // hcut|vcut|* 256view="vcut"; // hcut|vcut|*
244 257
245hinfinity=4*(fanduct_ir+fanduct_shell*2+fanduct_w+inlet_away); 258hinfinity=4*(fanduct_ir+fanduct_shell*2+fanduct_w+inlet_away);
246vinfinity=2*(fanduct_shell*2+fanduct_h+inlet_h); 259vinfinity=2*(fanduct_shell*2+fanduct_h+inlet_h);
247if(view=="hcut") { 260if(view=="hcut") {
248 difference() { 261 difference() {
249 fanduct(); 262 fanduct();
250 translate([-hinfinity/2,-hinfinity/2,fanduct_shell+fanduct_h/2]) 263 translate([-hinfinity/2,-hinfinity/2,fanduct_shell+fanduct_h/2])
251 cube(size=[hinfinity,hinfinity,vinfinity]); 264 cube(size=[hinfinity,hinfinity,vinfinity]);
252 } 265 }
253}else if(view=="vcut") { 266}else if(view=="vcut") {
254 difference() { 267 difference() {
255 fanduct(); 268 fanduct();
256 translate([-hinfinity/2,0,-vinfinity/2]) 269 translate([-hinfinity/2,0,-vinfinity/2])
257 cube(size=[hinfinity,hinfinity,vinfinity]); 270 cube(size=[hinfinity,hinfinity,vinfinity]);
258 } 271 }
259}else fanduct(); 272}else fanduct();
260/* vim:set sw=1 ai: */ 273/* vim:set sw=1 ai: */