summaryrefslogtreecommitdiffabout
path: root/fanduct.scad
Unidiff
Diffstat (limited to 'fanduct.scad') (more/less context) (ignore whitespace changes)
-rw-r--r--fanduct.scad12
1 files changed, 8 insertions, 4 deletions
diff --git a/fanduct.scad b/fanduct.scad
index 563920c..421dd5a 100644
--- a/fanduct.scad
+++ b/fanduct.scad
@@ -1,256 +1,260 @@
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 heater_w = 16; // heatblock width 6function hypothenuse(a,b) = sqrt(pow(a,2)+pow(b,2));
7 heater_l = 20; // heatblock length 7
8 nozzle_offset=4.5;// nozzle offset from the edge of heatblock 8silicone_shell = 2;
9heater_clearance = max(
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
12);
9 13
10 fanduct_elevation = 3; // fanduct elevation above nozzle tip 14 fanduct_elevation = 3; // fanduct elevation above nozzle tip
11 fanduct_blowtarget = -2; // what to blow at 15 fanduct_blowtarget = -2; // what to blow at
12 fanduct_h = 6; // inner height of the duct 16 fanduct_h = 6; // inner height of the duct
13 fanduct_w = 7; // inner width of the duct 17 fanduct_w = 7; // inner width of the duct
14 fanduct_shell=1.2; // shell thickness 18 fanduct_shell=1.2; // shell thickness
15 fanduct_ir = sqrt(pow(heater_w/2,2)+pow(heater_l-nozzle_offset,2))+5;// inner radius 19 fanduct_ir = heater_clearance+5; // inner radius
16 20
17 jet_angle = 60; // angular width of the jet 21 jet_angle = 60; // angular width of the jet
18 22
19 inlet_w = 12.5; // inlet width 23 inlet_w = 12.5; // inlet width
20 inlet_h = 17; // inlet height 24 inlet_h = 17; // inlet height
21 inlet_l = 7; // inlet length of protrusion (or depth of intrusion:)) 25 inlet_l = 7; // inlet length of protrusion (or depth of intrusion:))
22 inlet_away = 15;// how far away inlet is 26 inlet_away = 15;// how far away inlet is
23 27
24hotend_clearance = 12; 28hotend_clearance = 12;
25 29
26 snapper_d = 8; snapper_overlap=0.2;// snip snap 30 snapper_d = 8; snapper_overlap=0.2;// snip snap
27 31
28smooth_f = 120; 32smooth_f = 120;
29 33
30type="3jets"; // "3jets" ; // circular|3jets 34type="3jets"; // "3jets" ; // circular|3jets
31 35
32 36
33module fanduct(type=type) { 37module fanduct(type=type) {
34 38
35 // ***duct is all around! 39 // ***duct is all around!
36 module duct(what) { 40 module duct(what) {
37 if(what=="in") { 41 if(what=="in") {
38 sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; 42 sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell;
39 smax = max(sh,sv); 43 smax = max(sh,sv);
40 rotate_extrude($fn=smooth_f) 44 rotate_extrude($fn=smooth_f)
41 translate([sh/2+fanduct_ir,sv/2]) 45 translate([sh/2+fanduct_ir,sv/2])
42 scale([sh/smax,sv/smax]) 46 scale([sh/smax,sv/smax])
43 circle(d=smax,$fn=4*smax); 47 circle(d=smax,$fn=4*smax);
44 }else if(what=="out") { 48 }else if(what=="out") {
45 sh = fanduct_w; sv = fanduct_h; 49 sh = fanduct_w; sv = fanduct_h;
46 smax = max(sh,sv); 50 smax = max(sh,sv);
47 rotate_extrude($fn=smooth_f) 51 rotate_extrude($fn=smooth_f)
48 translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) 52 translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell])
49 scale([sh/smax,sv/smax]) 53 scale([sh/smax,sv/smax])
50 circle(d=smax,$fn=4*smax); 54 circle(d=smax,$fn=4*smax);
51 } 55 }
52 } 56 }
53 57
54 // ***bumps for easier position adjustments in line with hotend 58 // ***bumps for easier position adjustments in line with hotend
55 module marks(what) { 59 module marks(what) {
56 if(what=="in") { 60 if(what=="in") {
57 for(y=[-1,1]) 61 for(y=[-1,1])
58 hull() for(z=[0,-fanduct_shell-fanduct_h/2]) 62 hull() for(z=[0,-fanduct_shell-fanduct_h/2])
59 translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) 63 translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z])
60 rotate([90,0,0]) { 64 rotate([90,0,0]) {
61 cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); 65 cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30);
62 for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) 66 for(z=[-1,1]) translate([0,0,z*fanduct_w/2])
63 sphere(r=fanduct_shell,$fn=30); 67 sphere(r=fanduct_shell,$fn=30);
64 } 68 }
65 } 69 }
66 } 70 }
67 71
68 // ***output 72 // ***output
69 module output(what,type=type) { 73 module output(what,type=type) {
70 module guideline(xyxy) { 74 module guideline(xyxy) {
71 module pin(xy) { 75 module pin(xy) {
72 translate([xy[0],xy[1],0]) 76 translate([xy[0],xy[1],0])
73 cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); 77 cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6);
74 } 78 }
75 xyxyxy=concat(xyxy,[[0,0]]); 79 xyxyxy=concat(xyxy,[[0,0]]);
76 for(i=[0:1:len(xyxyxy)-2]) 80 for(i=[0:1:len(xyxyxy)-2])
77 hull() for(j=[i,i+1]) pin(xyxyxy[j]); 81 hull() for(j=[i,i+1]) pin(xyxyxy[j]);
78 } 82 }
79 83
80 module circus(what) { 84 module circus(what) {
81 if(what=="in") { 85 if(what=="in") {
82 difference() { 86 difference() {
83 rotate_extrude($fn=smooth_f) 87 rotate_extrude($fn=smooth_f)
84 polygon([ 88 polygon([
85 [0,-fanduct_elevation+fanduct_blowtarget+epsilon], 89 [0,-fanduct_elevation+fanduct_blowtarget+epsilon],
86 [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], 90 [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2],
87 [fanduct_ir+fanduct_shell+fanduct_w/2,0], 91 [fanduct_ir+fanduct_shell+fanduct_w/2,0],
88 [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); 92 [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]);
89 translate([0,0,-1]) 93 translate([0,0,-1])
90 cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); 94 cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f);
91 mirror([0,0,1]) 95 mirror([0,0,1])
92 translate([0,0,-epsilon]) 96 translate([0,0,-epsilon])
93 cylinder(r=fanduct_ir+fanduct_shell+1,h=fanduct_elevation+.1+2); 97 cylinder(r=fanduct_ir+fanduct_shell+1,h=fanduct_elevation+.1+2);
94 } 98 }
95 }else if(what=="out") { 99 }else if(what=="out") {
96 rotate_extrude($fn=smooth_f) 100 rotate_extrude($fn=smooth_f)
97 polygon([ 101 polygon([
98 [0,-fanduct_elevation+fanduct_blowtarget+epsilon], 102 [0,-fanduct_elevation+fanduct_blowtarget+epsilon],
99 [fanduct_ir+fanduct_shell+1,fanduct_h/2], 103 [fanduct_ir+fanduct_shell+1,fanduct_h/2],
100 [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell], 104 [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell],
101 [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); 105 [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]);
102 }else if(what=="airguides") { 106 }else if(what=="airguides") {
103 inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; 107 inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w;
104 union() { 108 union() {
105 for(my=[0,1]) mirror([0,my,0]) { 109 for(my=[0,1]) mirror([0,my,0]) {
106 guideline([ 110 guideline([
107 [-our,inlet_w/6], 111 [-our,inlet_w/6],
108 [-inr*sin(60),inr*cos(60)] 112 [-inr*sin(60),inr*cos(60)]
109 ]); 113 ]);
110 a0=30; as=15; a1=180; 114 a0=30; as=15; a1=180;
111 for(a=[a0+as:as:a1]) { 115 for(a=[a0+as:as:a1]) {
112 f = as/(a1-a+as); 116 f = as/(a1-a+as);
113 rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); 117 rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]);
114 } 118 }
115 guideline([ 119 guideline([
116 [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], 120 [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4],
117 [-inr*cos(10),inr*sin(10)] 121 [-inr*cos(10),inr*sin(10)]
118 ]); 122 ]);
119 } 123 }
120 }/*union*/ 124 }/*union*/
121 }/*airguides*/ 125 }/*airguides*/
122 } 126 }
123 127
124 module jets(what) { 128 module jets(what) {
125 od = fanduct_h/2+fanduct_shell; 129 od = fanduct_h/2+fanduct_shell;
126 md = fanduct_ir+fanduct_shell+fanduct_w/2; 130 md = fanduct_ir+fanduct_shell+fanduct_w/2;
127 jww = 2*md*sin(jet_angle/2); 131 jww = 2*md*sin(jet_angle/2);
128 render(convexity=8) difference() { 132 render(convexity=8) difference() {
129 for(a=[0:120:359]) rotate([0,0,a]) { 133 for(a=[0:120:359]) rotate([0,0,a]) {
130 if(what=="in") { 134 if(what=="in") {
131 hull() { 135 hull() {
132 render(convexity=4) intersection() { 136 render(convexity=4) intersection() {
133 translate([md-fanduct_shell-fanduct_w/2,-jww/2,0]) 137 translate([md-fanduct_shell-fanduct_w/2,-jww/2,0])
134 cube(size=[fanduct_shell+fanduct_w/2,jww,od]); 138 cube(size=[fanduct_shell+fanduct_w/2,jww,od]);
135 duct(what=what); 139 duct(what=what);
136 } 140 }
137 translate([0,0,-fanduct_elevation]) sphere(r=.5); 141 translate([0,0,-fanduct_elevation]) sphere(r=.5);
138 } 142 }
139 }else if(what=="out") { 143 }else if(what=="out") {
140 hull() { 144 hull() {
141 render(convexity=4) intersection() { 145 render(convexity=4) intersection() {
142 translate([md-fanduct_w/2-fanduct_shell,-jww/2+fanduct_shell,fanduct_shell]) 146 translate([md-fanduct_w/2-fanduct_shell,-jww/2+fanduct_shell,fanduct_shell])
143 cube(size=[fanduct_w/2+fanduct_shell,jww-2*fanduct_shell,od-2*fanduct_shell]); 147 cube(size=[fanduct_w/2+fanduct_shell,jww-2*fanduct_shell,od-2*fanduct_shell]);
144 duct(what=what); 148 duct(what=what);
145 } 149 }
146 translate([0,0,-fanduct_elevation]) sphere(r=.2); 150 translate([0,0,-fanduct_elevation]) sphere(r=.2);
147 } 151 }
148 } 152 }
149 } 153 }
150 if(what=="in") { 154 if(what=="in") {
151 translate([0,0,-fanduct_elevation-2+epsilon]) 155 translate([0,0,-fanduct_elevation-2+epsilon])
152 cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2); 156 cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2);
153 translate([0,0,-hotend_clearance]) 157 translate([0,0,-hotend_clearance])
154 rotate([0,0,30]) 158 rotate([0,0,30])
155 cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6); 159 cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6);
156 } 160 }
157 } 161 }
158 } 162 }
159 163
160 if(type=="circular") circus(what); 164 if(type=="circular") circus(what);
161 else if(type=="3jets") jets(what); 165 else if(type=="3jets") jets(what);
162 } 166 }
163 167
164 // ***air intake 168 // ***air intake
165 module intake(what) { 169 module intake(what) {
166 module placeit() { 170 module placeit() {
167 translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) 171 translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell])
168 rotate([0,-90,0]) 172 rotate([0,-90,0])
169 children(); 173 children();
170 } 174 }
171 if(what=="in") { 175 if(what=="in") {
172 placeit() translate([0,-inlet_w/2,0]) { 176 placeit() translate([0,-inlet_w/2,0]) {
173 cube(size=[inlet_h,inlet_w,inlet_l+fanduct_shell]); 177 cube(size=[inlet_h,inlet_w,inlet_l+fanduct_shell]);
174 // supports 178 // supports
175 for(i=[-1,0,1]) 179 for(i=[-1,0,1])
176 translate([-fanduct_shell, 180 translate([-fanduct_shell,
177 (i+1)*(inlet_w-extrusion_width)/2, 181 (i+1)*(inlet_w-extrusion_width)/2,
178 -inlet_away-fanduct_w/2]) 182 -inlet_away-fanduct_w/2])
179 cube(size=[fanduct_shell, 183 cube(size=[fanduct_shell,
180 extrusion_width, 184 extrusion_width,
181 inlet_l+fanduct_shell+inlet_away+fanduct_w/2]); 185 inlet_l+fanduct_shell+inlet_away+fanduct_w/2]);
182 } 186 }
183 hull() { 187 hull() {
184 placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) 188 placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0])
185 cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]); 189 cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]);
186 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) 190 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0])
187 translate([0,-inlet_w/2-fanduct_shell/2,0]) 191 translate([0,-inlet_w/2-fanduct_shell/2,0])
188 cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]); 192 cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]);
189 } 193 }
190 }else if(what=="out") { 194 }else if(what=="out") {
191 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) 195 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0])
192 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_l+fanduct_shell+1]); 196 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_l+fanduct_shell+1]);
193 hull() { 197 hull() {
194 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) 198 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0])
195 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]); 199 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]);
196 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) 200 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell])
197 translate([0,-inlet_w/2+fanduct_shell,0]) 201 translate([0,-inlet_w/2+fanduct_shell,0])
198 cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]); 202 cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]);
199 } 203 }
200 } 204 }
201 } 205 }
202 206
203 // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…) 207 // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…)
204 module tails(what) { 208 module tails(what) {
205 if(what=="in") { 209 if(what=="in") {
206 for(mx=[0,1]) mirror([mx,0,0]) 210 for(mx=[0,1]) mirror([mx,0,0])
207 translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2]) 211 translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2])
208 rotate([90,0,90]) 212 rotate([90,0,90])
209 translate([0,0,-snapper_d/2]) 213 translate([0,0,-snapper_d/2])
210 snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell); 214 snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell);
211 } 215 }
212 } 216 }
213 217
214 module parts(what) { 218 module parts(what) {
215 union() { 219 union() {
216 duct(what); 220 duct(what);
217 marks(what); 221 marks(what);
218 output(what); 222 output(what);
219 intake(what); 223 intake(what);
220 tails(what); 224 tails(what);
221 } 225 }
222 } 226 }
223 227
224 difference() { 228 difference() {
225 parts("in"); 229 parts("in");
226 parts("out"); 230 parts("out");
227 } 231 }
228 intersection() { 232 intersection() {
229 union() { 233 union() {
230 output("airguides"); 234 output("airguides");
231 sphere(d=epsilon); 235 sphere(d=epsilon);
232 } 236 }
233 union() { 237 union() {
234 duct("in"); output("in"); intake("in"); 238 duct("in"); output("in"); intake("in");
235 } 239 }
236 } 240 }
237} 241}
238 242
239view="full"; // hcut|vcut|* 243view="full"; // hcut|vcut|*
240 244
241hinfinity=4*(fanduct_ir+fanduct_shell*2+fanduct_w+inlet_away); 245hinfinity=4*(fanduct_ir+fanduct_shell*2+fanduct_w+inlet_away);
242vinfinity=2*(fanduct_shell*2+fanduct_h+inlet_h); 246vinfinity=2*(fanduct_shell*2+fanduct_h+inlet_h);
243if(view=="hcut") { 247if(view=="hcut") {
244 difference() { 248 difference() {
245 fanduct(); 249 fanduct();
246 translate([-hinfinity/2,-hinfinity/2,fanduct_shell+fanduct_h/2]) 250 translate([-hinfinity/2,-hinfinity/2,fanduct_shell+fanduct_h/2])
247 cube(size=[hinfinity,hinfinity,vinfinity]); 251 cube(size=[hinfinity,hinfinity,vinfinity]);
248 } 252 }
249}else if(view=="vcut") { 253}else if(view=="vcut") {
250 difference() { 254 difference() {
251 fanduct(); 255 fanduct();
252 translate([-hinfinity/2,0,-vinfinity/2]) 256 translate([-hinfinity/2,0,-vinfinity/2])
253 cube(size=[hinfinity,hinfinity,vinfinity]); 257 cube(size=[hinfinity,hinfinity,vinfinity]);
254 } 258 }
255}else fanduct(); 259}else fanduct();
256/* vim:set sw=1 ai: */ 260/* vim:set sw=1 ai: */