author | Michael Krelin <hacker@klever.net> | 2016-07-20 18:49:37 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2016-07-20 18:49:37 (UTC) |
commit | e173381d925698388e85d253b874a8d9a5efbc06 (patch) (unidiff) | |
tree | 0ad3f1f9df6bc1d7d361654d57c6ed146a82dc2f /fanduct.scad | |
parent | 098bb6886664983fa14c2f37ddaf117406534521 (diff) | |
download | fanductory-e173381d925698388e85d253b874a8d9a5efbc06.zip fanductory-e173381d925698388e85d253b874a8d9a5efbc06.tar.gz fanductory-e173381d925698388e85d253b874a8d9a5efbc06.tar.bz2 |
don't make curves too smooth unless we're rendering
-rw-r--r-- | fanduct.scad | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fanduct.scad b/fanduct.scad index 690a4c8..8d0414f 100644 --- a/fanduct.scad +++ b/fanduct.scad | |||
@@ -1,139 +1,140 @@ | |||
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 | type="circular"; // circular|3jets | 6 | type="circular"; // circular|3jets |
7 | ductshape="square"; // square|round | 7 | ductshape="square"; // square|round |
8 | dual=true; // dual or single | 8 | dual=true; // dual or single |
9 | 9 | ||
10 | nozzles_apart = 18; // distance between nozzles for dual hotend | 10 | nozzles_apart = 18; // distance between nozzles for dual hotend |
11 | space_behind_nozzle = 10;// space behind the nozzle where we're allowed to go | 11 | space_behind_nozzle = 10;// space behind the nozzle where we're allowed to go |
12 | // without the fear of hitting carriage | 12 | // without the fear of hitting carriage |
13 | 13 | ||
14 | inlet_w = 12.5; // inlet width | 14 | inlet_w = 12.5; // inlet width |
15 | inlet_h = 17; // inlet height | 15 | inlet_h = 17; // inlet height |
16 | inlet_short_l = 7;// inlet length of protrusion (or depth of intrusion:)) | 16 | inlet_short_l = 7;// inlet length of protrusion (or depth of intrusion:)) |
17 | inlet_away = 15;// how far away inlet is | 17 | inlet_away = 15;// how far away inlet is |
18 | 18 | ||
19 | inlet_long_l = inlet_short_l+inlet_h; | 19 | inlet_long_l = inlet_short_l+inlet_h; |
20 | function hypothenuse(a,b) = sqrt(pow(a,2)+pow(b,2)); | 20 | function hypothenuse(a,b) = sqrt(pow(a,2)+pow(b,2)); |
21 | 21 | ||
22 | silicone_shell = 2; | 22 | silicone_shell = 2; |
23 | heater_clearance = dual | 23 | heater_clearance = dual |
24 | ? max(20,15.5) - 4.5 + silicone_shell | 24 | ? max(20,15.5) - 4.5 + silicone_shell |
25 | : max( | 25 | : max( |
26 | hypothenuse(16/2 +silicone_shell, 20-4.5 +silicone_shell),// E3D v6 | 26 | hypothenuse(16/2 +silicone_shell, 20-4.5 +silicone_shell),// E3D v6 |
27 | hypothenuse(11.5-4.5 +silicone_shell, 15.5 +silicone_shell)// E3D volcano | 27 | hypothenuse(11.5-4.5 +silicone_shell, 15.5 +silicone_shell)// E3D volcano |
28 | ); | 28 | ); |
29 | 29 | ||
30 | fanduct_elevation = 3; // fanduct elevation above nozzle tip | 30 | fanduct_elevation = 3; // fanduct elevation above nozzle tip |
31 | fanduct_blowtarget = -2; // what to blow at | 31 | fanduct_blowtarget = -2; // what to blow at |
32 | fanduct_h = 6; // inner height of the duct | 32 | fanduct_h = 6; // inner height of the duct |
33 | fanduct_w = 7; // inner width of the duct | 33 | fanduct_w = 7; // inner width of the duct |
34 | fanduct_shell=1.2; // shell thickness | 34 | fanduct_shell=1.2; // shell thickness |
35 | fanduct_ir = heater_clearance+5; // inner radius | 35 | fanduct_ir = heater_clearance+5; // inner radius |
36 | 36 | ||
37 | jet_angle = 60-2; // angular width of the jet | 37 | jet_angle = 60-2; // angular width of the jet |
38 | 38 | ||
39 | hotend_clearance = heater_clearance; | 39 | hotend_clearance = heater_clearance; |
40 | 40 | ||
41 | snapper_d = 8; snapper_overlap=0.2;// snip snap | 41 | snapper_d = 8; snapper_overlap=0.2;// snip snap |
42 | 42 | ||
43 | smooth_f = 120; | 43 | draft=true; |
44 | smooth_f = draft? 30 : 120; | ||
44 | 45 | ||
45 | to_midduct = fanduct_ir+fanduct_shell+fanduct_w/2; | 46 | to_midduct = fanduct_ir+fanduct_shell+fanduct_w/2; |
46 | dual_spots = [ [+space_behind_nozzle, -(to_midduct+nozzles_apart/2)], | 47 | dual_spots = [ [+space_behind_nozzle, -(to_midduct+nozzles_apart/2)], |
47 | [- to_midduct, -(to_midduct+nozzles_apart/2)], | 48 | [- to_midduct, -(to_midduct+nozzles_apart/2)], |
48 | [- to_midduct, 0] ]; | 49 | [- to_midduct, 0] ]; |
49 | 50 | ||
50 | module fanduct(type=type,ductshape=ductshape,dual=dual) { | 51 | module fanduct(type=type,ductshape=ductshape,dual=dual) { |
51 | // ***duct is all around! | 52 | // ***duct is all around! |
52 | module duct(what) { | 53 | module duct(what) { |
53 | module single() { | 54 | module single() { |
54 | if(what=="in") { | 55 | if(what=="in") { |
55 | sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; | 56 | sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; |
56 | smax = max(sh,sv); | 57 | smax = max(sh,sv); |
57 | rotate_extrude($fn=smooth_f) | 58 | rotate_extrude($fn=smooth_f) |
58 | if(ductshape=="round") | 59 | if(ductshape=="round") |
59 | translate([sh/2+fanduct_ir,sv/2]) | 60 | translate([sh/2+fanduct_ir,sv/2]) |
60 | scale([sh/smax,sv/smax]) | 61 | scale([sh/smax,sv/smax]) |
61 | circle(d=smax,$fn=4*smax); | 62 | circle(d=smax,$fn=4*smax); |
62 | else if(ductshape=="square") | 63 | else if(ductshape=="square") |
63 | translate([fanduct_ir,0]) | 64 | translate([fanduct_ir,0]) |
64 | square([sh,sv]); | 65 | square([sh,sv]); |
65 | }else if(what=="out") { | 66 | }else if(what=="out") { |
66 | sh = fanduct_w; sv = fanduct_h; | 67 | sh = fanduct_w; sv = fanduct_h; |
67 | smax = max(sh,sv); | 68 | smax = max(sh,sv); |
68 | rotate_extrude($fn=smooth_f) | 69 | rotate_extrude($fn=smooth_f) |
69 | if(ductshape=="round") | 70 | if(ductshape=="round") |
70 | translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) | 71 | translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) |
71 | scale([sh/smax,sv/smax]) | 72 | scale([sh/smax,sv/smax]) |
72 | circle(d=smax,$fn=4*smax); | 73 | circle(d=smax,$fn=4*smax); |
73 | else if(ductshape=="square") | 74 | else if(ductshape=="square") |
74 | translate([fanduct_ir+fanduct_shell,fanduct_shell]) | 75 | translate([fanduct_ir+fanduct_shell,fanduct_shell]) |
75 | union() { | 76 | union() { |
76 | square([sh,sv/2]); | 77 | square([sh,sv/2]); |
77 | translate([sh/2,sv/2]) | 78 | translate([sh/2,sv/2]) |
78 | scale([sh/smax,sv/smax]) | 79 | scale([sh/smax,sv/smax]) |
79 | circle(d=smax,$fn=36); | 80 | circle(d=smax,$fn=36); |
80 | } | 81 | } |
81 | } | 82 | } |
82 | } | 83 | } |
83 | module dual() { | 84 | module dual() { |
84 | module hulls(spots=dual_spots) { | 85 | module hulls(spots=dual_spots) { |
85 | for(my=[0,1]) mirror([0,my,0]) for(pn=[0:1:len(spots)-2]) hull() { | 86 | for(my=[0,1]) mirror([0,my,0]) for(pn=[0:1:len(spots)-2]) hull() { |
86 | for(p=[spots[pn],spots[pn+1]]) translate(p) children(); | 87 | for(p=[spots[pn],spots[pn+1]]) translate(p) children(); |
87 | } | 88 | } |
88 | } | 89 | } |
89 | if(what=="in") { | 90 | if(what=="in") { |
90 | hulls() cylinder(d=fanduct_w+2*fanduct_shell,h=fanduct_h+2*fanduct_shell); | 91 | hulls() cylinder(d=fanduct_w+2*fanduct_shell,h=fanduct_h+2*fanduct_shell); |
91 | }else if(what=="out") { | 92 | }else if(what=="out") { |
92 | sh = fanduct_w; sv = fanduct_h; | 93 | sh = fanduct_w; sv = fanduct_h; |
93 | smax = max(sh,sv); | 94 | smax = max(sh,sv); |
94 | translate([0,0,fanduct_shell]) hulls() { | 95 | translate([0,0,fanduct_shell]) hulls() { |
95 | cylinder(d=fanduct_w,h=fanduct_h/2); | 96 | cylinder(d=fanduct_w,h=fanduct_h/2); |
96 | translate([0,0,fanduct_h/2]) | 97 | translate([0,0,fanduct_h/2]) |
97 | scale([sh/smax,sh/smax,sv/smax]) | 98 | scale([sh/smax,sh/smax,sv/smax]) |
98 | intersection() { | 99 | intersection() { |
99 | sphere(d=smax,$fn=36); | 100 | sphere(d=smax,$fn=36); |
100 | translate([0,0,-1]) | 101 | translate([0,0,-1]) |
101 | cylinder(d=smax+2,h=smax+2,$fn=36); | 102 | cylinder(d=smax+2,h=smax+2,$fn=36); |
102 | } | 103 | } |
103 | } | 104 | } |
104 | } | 105 | } |
105 | } | 106 | } |
106 | 107 | ||
107 | if(dual) dual(); | 108 | if(dual) dual(); |
108 | else single(); | 109 | else single(); |
109 | } | 110 | } |
110 | 111 | ||
111 | // ***bumps for easier position adjustments in line with hotend | 112 | // ***bumps for easier position adjustments in line with hotend |
112 | module marks(what) { | 113 | module marks(what) { |
113 | if(what=="in") { | 114 | if(what=="in") { |
114 | for(y=[-1,1]) translate([0,dual?y*nozzles_apart/2:0,0]) | 115 | for(y=[-1,1]) translate([0,dual?y*nozzles_apart/2:0,0]) |
115 | hull() for(z=[0,-fanduct_shell-fanduct_h/2]) | 116 | hull() for(z=[0,-fanduct_shell-fanduct_h/2]) |
116 | translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) | 117 | translate([0,y*(fanduct_ir+fanduct_shell+fanduct_w/2),fanduct_shell*2+fanduct_h+z]) |
117 | rotate([90,0,0]) { | 118 | rotate([90,0,0]) { |
118 | cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); | 119 | cylinder(r=fanduct_shell,h=fanduct_w,center=true,$fn=30); |
119 | for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) | 120 | for(z=[-1,1]) translate([0,0,z*fanduct_w/2]) |
120 | sphere(r=fanduct_shell,$fn=30); | 121 | sphere(r=fanduct_shell,$fn=30); |
121 | } | 122 | } |
122 | } | 123 | } |
123 | } | 124 | } |
124 | 125 | ||
125 | // ***output | 126 | // ***output |
126 | module output(what,type=type) { | 127 | module output(what,type=type) { |
127 | module guideline(xyxy) { | 128 | module guideline(xyxy) { |
128 | module pin(xy) { | 129 | module pin(xy) { |
129 | translate([xy[0],xy[1],0]) | 130 | translate([xy[0],xy[1],0]) |
130 | cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); | 131 | cylinder(d=2*extrusion_width,h=2*fanduct_shell+inlet_h,$fn=6); |
131 | } | 132 | } |
132 | xyxyxy=concat(xyxy,[[0,dual?nozzles_apart/2:0]]); | 133 | xyxyxy=concat(xyxy,[[0,dual?nozzles_apart/2:0]]); |
133 | for(i=[0:1:len(xyxyxy)-2]) | 134 | for(i=[0:1:len(xyxyxy)-2]) |
134 | hull() for(j=[i,i+1]) pin(xyxyxy[j]); | 135 | hull() for(j=[i,i+1]) pin(xyxyxy[j]); |
135 | } | 136 | } |
136 | 137 | ||
137 | module circus(what) { | 138 | module circus(what) { |
138 | if(what=="in") { | 139 | if(what=="in") { |
139 | difference() { | 140 | difference() { |