summaryrefslogtreecommitdiffabout
path: root/fanduct.scad
Unidiff
Diffstat (limited to 'fanduct.scad') (more/less context) (ignore whitespace changes)
-rw-r--r--fanduct.scad4
1 files changed, 2 insertions, 2 deletions
diff --git a/fanduct.scad b/fanduct.scad
index 41048bf..541a037 100644
--- a/fanduct.scad
+++ b/fanduct.scad
@@ -71,180 +71,180 @@ module fanduct(type=type) {
71 translate([xy[0],xy[1],0]) 71 translate([xy[0],xy[1],0])
72 cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); 72 cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6);
73 } 73 }
74 xyxyxy=concat(xyxy,[[0,0]]); 74 xyxyxy=concat(xyxy,[[0,0]]);
75 for(i=[0:1:len(xyxyxy)-2]) 75 for(i=[0:1:len(xyxyxy)-2])
76 hull() for(j=[i,i+1]) pin(xyxyxy[j]); 76 hull() for(j=[i,i+1]) pin(xyxyxy[j]);
77 } 77 }
78 78
79 module circus(what) { 79 module circus(what) {
80 if(what=="in") { 80 if(what=="in") {
81 difference() { 81 difference() {
82 rotate_extrude($fn=smooth_f) 82 rotate_extrude($fn=smooth_f)
83 polygon([ 83 polygon([
84 [0,-fanduct_elevation], 84 [0,-fanduct_elevation],
85 [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], 85 [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2],
86 [fanduct_ir+fanduct_shell+fanduct_w/2,0], 86 [fanduct_ir+fanduct_shell+fanduct_w/2,0],
87 [0,-fanduct_elevation-.1]]); 87 [0,-fanduct_elevation-.1]]);
88 translate([0,0,-1]) 88 translate([0,0,-1])
89 cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); 89 cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f);
90 mirror([0,0,1]) 90 mirror([0,0,1])
91 translate([0,0,-epsilon]) 91 translate([0,0,-epsilon])
92 cylinder(r=fanduct_ir+fanduct_shell+1,h=fanduct_elevation+.1+2); 92 cylinder(r=fanduct_ir+fanduct_shell+1,h=fanduct_elevation+.1+2);
93 } 93 }
94 }else if(what=="out") { 94 }else if(what=="out") {
95 difference() { 95 difference() {
96 rotate_extrude($fn=smooth_f) 96 rotate_extrude($fn=smooth_f)
97 polygon([ 97 polygon([
98 [0,-fanduct_elevation], 98 [0,-fanduct_elevation],
99 [fanduct_ir+fanduct_shell+1,fanduct_h/2], 99 [fanduct_ir+fanduct_shell+1,fanduct_h/2],
100 [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell], 100 [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell],
101 [0,-fanduct_elevation-.1]]); 101 [0,-fanduct_elevation-.1]]);
102 circus("airguides"); 102 circus("airguides");
103 } 103 }
104 }else if(what=="airguides") { 104 }else if(what=="airguides") {
105 inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; 105 inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w;
106 union() { 106 union() {
107 for(my=[0,1]) mirror([0,my,0]) { 107 for(my=[0,1]) mirror([0,my,0]) {
108 guideline([ 108 guideline([
109 [-our,inlet_w/6], 109 [-our,inlet_w/6],
110 [-inr*sin(60),inr*cos(60)] 110 [-inr*sin(60),inr*cos(60)]
111 ]); 111 ]);
112 a0=30; as=15; a1=180; 112 a0=30; as=15; a1=180;
113 for(a=[a0+as:as:a1]) { 113 for(a=[a0+as:as:a1]) {
114 f = as/(a1-a+as); 114 f = as/(a1-a+as);
115 rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); 115 rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]);
116 } 116 }
117 guideline([ 117 guideline([
118 [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], 118 [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4],
119 [-inr*cos(10),inr*sin(10)] 119 [-inr*cos(10),inr*sin(10)]
120 ]); 120 ]);
121 } 121 }
122 }/*union*/ 122 }/*union*/
123 }/*airguides*/ 123 }/*airguides*/
124 } 124 }
125 125
126 module jets(what) { 126 module jets(what) {
127 od = fanduct_h/2+fanduct_shell; 127 od = fanduct_h/2+fanduct_shell;
128 md = fanduct_ir+fanduct_shell+fanduct_w/2; 128 md = fanduct_ir+fanduct_shell+fanduct_w/2;
129 jww = 2*md*sin(jet_angle/2); 129 jww = 2*md*sin(jet_angle/2);
130 render(convexity=8) difference() { 130 render(convexity=8) difference() {
131 for(a=[0:120:359]) rotate([0,0,a]) { 131 for(a=[0:120:359]) rotate([0,0,a]) {
132 if(what=="in") { 132 if(what=="in") {
133 hull() { 133 hull() {
134 render(convexity=4) intersection() { 134 render(convexity=4) intersection() {
135 translate([md-fanduct_shell-fanduct_w/2,-jww/2,0]) 135 translate([md-fanduct_shell-fanduct_w/2,-jww/2,0])
136 cube(size=[fanduct_shell+fanduct_w/2,jww,od]); 136 cube(size=[fanduct_shell+fanduct_w/2,jww,od]);
137 duct(what=what); 137 duct(what=what);
138 } 138 }
139 translate([0,0,-fanduct_elevation]) sphere(r=.5); 139 translate([0,0,-fanduct_elevation]) sphere(r=.5);
140 } 140 }
141 }else if(what=="out") { 141 }else if(what=="out") {
142 hull() { 142 hull() {
143 render(convexity=4) intersection() { 143 render(convexity=4) intersection() {
144 translate([md-fanduct_w/2-fanduct_shell,-jww/2+fanduct_shell,fanduct_shell]) 144 translate([md-fanduct_w/2-fanduct_shell,-jww/2+fanduct_shell,fanduct_shell])
145 cube(size=[fanduct_w/2+fanduct_shell,jww-2*fanduct_shell,od-2*fanduct_shell]); 145 cube(size=[fanduct_w/2+fanduct_shell,jww-2*fanduct_shell,od-2*fanduct_shell]);
146 duct(what=what); 146 duct(what=what);
147 } 147 }
148 translate([0,0,-fanduct_elevation]) sphere(r=.2); 148 translate([0,0,-fanduct_elevation]) sphere(r=.2);
149 } 149 }
150 } 150 }
151 } 151 }
152 if(what=="in") { 152 if(what=="in") {
153 translate([0,0,-fanduct_elevation-2+epsilon]) 153 translate([0,0,-fanduct_elevation-2+epsilon])
154 cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2); 154 cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2);
155 translate([0,0,-hotend_clearance]) 155 translate([0,0,-hotend_clearance])
156 rotate([0,0,30]) 156 rotate([0,0,30])
157 cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6); 157 cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6);
158 } 158 }
159 } 159 }
160 } 160 }
161 161
162 if(type=="circular") circus(what); 162 if(type=="circular") circus(what);
163 else if(type=="3jets") jets(what); 163 else if(type=="3jets") jets(what);
164 } 164 }
165 165
166 // ***air intake 166 // ***air intake
167 module intake(what) { 167 module intake(what) {
168 module placeit() { 168 module placeit() {
169 translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) 169 translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell])
170 rotate([0,-90,0]) 170 rotate([0,-90,0])
171 children(); 171 children();
172 } 172 }
173 if(what=="in") { 173 if(what=="in") {
174 placeit() translate([0,-inlet_w/2,0]) { 174 placeit() translate([0,-inlet_w/2,0]) {
175 cube(size=[inlet_h,inlet_w,inlet_l+fanduct_shell]); 175 cube(size=[inlet_h,inlet_w,inlet_l+fanduct_shell]);
176 // supports 176 // supports
177 for(i=[-1,0,1]) 177 for(i=[-1,0,1])
178 translate([-fanduct_shell, 178 translate([-fanduct_shell,
179 (i+1)*(inlet_w-extrusion_width)/2, 179 (i+1)*(inlet_w-extrusion_width)/2,
180 -inlet_away-fanduct_w/2]) 180 -inlet_away-fanduct_w/2])
181 cube(size=[fanduct_shell, 181 cube(size=[fanduct_shell,
182 extrusion_width, 182 extrusion_width,
183 inlet_l+fanduct_shell+inlet_away+fanduct_w/2]); 183 inlet_l+fanduct_shell+inlet_away+fanduct_w/2]);
184 } 184 }
185 hull() { 185 hull() {
186 placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) 186 placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0])
187 cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]); 187 cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]);
188 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) 188 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0])
189 translate([0,-inlet_w/2-fanduct_shell/2,0]) 189 translate([0,-inlet_w/2-fanduct_shell/2,0])
190 cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]); 190 cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]);
191 } 191 }
192 }else if(what=="out") { 192 }else if(what=="out") {
193 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) 193 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0])
194 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_l+fanduct_shell+1]); 194 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_l+fanduct_shell+1]);
195 hull() { 195 hull() {
196 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) 196 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0])
197 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]); 197 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]);
198 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) 198 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell])
199 translate([0,-inlet_w/2,0]) 199 translate([0,-inlet_w/2+fanduct_shell,0])
200 cube(size=[1,inlet_w,fanduct_h]); 200 cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]);
201 } 201 }
202 } 202 }
203 } 203 }
204 204
205 // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…) 205 // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…)
206 module tails(what) { 206 module tails(what) {
207 if(what=="in") { 207 if(what=="in") {
208 for(mx=[0,1]) mirror([mx,0,0]) 208 for(mx=[0,1]) mirror([mx,0,0])
209 translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2]) 209 translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2])
210 rotate([90,0,90]) 210 rotate([90,0,90])
211 translate([0,0,-snapper_d/2]) 211 translate([0,0,-snapper_d/2])
212 snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell); 212 snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell);
213 } 213 }
214 } 214 }
215 215
216 module parts(what) { 216 module parts(what) {
217 union() { 217 union() {
218 duct(what); 218 duct(what);
219 marks(what); 219 marks(what);
220 output(what); 220 output(what);
221 intake(what); 221 intake(what);
222 tails(what); 222 tails(what);
223 } 223 }
224 } 224 }
225 225
226 difference() { 226 difference() {
227 parts("in"); 227 parts("in");
228 parts("out"); 228 parts("out");
229 } 229 }
230 230
231} 231}
232 232
233view="full"; // hcut|vcut|* 233view="full"; // hcut|vcut|*
234 234
235hinfinity=4*(fanduct_ir+fanduct_shell*2+fanduct_w+inlet_away); 235hinfinity=4*(fanduct_ir+fanduct_shell*2+fanduct_w+inlet_away);
236vinfinity=2*(fanduct_shell*2+fanduct_h+inlet_h); 236vinfinity=2*(fanduct_shell*2+fanduct_h+inlet_h);
237if(view=="hcut") { 237if(view=="hcut") {
238 difference() { 238 difference() {
239 fanduct(); 239 fanduct();
240 translate([-hinfinity/2,-hinfinity/2,fanduct_shell+fanduct_h/2]) 240 translate([-hinfinity/2,-hinfinity/2,fanduct_shell+fanduct_h/2])
241 cube(size=[hinfinity,hinfinity,vinfinity]); 241 cube(size=[hinfinity,hinfinity,vinfinity]);
242 } 242 }
243}else if(view=="vcut") { 243}else if(view=="vcut") {
244 difference() { 244 difference() {
245 fanduct(); 245 fanduct();
246 translate([-hinfinity/2,0,-vinfinity/2]) 246 translate([-hinfinity/2,0,-vinfinity/2])
247 cube(size=[hinfinity,hinfinity,vinfinity]); 247 cube(size=[hinfinity,hinfinity,vinfinity]);
248 } 248 }
249}else fanduct(); 249}else fanduct();
250/* vim:set sw=1 ai: */ 250/* vim:set sw=1 ai: */