-rw-r--r-- | fanduct.scad | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fanduct.scad b/fanduct.scad index 7fc1ff4..f4bb705 100644 --- a/fanduct.scad +++ b/fanduct.scad | |||
@@ -1,196 +1,197 @@ | |||
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 | heater_w = 16; // heatblock width | 6 | heater_w = 16; // heatblock width |
7 | heater_l = 20; // heatblock length | 7 | heater_l = 20; // heatblock length |
8 | nozzle_offset=4.5;// nozzle offset from the edge of heatblock | 8 | nozzle_offset=4.5;// nozzle offset from the edge of heatblock |
9 | 9 | ||
10 | fanduct_elevation = 3; // fanduct elevation above nozzle tip | 10 | fanduct_elevation = 3; // fanduct elevation above nozzle tip |
11 | fanduct_blowtarget = -2; // what to blow at | ||
11 | fanduct_h = 6; // inner height of the duct | 12 | fanduct_h = 6; // inner height of the duct |
12 | fanduct_w = 7; // inner width of the duct | 13 | fanduct_w = 7; // inner width of the duct |
13 | fanduct_shell=1.2; // shell thickness | 14 | fanduct_shell=1.2; // shell thickness |
14 | fanduct_ir = sqrt(pow(heater_w/2,2)+pow(heater_l-nozzle_offset,2))+5;// inner radius | 15 | fanduct_ir = sqrt(pow(heater_w/2,2)+pow(heater_l-nozzle_offset,2))+5;// inner radius |
15 | 16 | ||
16 | jet_angle = 60; // angular width of the jet | 17 | jet_angle = 60; // angular width of the jet |
17 | 18 | ||
18 | inlet_w = 12.5; // inlet width | 19 | inlet_w = 12.5; // inlet width |
19 | inlet_h = 17; // inlet height | 20 | inlet_h = 17; // inlet height |
20 | inlet_l = 7; // inlet length of protrusion (or depth of intrusion:)) | 21 | inlet_l = 7; // inlet length of protrusion (or depth of intrusion:)) |
21 | inlet_away = 15;// how far away inlet is | 22 | inlet_away = 15;// how far away inlet is |
22 | 23 | ||
23 | hotend_clearance = 12; | 24 | hotend_clearance = 12; |
24 | 25 | ||
25 | snapper_d = 8; snapper_overlap=0.2;// snip snap | 26 | snapper_d = 8; snapper_overlap=0.2;// snip snap |
26 | 27 | ||
27 | smooth_f = 120; | 28 | smooth_f = 120; |
28 | 29 | ||
29 | type="3jets"; // "3jets" ; // circular|3jets | 30 | type="3jets"; // "3jets" ; // circular|3jets |
30 | 31 | ||
31 | 32 | ||
32 | module fanduct(type=type) { | 33 | module fanduct(type=type) { |
33 | 34 | ||
34 | // ***duct is all around! | 35 | // ***duct is all around! |
35 | module duct(what) { | 36 | module duct(what) { |
36 | if(what=="in") { | 37 | if(what=="in") { |
37 | sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; | 38 | sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; |
38 | smax = max(sh,sv); | 39 | smax = max(sh,sv); |
39 | rotate_extrude($fn=smooth_f) | 40 | rotate_extrude($fn=smooth_f) |
40 | translate([sh/2+fanduct_ir,sv/2]) | 41 | translate([sh/2+fanduct_ir,sv/2]) |
41 | scale([sh/smax,sv/smax]) | 42 | scale([sh/smax,sv/smax]) |
42 | circle(d=smax,$fn=4*smax); | 43 | circle(d=smax,$fn=4*smax); |
43 | }else if(what=="out") { | 44 | }else if(what=="out") { |
44 | sh = fanduct_w; sv = fanduct_h; | 45 | sh = fanduct_w; sv = fanduct_h; |
45 | smax = max(sh,sv); | 46 | smax = max(sh,sv); |
46 | rotate_extrude($fn=smooth_f) | 47 | rotate_extrude($fn=smooth_f) |
47 | translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) | 48 | translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) |
48 | scale([sh/smax,sv/smax]) | 49 | scale([sh/smax,sv/smax]) |
49 | circle(d=smax,$fn=4*smax); | 50 | circle(d=smax,$fn=4*smax); |
50 | } | 51 | } |
51 | } | 52 | } |
52 | 53 | ||
53 | // ***bumps for easier position adjustments in line with hotend | 54 | // ***bumps for easier position adjustments in line with hotend |
54 | module marks(what) { | 55 | module marks(what) { |
55 | if(what=="in") { | 56 | if(what=="in") { |
56 | for(y=[-1,1]) | 57 | for(y=[-1,1]) |
57 | hull() for(z=[0,-fanduct_shell-fanduct_h/2]) | 58 | 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]) | 59 | translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) |
59 | rotate([90,0,0]) { | 60 | rotate([90,0,0]) { |
60 | cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); | 61 | cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); |
61 | for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) | 62 | for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) |
62 | sphere(r=fanduct_shell,$fn=30); | 63 | sphere(r=fanduct_shell,$fn=30); |
63 | } | 64 | } |
64 | } | 65 | } |
65 | } | 66 | } |
66 | 67 | ||
67 | // ***output | 68 | // ***output |
68 | module output(what,type=type) { | 69 | module output(what,type=type) { |
69 | module guideline(xyxy) { | 70 | module guideline(xyxy) { |
70 | module pin(xy) { | 71 | module pin(xy) { |
71 | translate([xy[0],xy[1],0]) | 72 | translate([xy[0],xy[1],0]) |
72 | cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); | 73 | cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); |
73 | } | 74 | } |
74 | xyxyxy=concat(xyxy,[[0,0]]); | 75 | xyxyxy=concat(xyxy,[[0,0]]); |
75 | for(i=[0:1:len(xyxyxy)-2]) | 76 | for(i=[0:1:len(xyxyxy)-2]) |
76 | hull() for(j=[i,i+1]) pin(xyxyxy[j]); | 77 | hull() for(j=[i,i+1]) pin(xyxyxy[j]); |
77 | } | 78 | } |
78 | 79 | ||
79 | module circus(what) { | 80 | module circus(what) { |
80 | if(what=="in") { | 81 | if(what=="in") { |
81 | difference() { | 82 | difference() { |
82 | rotate_extrude($fn=smooth_f) | 83 | rotate_extrude($fn=smooth_f) |
83 | polygon([ | 84 | polygon([ |
84 | [0,-fanduct_elevation], | 85 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], |
85 | [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], | 86 | [fanduct_ir+fanduct_shell,fanduct_shell+fanduct_h/2], |
86 | [fanduct_ir+fanduct_shell+fanduct_w/2,0], | 87 | [fanduct_ir+fanduct_shell+fanduct_w/2,0], |
87 | [0,-fanduct_elevation-.1]]); | 88 | [0,-fanduct_elevation+fanduct_blowtarget-epsilon]]); |
88 | translate([0,0,-1]) | 89 | translate([0,0,-1]) |
89 | cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); | 90 | cylinder(r=hotend_clearance,h=fanduct_h+2*fanduct_shell+2,$fn=smooth_f); |
90 | mirror([0,0,1]) | 91 | mirror([0,0,1]) |
91 | translate([0,0,-epsilon]) | 92 | translate([0,0,-epsilon]) |
92 | cylinder(r=fanduct_ir+fanduct_shell+1,h=fanduct_elevation+.1+2); | 93 | cylinder(r=fanduct_ir+fanduct_shell+1,h=fanduct_elevation+.1+2); |
93 | } | 94 | } |
94 | }else if(what=="out") { | 95 | }else if(what=="out") { |
95 | rotate_extrude($fn=smooth_f) | 96 | rotate_extrude($fn=smooth_f) |
96 | polygon([ | 97 | polygon([ |
97 | [0,-fanduct_elevation], | 98 | [0,-fanduct_elevation+fanduct_blowtarget+epsilon], |
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+fanduct_blowtarget-epsilon]]); |
101 | }else if(what=="airguides") { | 102 | }else if(what=="airguides") { |
102 | inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; | 103 | inr = fanduct_ir+fanduct_shell; our = inr+fanduct_w; |
103 | union() { | 104 | union() { |
104 | for(my=[0,1]) mirror([0,my,0]) { | 105 | for(my=[0,1]) mirror([0,my,0]) { |
105 | guideline([ | 106 | guideline([ |
106 | [-our,inlet_w/6], | 107 | [-our,inlet_w/6], |
107 | [-inr*sin(60),inr*cos(60)] | 108 | [-inr*sin(60),inr*cos(60)] |
108 | ]); | 109 | ]); |
109 | a0=30; as=15; a1=180; | 110 | a0=30; as=15; a1=180; |
110 | for(a=[a0+as:as:a1]) { | 111 | for(a=[a0+as:as:a1]) { |
111 | f = as/(a1-a+as); | 112 | f = as/(a1-a+as); |
112 | rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); | 113 | rotate([0,0,a]) guideline([[-inr-fanduct_w*f,0]]); |
113 | } | 114 | } |
114 | guideline([ | 115 | guideline([ |
115 | [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], | 116 | [-our+fanduct_w*cos(30)*3/4,fanduct_w*sin(30)*3/4], |
116 | [-inr*cos(10),inr*sin(10)] | 117 | [-inr*cos(10),inr*sin(10)] |
117 | ]); | 118 | ]); |
118 | } | 119 | } |
119 | }/*union*/ | 120 | }/*union*/ |
120 | }/*airguides*/ | 121 | }/*airguides*/ |
121 | } | 122 | } |
122 | 123 | ||
123 | module jets(what) { | 124 | module jets(what) { |
124 | od = fanduct_h/2+fanduct_shell; | 125 | od = fanduct_h/2+fanduct_shell; |
125 | md = fanduct_ir+fanduct_shell+fanduct_w/2; | 126 | md = fanduct_ir+fanduct_shell+fanduct_w/2; |
126 | jww = 2*md*sin(jet_angle/2); | 127 | jww = 2*md*sin(jet_angle/2); |
127 | render(convexity=8) difference() { | 128 | render(convexity=8) difference() { |
128 | for(a=[0:120:359]) rotate([0,0,a]) { | 129 | for(a=[0:120:359]) rotate([0,0,a]) { |
129 | if(what=="in") { | 130 | if(what=="in") { |
130 | hull() { | 131 | hull() { |
131 | render(convexity=4) intersection() { | 132 | render(convexity=4) intersection() { |
132 | translate([md-fanduct_shell-fanduct_w/2,-jww/2,0]) | 133 | translate([md-fanduct_shell-fanduct_w/2,-jww/2,0]) |
133 | cube(size=[fanduct_shell+fanduct_w/2,jww,od]); | 134 | cube(size=[fanduct_shell+fanduct_w/2,jww,od]); |
134 | duct(what=what); | 135 | duct(what=what); |
135 | } | 136 | } |
136 | translate([0,0,-fanduct_elevation]) sphere(r=.5); | 137 | translate([0,0,-fanduct_elevation]) sphere(r=.5); |
137 | } | 138 | } |
138 | }else if(what=="out") { | 139 | }else if(what=="out") { |
139 | hull() { | 140 | hull() { |
140 | render(convexity=4) intersection() { | 141 | render(convexity=4) intersection() { |
141 | translate([md-fanduct_w/2-fanduct_shell,-jww/2+fanduct_shell,fanduct_shell]) | 142 | translate([md-fanduct_w/2-fanduct_shell,-jww/2+fanduct_shell,fanduct_shell]) |
142 | cube(size=[fanduct_w/2+fanduct_shell,jww-2*fanduct_shell,od-2*fanduct_shell]); | 143 | cube(size=[fanduct_w/2+fanduct_shell,jww-2*fanduct_shell,od-2*fanduct_shell]); |
143 | duct(what=what); | 144 | duct(what=what); |
144 | } | 145 | } |
145 | translate([0,0,-fanduct_elevation]) sphere(r=.2); | 146 | translate([0,0,-fanduct_elevation]) sphere(r=.2); |
146 | } | 147 | } |
147 | } | 148 | } |
148 | } | 149 | } |
149 | if(what=="in") { | 150 | if(what=="in") { |
150 | translate([0,0,-fanduct_elevation-2+epsilon]) | 151 | translate([0,0,-fanduct_elevation-2+epsilon]) |
151 | cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2); | 152 | cylinder(r=fanduct_ir+fanduct_shell*2+fanduct_w+1,h=fanduct_elevation+2); |
152 | translate([0,0,-hotend_clearance]) | 153 | translate([0,0,-hotend_clearance]) |
153 | rotate([0,0,30]) | 154 | rotate([0,0,30]) |
154 | cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6); | 155 | cylinder(r1=hotend_clearance*2,r2=0,h=hotend_clearance*2,$fn=6); |
155 | } | 156 | } |
156 | } | 157 | } |
157 | } | 158 | } |
158 | 159 | ||
159 | if(type=="circular") circus(what); | 160 | if(type=="circular") circus(what); |
160 | else if(type=="3jets") jets(what); | 161 | else if(type=="3jets") jets(what); |
161 | } | 162 | } |
162 | 163 | ||
163 | // ***air intake | 164 | // ***air intake |
164 | module intake(what) { | 165 | module intake(what) { |
165 | module placeit() { | 166 | module placeit() { |
166 | translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) | 167 | translate([-fanduct_ir-2*fanduct_shell-fanduct_w-inlet_away,0,fanduct_shell]) |
167 | rotate([0,-90,0]) | 168 | rotate([0,-90,0]) |
168 | children(); | 169 | children(); |
169 | } | 170 | } |
170 | if(what=="in") { | 171 | if(what=="in") { |
171 | placeit() translate([0,-inlet_w/2,0]) { | 172 | placeit() translate([0,-inlet_w/2,0]) { |
172 | cube(size=[inlet_h,inlet_w,inlet_l+fanduct_shell]); | 173 | cube(size=[inlet_h,inlet_w,inlet_l+fanduct_shell]); |
173 | // supports | 174 | // supports |
174 | for(i=[-1,0,1]) | 175 | for(i=[-1,0,1]) |
175 | translate([-fanduct_shell, | 176 | translate([-fanduct_shell, |
176 | (i+1)*(inlet_w-extrusion_width)/2, | 177 | (i+1)*(inlet_w-extrusion_width)/2, |
177 | -inlet_away-fanduct_w/2]) | 178 | -inlet_away-fanduct_w/2]) |
178 | cube(size=[fanduct_shell, | 179 | cube(size=[fanduct_shell, |
179 | extrusion_width, | 180 | extrusion_width, |
180 | inlet_l+fanduct_shell+inlet_away+fanduct_w/2]); | 181 | inlet_l+fanduct_shell+inlet_away+fanduct_w/2]); |
181 | } | 182 | } |
182 | hull() { | 183 | hull() { |
183 | placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) | 184 | placeit() translate([-fanduct_shell,-inlet_w/2-fanduct_shell,0]) |
184 | cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]); | 185 | cube(size=[inlet_h+2*fanduct_shell,inlet_w+2*fanduct_shell,fanduct_shell]); |
185 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) | 186 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,0]) |
186 | translate([0,-inlet_w/2-fanduct_shell/2,0]) | 187 | translate([0,-inlet_w/2-fanduct_shell/2,0]) |
187 | cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]); | 188 | cube(size=[1,inlet_w+fanduct_shell,fanduct_shell*2+fanduct_h]); |
188 | } | 189 | } |
189 | }else if(what=="out") { | 190 | }else if(what=="out") { |
190 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) | 191 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) |
191 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_l+fanduct_shell+1]); | 192 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,inlet_l+fanduct_shell+1]); |
192 | hull() { | 193 | hull() { |
193 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) | 194 | placeit() translate([fanduct_shell,-inlet_w/2+fanduct_shell,0]) |
194 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]); | 195 | cube(size=[inlet_h-2*fanduct_shell,inlet_w-2*fanduct_shell,fanduct_shell]); |
195 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) | 196 | translate([-fanduct_ir-fanduct_shell-fanduct_w/2,0,fanduct_shell]) |
196 | translate([0,-inlet_w/2+fanduct_shell,0]) | 197 | translate([0,-inlet_w/2+fanduct_shell,0]) |