-rw-r--r-- | delta.jscad | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/delta.jscad b/delta.jscad index 156e704..24c1c7e 100644 --- a/delta.jscad +++ b/delta.jscad | |||
@@ -1,197 +1,197 @@ | |||
1 | var PRINT = { | 1 | var PRINT = { |
2 | layer_height: 0.2, | 2 | layer_height: 0.2, |
3 | extrusion_width: 0.4, | 3 | extrusion_width: 0.4, |
4 | 4 | ||
5 | fit_tolerance: .2, slide_tolerance: .4, play_tolerance: .6 | 5 | fit_tolerance: .2, slide_tolerance: .4, play_tolerance: .6, screw_tolerance: .3 |
6 | }; | 6 | }; |
7 | 7 | ||
8 | var CONFIG = { | 8 | var CONFIG = { |
9 | extrusion: { | 9 | extrusion: { |
10 | w: 20, slotdepth: 6 | 10 | w: 20, slotdepth: 6 |
11 | }, | 11 | }, |
12 | base: { | 12 | base: { |
13 | el: 240, // side extrusion length | 13 | el: 240, // side extrusion length |
14 | sl: 240+2*70, // triangle side length | 14 | sl: 240+2*70, // triangle side length |
15 | gap: 9 // vertical gap between side extrusions | 15 | gap: 9 // vertical gap between side extrusions |
16 | }, | 16 | }, |
17 | column: { | 17 | column: { |
18 | h: 600 // column height | 18 | h: 600 // column height |
19 | }, | 19 | }, |
20 | heatbed: { | 20 | heatbed: { |
21 | r: 220/2, // heatbed radius | 21 | r: 220/2, // heatbed radius |
22 | sr: 220/2-4.5,// radius of the screwholes circle | 22 | sr: 220/2-4.5,// radius of the screwholes circle |
23 | h: 3+1.5 // thickness (including insulation) | 23 | h: 3+1.5 // thickness (including insulation) |
24 | }, | 24 | }, |
25 | glass: { | 25 | glass: { |
26 | r: 195/2, // glass radius | 26 | r: 195/2, // glass radius |
27 | h: 3 // glass thickness | 27 | h: 3 // glass thickness |
28 | }, | 28 | }, |
29 | duet: { | 29 | duet: { |
30 | pcb_size: { x: 124, y: 100, z: 1 }, | 30 | pcb_size: { x: 124, y: 100, z: 1 }, |
31 | hole_spacing: { x: 115, y: 92 }, | 31 | hole_spacing: { x: 115, y: 92 }, |
32 | h: 30 | 32 | h: 30 |
33 | }, | 33 | }, |
34 | foot: { | 34 | foot: { |
35 | d: 20*Math.sqrt(2), h: 30, | 35 | d: 20*Math.sqrt(2), h: 30, |
36 | bolt: { d:5, l: 19, hd: 10 }, | 36 | bolt: { d:5, l: 19, hd: 10 }, |
37 | margin: 2.5, | 37 | margin: 2.5, |
38 | nut: { d: 8.6 /* TODO: */, h: 3.5 }, | 38 | nut: { d: 8.6 /* TODO: */, h: 3.5 }, |
39 | shell: 4, | 39 | shell: 4, |
40 | zscalefactor: 1.6, | 40 | zscalefactor: 1.6, |
41 | foot: { ho: 2.5, hi: 5 } | 41 | foot: { ho: 2.5, hi: 5 } |
42 | }, | 42 | }, |
43 | duetholder: { | 43 | duetholder: { |
44 | bolt: { d: 3, l: 10, head: { d: 5.33, h: 3 } }, | 44 | bolt: { d: 3, l: 10, head: { d: 5.33, h: 3 } }, |
45 | margin: 3, | 45 | margin: 3, |
46 | s: 2.5 | 46 | s: 2.5 |
47 | }, | 47 | }, |
48 | hotend: { | 48 | hotend: { |
49 | h: 62.4, // full assembly height | 49 | h: 62.4, // full assembly height |
50 | groove: { d:12, h:6 }, // grove diameter and height | 50 | groove: { d:12, h:6 }, // grove diameter and height |
51 | ungroove: { d:16, above:3.7, below: 3+4 } | 51 | ungroove: { d:16, above:3.7, below: 3+4 } |
52 | }, | 52 | }, |
53 | effector: { | 53 | effector: { |
54 | h: 6, | 54 | h: 6, |
55 | o: 20,// offset to the rod mounts line | 55 | o: 20,// offset to the rod mounts line |
56 | rods_apart: 40, | 56 | rods_apart: 40, |
57 | cone: { shell: 1, angle: Math.PI/6 }, | 57 | cone: { shell: 1, angle: Math.PI/6 }, |
58 | rodend: { | 58 | rodend: { |
59 | joint_w: 7,// thickness of the joint | 59 | joint_w: 7,// thickness of the joint |
60 | screw_l: 20-1, // 20 with the head | 60 | screw_l: 20-1, // 20 with the head |
61 | screw_d: 3 | 61 | screw_d: 3 |
62 | }, | 62 | }, |
63 | hotend: { margin: 2 }, | 63 | hotend: { margin: 2 }, |
64 | hinge: { | 64 | hinge: { |
65 | d: 3, w: 5, margin: 2.5, | 65 | d: 3, w: 5, margin: 2.5, |
66 | h: 1+(6+3.7)/2, // elevation + grove + top | 66 | h: 1+(6+3.7)/2, // elevation + grove + top |
67 | e: 1 // elevation | 67 | e: 1 // elevation |
68 | }, | 68 | }, |
69 | clamp: { | 69 | clamp: { |
70 | shell: 4.6, | 70 | shell: 4.6, |
71 | d: 3, | 71 | d: 3, |
72 | margin: 2.5, | 72 | margin: 2.5, |
73 | split: 0.6 | 73 | split: 0.6 |
74 | }, | 74 | }, |
75 | mswitch: { | 75 | mswitch: { |
76 | size: [ 19.8, 6, 10 ], | 76 | size: [ 19.8, 6, 10 ], |
77 | screw: { | 77 | screw: { |
78 | d: 2, h: 10/2-2, | 78 | d: 2, h: 10/2-2, |
79 | s: 1.3, // screw shell | 79 | s: 1.3, // screw shell |
80 | o: [-9.5/2,9.5/2].map(function(x) { | 80 | o: [-9.5/2,9.5/2].map(function(x) { |
81 | return -19.8/2+x; | 81 | return -19.8/2+x; |
82 | }) | 82 | }) |
83 | }, | 83 | }, |
84 | switch_x: 2.5 | 84 | switch_x: 2.5 |
85 | }, | 85 | }, |
86 | guide: { | 86 | guide: { |
87 | width: 3, height: 5+1, length: 6 | 87 | width: 3, height: 5+1, length: 6 |
88 | }, | 88 | }, |
89 | fanholder: { | 89 | fanholder: { |
90 | r: 30, | 90 | r: 30, |
91 | screw: { d: 3, m: 2.5/*margin*/ }, | 91 | screw: { d: 3, m: 2.5/*margin*/ }, |
92 | w: 3 | 92 | w: 3 |
93 | } | 93 | } |
94 | }, | 94 | }, |
95 | nut: { h: 2.3, w: 5.5 }, | 95 | nut: { h: 2.3, w: 5.5 }, |
96 | color: { | 96 | color: { |
97 | extrusion: [0.8, 0.8, 0.8, 0.8], | 97 | extrusion: [0.8, 0.8, 0.8, 0.8], |
98 | pcb: [ 0, 0.3, 0.2, 0.8 ], | 98 | pcb: [ 0, 0.3, 0.2, 0.8 ], |
99 | bulk: [ .9, .9, .9, .2 ], | 99 | bulk: [ .9, .9, .9, .2 ], |
100 | parts: [ 0, 0.8, 0, 0.9 ], | 100 | parts: [ 0, 0.8, 0, 0.9 ], |
101 | softparts: [ 0, 0, 0.8, 0.9 ], | 101 | softparts: [ 0, 0, 0.8, 0.9 ], |
102 | heatbed: [0.8, 0.8, 0.8, 0.8 ], | 102 | heatbed: [0.8, 0.8, 0.8, 0.8 ], |
103 | glass: [0.9, 0.9, 0.9, 0.7 ] | 103 | glass: [0.9, 0.9, 0.9, 0.7 ] |
104 | } | 104 | } |
105 | }; | 105 | }; |
106 | 106 | ||
107 | var CD = { | 107 | var CD = { |
108 | base: (function(){ | 108 | base: (function(){ |
109 | var rv = {}; | 109 | var rv = {}; |
110 | rv.circumscription_r = | 110 | rv.circumscription_r = |
111 | CONFIG.base.sl/2/Math.cos(Math.PI/6); | 111 | CONFIG.base.sl/2/Math.cos(Math.PI/6); |
112 | rv.outer_inscription_r = | 112 | rv.outer_inscription_r = |
113 | Math.sqrt(Math.pow(rv.circumscription_r,2)- | 113 | Math.sqrt(Math.pow(rv.circumscription_r,2)- |
114 | Math.pow(CONFIG.base.sl/2,2)); | 114 | Math.pow(CONFIG.base.sl/2,2)); |
115 | rv.mid_inscription_r = | 115 | rv.mid_inscription_r = |
116 | rv.outer_inscription_r-CONFIG.extrusion.w/2; | 116 | rv.outer_inscription_r-CONFIG.extrusion.w/2; |
117 | rv.inner_inscription_r = | 117 | rv.inner_inscription_r = |
118 | rv.outer_inscription_r-CONFIG.extrusion.w; | 118 | rv.outer_inscription_r-CONFIG.extrusion.w; |
119 | // TODO: properly calculate | 119 | // TODO: properly calculate |
120 | rv.column_r = rv.circumscription_r - 48.29; | 120 | rv.column_r = rv.circumscription_r - 48.29; |
121 | return rv; | 121 | return rv; |
122 | })(), | 122 | })(), |
123 | duetholder: (function() { | 123 | duetholder: (function() { |
124 | var rv = {}; | 124 | var rv = {}; |
125 | var s = CONFIG.base.sl; | 125 | var s = CONFIG.base.sl; |
126 | var l = CONFIG.duet.hole_spacing.x; | 126 | var l = CONFIG.duet.hole_spacing.x; |
127 | var w = CONFIG.duet.hole_spacing.y; | 127 | var w = CONFIG.duet.hole_spacing.y; |
128 | var h = s*Math.cos(Math.PI/6); | 128 | var h = s*Math.cos(Math.PI/6); |
129 | var h1 = h*(1-l/s); | 129 | var h1 = h*(1-l/s); |
130 | rv.distance = (h1-w)/3; // hole to side | 130 | rv.distance = (h1-w)/3; // hole to side |
131 | return rv; | 131 | return rv; |
132 | })() | 132 | })() |
133 | }; | 133 | }; |
134 | console.log(CONFIG); console.log(CD); | 134 | console.log(CONFIG); console.log(CD); |
135 | 135 | ||
136 | var U = { | 136 | var U = { |
137 | hypotenuse: function(a,b) { | 137 | hypotenuse: function(a,b) { |
138 | return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)); | 138 | return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)); |
139 | }, | 139 | }, |
140 | peek: function(x,m) { | 140 | peek: function(x,m) { |
141 | console.log(x,m); | 141 | console.log(x,m); |
142 | return x; | 142 | return x; |
143 | } | 143 | } |
144 | }; | 144 | }; |
145 | 145 | ||
146 | /* {h:,w:} */ | 146 | /* {h:,w:} */ |
147 | function nut(o) { | 147 | function nut(o) { |
148 | var rv = CSG.cylinder({ | 148 | var rv = CSG.cylinder({ |
149 | start:[0,0,0],end:[0,0,o.h], | 149 | start:[0,0,0],end:[0,0,o.h], |
150 | radius: o.w/2/Math.cos(Math.PI/6), | 150 | radius: o.w/2/Math.cos(Math.PI/6), |
151 | resolution: 6 | 151 | resolution: 6 |
152 | }); | 152 | }); |
153 | rv.properties.axis_connector = new CSG.Connector([0,0,0],[0,0,1],[0,1,0]); | 153 | rv.properties.axis_connector = new CSG.Connector([0,0,0],[0,0,1],[0,1,0]); |
154 | return rv; | 154 | return rv; |
155 | } | 155 | } |
156 | 156 | ||
157 | var E3DV6 = { | 157 | var E3DV6 = { |
158 | dimensions: { | 158 | dimensions: { |
159 | big_d: 22.3, | 159 | big_d: 22.3, |
160 | 160 | ||
161 | }, | 161 | }, |
162 | heatsink: function() { | 162 | heatsink: function() { |
163 | var fn = 16; | 163 | var fn = 16; |
164 | var z=0; | 164 | var z=0; |
165 | var unite = [ {d:16,h:3.7},{d:12,h:6},{d:16,h:3} ].map(function(x) { | 165 | var unite = [ {d:16,h:3.7},{d:12,h:6},{d:16,h:3} ].map(function(x) { |
166 | return CSG.cylinder({ | 166 | return CSG.cylinder({ |
167 | start: [0,0,z], end: [0,0,z-=x.h], | 167 | start: [0,0,z], end: [0,0,z-=x.h], |
168 | radius: x.d/2, resolution: fn | 168 | radius: x.d/2, resolution: fn |
169 | }); | 169 | }); |
170 | }); | 170 | }); |
171 | unite.push(CSG.cylinder({ | 171 | unite.push(CSG.cylinder({ |
172 | start:[0,0,z-=1.5], end:[0,0,z-=1], | 172 | start:[0,0,z-=1.5], end:[0,0,z-=1], |
173 | radius: 16/2, resolution: fn | 173 | radius: 16/2, resolution: fn |
174 | })); | 174 | })); |
175 | for(var i=0;i<11;++i) unite.push(CSG.cylinder({ | 175 | for(var i=0;i<11;++i) unite.push(CSG.cylinder({ |
176 | start:[0,0,z-=1.5], end:[0,0,z-=1], | 176 | start:[0,0,z-=1.5], end:[0,0,z-=1], |
177 | radius: this.dimensions.big_d/2, resolution: fn | 177 | radius: this.dimensions.big_d/2, resolution: fn |
178 | })); | 178 | })); |
179 | unite.push(CSG.cylinder({ | 179 | unite.push(CSG.cylinder({ |
180 | start:[0,0,z], end: [0,0,-12.7], | 180 | start:[0,0,z], end: [0,0,-12.7], |
181 | radiusStart: 10/2, radiusEnd: 8.5/2, /* pretty arbitrary */ | 181 | radiusStart: 10/2, radiusEnd: 8.5/2, /* pretty arbitrary */ |
182 | resolution: fn | 182 | resolution: fn |
183 | })); | 183 | })); |
184 | var rv = union(unite); | 184 | var rv = union(unite); |
185 | rv = rv.subtract([CSG.cylinder({ | 185 | rv = rv.subtract([CSG.cylinder({ |
186 | start:[0,0,1], end: [0,0,z-1], | 186 | start:[0,0,1], end: [0,0,z-1], |
187 | radius: 4.2/2, resolution: fn | 187 | radius: 4.2/2, resolution: fn |
188 | }),CSG.cylinder({ | 188 | }),CSG.cylinder({ |
189 | start:[0,0,1], end: [0,0,-6.7/*somewhat arbitrary*/], | 189 | start:[0,0,1], end: [0,0,-6.7/*somewhat arbitrary*/], |
190 | radius: 8/2, resolution: fn | 190 | radius: 8/2, resolution: fn |
191 | }),CSG.cylinder({ | 191 | }),CSG.cylinder({ |
192 | start:[0,0,z-1], end: [0,0,z+14.8], | 192 | start:[0,0,z-1], end: [0,0,z+14.8], |
193 | radius: 6/2 /*M7*/, resolution: fn | 193 | radius: 6/2 /*M7*/, resolution: fn |
194 | })]); | 194 | })]); |
195 | rv.properties.pushfit_connector = new CSG.Connector([0,0,0],[0,0,-1],[1,0,0]); | 195 | rv.properties.pushfit_connector = new CSG.Connector([0,0,0],[0,0,-1],[1,0,0]); |
196 | rv.properties.heatbreak_connector = new CSG.Connector([0,0,z+14.8],[0,0,-1],[1,0,0]); | 196 | rv.properties.heatbreak_connector = new CSG.Connector([0,0,z+14.8],[0,0,-1],[1,0,0]); |
197 | rv.properties.grove_connector = new CSG.Connector([0,0,-3.7-3],[0,0,1],[1,0,0]); | 197 | rv.properties.grove_connector = new CSG.Connector([0,0,-3.7-3],[0,0,1],[1,0,0]); |