summaryrefslogtreecommitdiffabout
path: root/fanduct.scad
authorMichael Krelin <hacker@klever.net>2016-05-30 22:59:06 (UTC)
committer Michael Krelin <hacker@klever.net>2016-05-30 22:59:06 (UTC)
commit045e95f7882a47bd5dc017705f6743a61e6a5214 (patch) (unidiff)
treea9ae1e95ef98e825d67bb5057f3b46a1a312c8ec /fanduct.scad
parent6710a3a6d827f828c69d782450e02432ee1f0aa2 (diff)
downloadfanductory-045e95f7882a47bd5dc017705f6743a61e6a5214.zip
fanductory-045e95f7882a47bd5dc017705f6743a61e6a5214.tar.gz
fanductory-045e95f7882a47bd5dc017705f6743a61e6a5214.tar.bz2
fix airguides generation
Diffstat (limited to 'fanduct.scad') (more/less context) (ignore whitespace changes)
-rw-r--r--fanduct.scad22
1 files changed, 12 insertions, 10 deletions
diff --git a/fanduct.scad b/fanduct.scad
index 541a037..b8994d4 100644
--- a/fanduct.scad
+++ b/fanduct.scad
@@ -47,105 +47,102 @@ module fanduct(type=type) {
47 translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) 47 translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell])
48 scale([sh/smax,sv/smax]) 48 scale([sh/smax,sv/smax])
49 circle(d=smax,$fn=4*smax); 49 circle(d=smax,$fn=4*smax);
50 } 50 }
51 } 51 }
52 52
53 // ***bumps for easier position adjustments in line with hotend 53 // ***bumps for easier position adjustments in line with hotend
54 module marks(what) { 54 module marks(what) {
55 if(what=="in") { 55 if(what=="in") {
56 for(y=[-1,1]) 56 for(y=[-1,1])
57 hull() for(z=[0,-fanduct_shell-fanduct_h/2]) 57 hull() for(z=[0,-fanduct_shell-fanduct_h/2])
58 translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) 58 translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z])
59 rotate([90,0,0]) { 59 rotate([90,0,0]) {
60 cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); 60 cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30);
61 for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) 61 for(z=[-1,1]) translate([0,0,z*fanduct_w/2])
62 sphere(r=fanduct_shell,$fn=30); 62 sphere(r=fanduct_shell,$fn=30);
63 } 63 }
64 } 64 }
65 } 65 }
66 66
67 // ***output 67 // ***output
68 module output(what,type=type) { 68 module output(what,type=type) {
69 module guideline(xyxy) { 69 module guideline(xyxy) {
70 module pin(xy) { 70 module pin(xy) {
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 rotate_extrude($fn=smooth_f)
96 rotate_extrude($fn=smooth_f) 96 polygon([
97 polygon([ 97 [0,-fanduct_elevation],
98 [0,-fanduct_elevation], 98 [fanduct_ir+fanduct_shell+1,fanduct_h/2],
99 [fanduct_ir+fanduct_shell+1,fanduct_h/2], 99 [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell],
100 [fanduct_ir+fanduct_w/2+fanduct_shell+1,fanduct_shell], 100 [0,-fanduct_elevation-.1]]);
101 [0,-fanduct_elevation-.1]]);
102 circus("airguides");
103 }
104 }else if(what=="airguides") { 101 }else if(what=="airguides") {
105 inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; 102 inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w;
106 union() { 103 union() {
107 for(my=[0,1]) mirror([0,my,0]) { 104 for(my=[0,1]) mirror([0,my,0]) {
108 guideline([ 105 guideline([
109 [-our,inlet_w/6], 106 [-our,inlet_w/6],
110 [-inr*sin(60),inr*cos(60)] 107 [-inr*sin(60),inr*cos(60)]
111 ]); 108 ]);
112 a0=30; as=15; a1=180; 109 a0=30; as=15; a1=180;
113 for(a=[a0+as:as:a1]) { 110 for(a=[a0+as:as:a1]) {
114 f = as/(a1-a+as); 111 f = as/(a1-a+as);
115 rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); 112 rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]);
116 } 113 }
117 guideline([ 114 guideline([
118 [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], 115 [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4],
119 [-inr*cos(10),inr*sin(10)] 116 [-inr*cos(10),inr*sin(10)]
120 ]); 117 ]);
121 } 118 }
122 }/*union*/ 119 }/*union*/
123 }/*airguides*/ 120 }/*airguides*/
124 } 121 }
125 122
126 module jets(what) { 123 module jets(what) {
127 od = fanduct_h/2+fanduct_shell; 124 od = fanduct_h/2+fanduct_shell;
128 md = fanduct_ir+fanduct_shell+fanduct_w/2; 125 md = fanduct_ir+fanduct_shell+fanduct_w/2;
129 jww = 2*md*sin(jet_angle/2); 126 jww = 2*md*sin(jet_angle/2);
130 render(convexity=8) difference() { 127 render(convexity=8) difference() {
131 for(a=[0:120:359]) rotate([0,0,a]) { 128 for(a=[0:120:359]) rotate([0,0,a]) {
132 if(what=="in") { 129 if(what=="in") {
133 hull() { 130 hull() {
134 render(convexity=4) intersection() { 131 render(convexity=4) intersection() {
135 translate([md-fanduct_shell-fanduct_w/2,-jww/2,0]) 132 translate([md-fanduct_shell-fanduct_w/2,-jww/2,0])
136 cube(size=[fanduct_shell+fanduct_w/2,jww,od]); 133 cube(size=[fanduct_shell+fanduct_w/2,jww,od]);
137 duct(what=what); 134 duct(what=what);
138 } 135 }
139 translate([0,0,-fanduct_elevation]) sphere(r=.5); 136 translate([0,0,-fanduct_elevation]) sphere(r=.5);
140 } 137 }
141 }else if(what=="out") { 138 }else if(what=="out") {
142 hull() { 139 hull() {
143 render(convexity=4) intersection() { 140 render(convexity=4) intersection() {
144 translate([md-fanduct_w/2-fanduct_shell,-jww/2+fanduct_shell,fanduct_shell]) 141 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]); 142 cube(size=[fanduct_w/2+fanduct_shell,jww-2*fanduct_shell,od-2*fanduct_shell]);
146 duct(what=what); 143 duct(what=what);
147 } 144 }
148 translate([0,0,-fanduct_elevation]) sphere(r=.2); 145 translate([0,0,-fanduct_elevation]) sphere(r=.2);
149 } 146 }
150 } 147 }
151 } 148 }
@@ -182,69 +179,74 @@ module fanduct(type=type) {
182 extrusion_width, 179 extrusion_width,
183 inlet_l+fanduct_shell+inlet_away+fanduct_w/2]); 180 inlet_l+fanduct_shell+inlet_away+fanduct_w/2]);
184 } 181 }
185 hull() { 182 hull() {
186 placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) 183 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]); 184 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]) 185 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0])
189 translate([0,-inlet_w/2-fanduct_shell/2,0]) 186 translate([0,-inlet_w/2-fanduct_shell/2,0])
190 cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]); 187 cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]);
191 } 188 }
192 }else if(what=="out") { 189 }else if(what=="out") {
193 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) 190 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]); 191 cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_l+fanduct_shell+1]);
195 hull() { 192 hull() {
196 placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) 193 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]); 194 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]) 195 translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell])
199 translate([0,-inlet_w/2+fanduct_shell,0]) 196 translate([0,-inlet_w/2+fanduct_shell,0])
200 cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]); 197 cube(size=[1,inlet_w-2*fanduct_shell,fanduct_h]);
201 } 198 }
202 } 199 }
203 } 200 }
204 201
205 // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…) 202 // ***DUCT TAILS!!! WOO-OO! (every day they're out there making duct tails…)
206 module tails(what) { 203 module tails(what) {
207 if(what=="in") { 204 if(what=="in") {
208 for(mx=[0,1]) mirror([mx,0,0]) 205 for(mx=[0,1]) mirror([mx,0,0])
209 translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2]) 206 translate([fanduct_ir+fanduct_shell+fanduct_w/2,0,fanduct_shell+fanduct_h/2])
210 rotate([90,0,90]) 207 rotate([90,0,90])
211 translate([0,0,-snapper_d/2]) 208 translate([0,0,-snapper_d/2])
212 snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell); 209 snapper(d=snapper_d,o=snapper_overlap,side=0,l=fanduct_h*3/2+fanduct_shell);
213 } 210 }
214 } 211 }
215 212
216 module parts(what) { 213 module parts(what) {
217 union() { 214 union() {
218 duct(what); 215 duct(what);
219 marks(what); 216 marks(what);
220 output(what); 217 output(what);
221 intake(what); 218 intake(what);
222 tails(what); 219 tails(what);
223 } 220 }
224 } 221 }
225 222
226 difference() { 223 difference() {
227 parts("in"); 224 parts("in");
228 parts("out"); 225 parts("out");
229 } 226 }
230 227 intersection() {
228 output("airguides");
229 union() {
230 duct("in"); output("in"); intake("in");
231 }
232 }
231} 233}
232 234
233view="full"; // hcut|vcut|* 235view="full"; // hcut|vcut|*
234 236
235hinfinity=4*(fanduct_ir+fanduct_shell*2+fanduct_w+inlet_away); 237hinfinity=4*(fanduct_ir+fanduct_shell*2+fanduct_w+inlet_away);
236vinfinity=2*(fanduct_shell*2+fanduct_h+inlet_h); 238vinfinity=2*(fanduct_shell*2+fanduct_h+inlet_h);
237if(view=="hcut") { 239if(view=="hcut") {
238 difference() { 240 difference() {
239 fanduct(); 241 fanduct();
240 translate([-hinfinity/2,-hinfinity/2,fanduct_shell+fanduct_h/2]) 242 translate([-hinfinity/2,-hinfinity/2,fanduct_shell+fanduct_h/2])
241 cube(size=[hinfinity,hinfinity,vinfinity]); 243 cube(size=[hinfinity,hinfinity,vinfinity]);
242 } 244 }
243}else if(view=="vcut") { 245}else if(view=="vcut") {
244 difference() { 246 difference() {
245 fanduct(); 247 fanduct();
246 translate([-hinfinity/2,0,-vinfinity/2]) 248 translate([-hinfinity/2,0,-vinfinity/2])
247 cube(size=[hinfinity,hinfinity,vinfinity]); 249 cube(size=[hinfinity,hinfinity,vinfinity]);
248 } 250 }
249}else fanduct(); 251}else fanduct();
250/* vim:set sw=1 ai: */ 252/* vim:set sw=1 ai: */