-rw-r--r-- | fanduct.scad | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fanduct.scad b/fanduct.scad index 421dd5a..975f1cc 100644 --- a/fanduct.scad +++ b/fanduct.scad | |||
@@ -1,213 +1,213 @@ | |||
1 | use <snapper.scad>; | 1 | use <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 | function hypothenuse(a,b) = sqrt(pow(a,2)+pow(b,2)); | 6 | function hypothenuse(a,b) = sqrt(pow(a,2)+pow(b,2)); |
7 | 7 | ||
8 | silicone_shell = 2; | 8 | silicone_shell = 2; |
9 | heater_clearance = max( | 9 | heater_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; // 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 | ||
28 | hotend_clearance = 12; | 28 | hotend_clearance = 12; |
29 | 29 | ||
30 | snapper_d = 8; snapper_overlap=0.2;// snip snap | 30 | snapper_d = 8; snapper_overlap=0.2;// snip snap |
31 | 31 | ||
32 | smooth_f = 120; | 32 | smooth_f = 120; |
33 | 33 | ||
34 | type="3jets"; // "3jets" ; // circular|3jets | 34 | type="3jets"; // "3jets" ; // circular|3jets |
35 | 35 | ||
36 | 36 | ||
37 | module fanduct(type=type) { | 37 | module fanduct(type=type) { |
38 | 38 | ||
39 | // ***duct is all around! | 39 | // ***duct is all around! |
40 | module duct(what) { | 40 | module duct(what) { |
41 | if(what=="in") { | 41 | if(what=="in") { |
42 | 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; |
43 | smax = max(sh,sv); | 43 | smax = max(sh,sv); |
44 | rotate_extrude($fn=smooth_f) | 44 | rotate_extrude($fn=smooth_f) |
45 | translate([sh/2+fanduct_ir,sv/2]) | 45 | translate([sh/2+fanduct_ir,sv/2]) |
46 | scale([sh/smax,sv/smax]) | 46 | scale([sh/smax,sv/smax]) |
47 | circle(d=smax,$fn=4*smax); | 47 | circle(d=smax,$fn=4*smax); |
48 | }else if(what=="out") { | 48 | }else if(what=="out") { |
49 | sh = fanduct_w; sv = fanduct_h; | 49 | sh = fanduct_w; sv = fanduct_h; |
50 | smax = max(sh,sv); | 50 | smax = max(sh,sv); |
51 | rotate_extrude($fn=smooth_f) | 51 | rotate_extrude($fn=smooth_f) |
52 | translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) | 52 | translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) |
53 | scale([sh/smax,sv/smax]) | 53 | scale([sh/smax,sv/smax]) |
54 | circle(d=smax,$fn=4*smax); | 54 | circle(d=smax,$fn=4*smax); |
55 | } | 55 | } |
56 | } | 56 | } |
57 | 57 | ||
58 | // ***bumps for easier position adjustments in line with hotend | 58 | // ***bumps for easier position adjustments in line with hotend |
59 | module marks(what) { | 59 | module marks(what) { |
60 | if(what=="in") { | 60 | if(what=="in") { |
61 | for(y=[-1,1]) | 61 | for(y=[-1,1]) |
62 | hull() for(z=[0,-fanduct_shell-fanduct_h/2]) | 62 | 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]) | 63 | translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) |
64 | rotate([90,0,0]) { | 64 | rotate([90,0,0]) { |
65 | cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); | 65 | cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); |
66 | for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) | 66 | for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) |
67 | sphere(r=fanduct_shell,$fn=30); | 67 | sphere(r=fanduct_shell,$fn=30); |
68 | } | 68 | } |
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | // ***output | 72 | // ***output |
73 | module output(what,type=type) { | 73 | module output(what,type=type) { |
74 | module guideline(xyxy) { | 74 | module guideline(xyxy) { |
75 | module pin(xy) { | 75 | module pin(xy) { |
76 | translate([xy[0],xy[1],0]) | 76 | translate([xy[0],xy[1],0]) |
77 | 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); |
78 | } | 78 | } |
79 | xyxyxy=concat(xyxy,[[0,0]]); | 79 | xyxyxy=concat(xyxy,[[0,0]]); |
80 | for(i=[0:1:len(xyxyxy)-2]) | 80 | for(i=[0:1:len(xyxyxy)-2]) |
81 | hull() for(j=[i,i+1]) pin(xyxyxy[j]); | 81 | hull() for(j=[i,i+1]) pin(xyxyxy[j]); |
82 | } | 82 | } |
83 | 83 | ||
84 | module circus(what) { | 84 | module circus(what) { |
85 | if(what=="in") { | 85 | if(what=="in") { |
86 | difference() { | 86 | difference() { |
87 | rotate_extrude($fn=smooth_f) | 87 | rotate_extrude($fn=smooth_f) |
88 | polygon([ | 88 | polygon([ |
89 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], | 89 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], |
90 | [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], | 90 | [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], |
91 | [fanduct_ir+fanduct_shell+fanduct_w/2,0], | 91 | [fanduct_ir+fanduct_shell+fanduct_w/2,0], |
92 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); | 92 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); |
93 | translate([0,0,-1]) | 93 | translate([0,0,-1]) |
94 | 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); |
95 | mirror([0,0,1]) | 95 | mirror([0,0,1]) |
96 | translate([0,0,-epsilon]) | 96 | translate([0,0,-epsilon]) |
97 | 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); |
98 | } | 98 | } |
99 | }else if(what=="out") { | 99 | }else if(what=="out") { |
100 | rotate_extrude($fn=smooth_f) | 100 | rotate_extrude($fn=smooth_f) |
101 | polygon([ | 101 | polygon([ |
102 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], | 102 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], |
103 | [fanduct_ir+fanduct_shell+1,fanduct_h/2], | 103 | [fanduct_ir+fanduct_shell+1,fanduct_h/2], |
104 | [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell], | 104 | [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell], |
105 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); | 105 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); |
106 | }else if(what=="airguides") { | 106 | }else if(what=="airguides") { |
107 | inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; | 107 | inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; |
108 | union() { | 108 | union() { |
109 | for(my=[0,1]) mirror([0,my,0]) { | 109 | for(my=[0,1]) mirror([0,my,0]) { |
110 | guideline([ | 110 | guideline([ |
111 | [-our,inlet_w/6], | 111 | [-our,inlet_w/6], |
112 | [-inr*sin(60),inr*cos(60)] | 112 | [-inr*sin(60),inr*cos(60)] |
113 | ]); | 113 | ]); |
114 | a0=30; as=15; a1=180; | 114 | a0=30; as=15; a1=180; |
115 | for(a=[a0+as:as:a1]) { | 115 | for(a=[a0+as:as:a1]) { |
116 | f = as/(a1-a+as); | 116 | f = as/(a1-a+as); |
117 | rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); | 117 | rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); |
118 | } | 118 | } |
119 | guideline([ | 119 | guideline([ |
120 | [-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], |
121 | [-inr*cos(10),inr*sin(10)] | 121 | [-inr*cos(10),inr*sin(10)] |
122 | ]); | 122 | ]); |
123 | } | 123 | } |
124 | }/*union*/ | 124 | }/*union*/ |
125 | }/*airguides*/ | 125 | }/*airguides*/ |
126 | } | 126 | } |
127 | 127 | ||
128 | module jets(what) { | 128 | module jets(what) { |
129 | od = fanduct_h/2+fanduct_shell; | 129 | od = fanduct_h/2+fanduct_shell; |
130 | md = fanduct_ir+fanduct_shell+fanduct_w/2; | 130 | md = fanduct_ir+fanduct_shell+fanduct_w/2; |
131 | jww = 2*md*sin(jet_angle/2); | 131 | jww = 2*md*sin(jet_angle/2); |
132 | render(convexity=8) difference() { | 132 | render(convexity=8) difference() { |
133 | for(a=[0:120:359]) rotate([0,0,a]) { | 133 | for(a=[0:120:359]) rotate([0,0,a]) { |
134 | if(what=="in") { | 134 | if(what=="in") { |
135 | hull() { | 135 | hull() { |
136 | render(convexity=4) intersection() { | 136 | render(convexity=4) intersection() { |
137 | translate([md-fanduct_shell-fanduct_w/2,-jww/2,0]) | 137 | translate([md-fanduct_shell-fanduct_w/2,-jww/2,0]) |
138 | cube(size=[fanduct_shell+fanduct_w/2,jww,od]); | 138 | cube(size=[fanduct_shell+fanduct_w/2,jww,od]); |
139 | duct(what=what); | 139 | duct(what=what); |
140 | } | 140 | } |
141 | translate([0,0,-fanduct_elevation]) sphere(r=.5); | 141 | translate([0,0,-fanduct_elevation]) sphere(r=.5); |
142 | } | 142 | } |
143 | }else if(what=="out") { | 143 | }else if(what=="out") { |
144 | hull() { | 144 | hull() { |
145 | render(convexity=4) intersection() { | 145 | render(convexity=4) intersection() { |
146 | 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]) |
147 | 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]); |
148 | duct(what=what); | 148 | duct(what=what); |
149 | } | 149 | } |
150 | translate([0,0,-fanduct_elevation]) sphere(r=.2); | 150 | translate([0,0,-fanduct_elevation]) sphere(r=.2); |
151 | } | 151 | } |
152 | } | 152 | } |
153 | } | 153 | } |
154 | if(what=="in") { | 154 | if(what=="in") { |
155 | translate([0,0,-fanduct_elevation-2+epsilon]) | 155 | translate([0,0,-fanduct_elevation-2+epsilon]) |
156 | 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); |
157 | translate([0,0,-hotend_clearance]) | 157 | translate([0,0,-hotend_clearance]) |
158 | rotate([0,0,30]) | 158 | rotate([0,0,30]) |
159 | 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); |
160 | } | 160 | } |
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | if(type=="circular") circus(what); | 164 | if(type=="circular") circus(what); |
165 | else if(type=="3jets") jets(what); | 165 | else if(type=="3jets") jets(what); |
166 | } | 166 | } |
167 | 167 | ||
168 | // ***air intake | 168 | // ***air intake |
169 | module intake(what) { | 169 | module intake(what) { |
170 | module placeit() { | 170 | module placeit() { |
171 | 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]) |
172 | rotate([0,-90,0]) | 172 | rotate([0,-90,0]) |
173 | children(); | 173 | children(); |
174 | } | 174 | } |
175 | if(what=="in") { | 175 | if(what=="in") { |
176 | placeit() translate([0,-inlet_w/2,0]) { | 176 | placeit() translate([0,-inlet_w/2,0]) { |
177 | cube(size=[inlet_h,inlet_w,inlet_l+fanduct_shell]); | 177 | cube(size=[inlet_h,inlet_w,inlet_l+fanduct_shell]); |
178 | // supports | 178 | // supports |
179 | for(i=[-1,0,1]) | 179 | for(i=[-1,0,1]) |
180 | translate([-fanduct_shell, | 180 | translate([-fanduct_shell, |
181 | (i+1)*(inlet_w-extrusion_width)/2, | 181 | (i+1)*(inlet_w-extrusion_width)/2, |
182 | -inlet_away-fanduct_w/2]) | 182 | -inlet_away-fanduct_w/2]) |
183 | cube(size=[fanduct_shell, | 183 | cube(size=[fanduct_shell, |
184 | extrusion_width, | 184 | extrusion_width, |
185 | inlet_l+fanduct_shell+inlet_away+fanduct_w/2]); | 185 | inlet_l+fanduct_shell+inlet_away+fanduct_w/2]); |
186 | } | 186 | } |
187 | hull() { | 187 | hull() { |
188 | placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) | 188 | placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) |
189 | 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]); |
190 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) | 190 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) |
191 | translate([0,-inlet_w/2-fanduct_shell/2,0]) | 191 | translate([0,-inlet_w/2-fanduct_shell/2,0]) |
192 | 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]); |
193 | } | 193 | } |
194 | }else if(what=="out") { | 194 | }else if(what=="out") { |
195 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) | 195 | 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]); | 196 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_l+fanduct_shell+1]); |
197 | hull() { | 197 | hull() { |
198 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) | 198 | 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]); | 199 | 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]) | 200 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) |
201 | translate([0,-inlet_w/2+fanduct_shell,0]) | 201 | translate([0,-inlet_w/2+fanduct_shell,0]) |
202 | cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]); | 202 | cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]); |
203 | } | 203 | } |
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
207 | // ***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…) |
208 | module tails(what) { | 208 | module tails(what) { |
209 | if(what=="in") { | 209 | if(what=="in") { |
210 | for(mx=[0,1]) mirror([mx,0,0]) | 210 | for(mx=[0,1]) mirror([mx,0,0]) |
211 | 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]) |
212 | rotate([90,0,90]) | 212 | rotate([90,0,90]) |
213 | translate([0,0,-snapper_d/2]) | 213 | translate([0,0,-snapper_d/2]) |