summaryrefslogtreecommitdiffabout
path: root/delta.jscad
Unidiff
Diffstat (limited to 'delta.jscad') (more/less context) (show whitespace changes)
-rw-r--r--delta.jscad4
1 files changed, 3 insertions, 1 deletions
diff --git a/delta.jscad b/delta.jscad
index 83122af..54f1f86 100644
--- a/delta.jscad
+++ b/delta.jscad
@@ -5,193 +5,195 @@ var PRINT = {
5 fit_tolerance: .2, slide_tolerance: .4, play_tolerance: .6 5 fit_tolerance: .2, slide_tolerance: .4, play_tolerance: .6
6}; 6};
7 7
8var CONFIG = { 8var 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 ],
103 glass: [0.9, 0.9, 0.9, 0.7 ]
102 } 104 }
103}; 105};
104 106
105var CD = { 107var CD = {
106 base: (function(){ 108 base: (function(){
107 var rv = {}; 109 var rv = {};
108 rv.circumscription_r = 110 rv.circumscription_r =
109 CONFIG.base.sl/2/Math.cos(Math.PI/6); 111 CONFIG.base.sl/2/Math.cos(Math.PI/6);
110 rv.outer_inscription_r = 112 rv.outer_inscription_r =
111 Math.sqrt(Math.pow(rv.circumscription_r,2)- 113 Math.sqrt(Math.pow(rv.circumscription_r,2)-
112 Math.pow(CONFIG.base.sl/2,2)); 114 Math.pow(CONFIG.base.sl/2,2));
113 rv.mid_inscription_r = 115 rv.mid_inscription_r =
114 rv.outer_inscription_r-CONFIG.extrusion.w/2; 116 rv.outer_inscription_r-CONFIG.extrusion.w/2;
115 rv.inner_inscription_r = 117 rv.inner_inscription_r =
116 rv.outer_inscription_r-CONFIG.extrusion.w; 118 rv.outer_inscription_r-CONFIG.extrusion.w;
117 // TODO: properly calculate 119 // TODO: properly calculate
118 rv.column_r = rv.circumscription_r - 48.29; 120 rv.column_r = rv.circumscription_r - 48.29;
119 return rv; 121 return rv;
120 })(), 122 })(),
121 duetholder: (function() { 123 duetholder: (function() {
122 var rv = {}; 124 var rv = {};
123 var s = CONFIG.base.sl; 125 var s = CONFIG.base.sl;
124 var l = CONFIG.duet.hole_spacing.x; 126 var l = CONFIG.duet.hole_spacing.x;
125 var w = CONFIG.duet.hole_spacing.y; 127 var w = CONFIG.duet.hole_spacing.y;
126 var h = s*Math.cos(Math.PI/6); 128 var h = s*Math.cos(Math.PI/6);
127 var h1 = h*(1-l/s); 129 var h1 = h*(1-l/s);
128 rv.distance = (h1-w)/3; // hole to side 130 rv.distance = (h1-w)/3; // hole to side
129 return rv; 131 return rv;
130 })() 132 })()
131}; 133};
132console.log(CONFIG); console.log(CD); 134console.log(CONFIG); console.log(CD);
133 135
134var U = { 136var U = {
135 hypotenuse: function(a,b) { 137 hypotenuse: function(a,b) {
136 return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)); 138 return Math.sqrt(Math.pow(a,2)+Math.pow(b,2));
137 }, 139 },
138 peek: function(x,m) { 140 peek: function(x,m) {
139 console.log(x,m); 141 console.log(x,m);
140 return x; 142 return x;
141 } 143 }
142}; 144};
143 145
144/* {h:,w:} */ 146/* {h:,w:} */
145function nut(o) { 147function nut(o) {
146 var rv = CSG.cylinder({ 148 var rv = CSG.cylinder({
147 start:[0,0,0],end:[0,0,o.h], 149 start:[0,0,0],end:[0,0,o.h],
148 radius: o.w/2/Math.cos(Math.PI/6), 150 radius: o.w/2/Math.cos(Math.PI/6),
149 resolution: 6 151 resolution: 6
150 }); 152 });
151 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]);
152 return rv; 154 return rv;
153} 155}
154 156
155var E3DV6 = { 157var E3DV6 = {
156 dimensions: { 158 dimensions: {
157 big_d: 22.3, 159 big_d: 22.3,
158 160
159 }, 161 },
160 heatsink: function() { 162 heatsink: function() {
161 var fn = 16; 163 var fn = 16;
162 var z=0; 164 var z=0;
163 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) {
164 return CSG.cylinder({ 166 return CSG.cylinder({
165 start: [0,0,z], end: [0,0,z-=x.h], 167 start: [0,0,z], end: [0,0,z-=x.h],
166 radius: x.d/2, resolution: fn 168 radius: x.d/2, resolution: fn
167 }); 169 });
168 }); 170 });
169 unite.push(CSG.cylinder({ 171 unite.push(CSG.cylinder({
170 start:[0,0,z-=1.5], end:[0,0,z-=1], 172 start:[0,0,z-=1.5], end:[0,0,z-=1],
171 radius: 16/2, resolution: fn 173 radius: 16/2, resolution: fn
172 })); 174 }));
173 for(var i=0;i<11;++i) unite.push(CSG.cylinder({ 175 for(var i=0;i<11;++i) unite.push(CSG.cylinder({
174 start:[0,0,z-=1.5], end:[0,0,z-=1], 176 start:[0,0,z-=1.5], end:[0,0,z-=1],
175 radius: this.dimensions.big_d/2, resolution: fn 177 radius: this.dimensions.big_d/2, resolution: fn
176 })); 178 }));
177 unite.push(CSG.cylinder({ 179 unite.push(CSG.cylinder({
178 start:[0,0,z], end: [0,0,-12.7], 180 start:[0,0,z], end: [0,0,-12.7],
179 radiusStart: 10/2, radiusEnd: 8.5/2, /* pretty arbitrary */ 181 radiusStart: 10/2, radiusEnd: 8.5/2, /* pretty arbitrary */
180 resolution: fn 182 resolution: fn
181 })); 183 }));
182 var rv = union(unite); 184 var rv = union(unite);
183 rv = rv.subtract([CSG.cylinder({ 185 rv = rv.subtract([CSG.cylinder({
184 start:[0,0,1], end: [0,0,z-1], 186 start:[0,0,1], end: [0,0,z-1],
185 radius: 4.2/2, resolution: fn 187 radius: 4.2/2, resolution: fn
186 }),CSG.cylinder({ 188 }),CSG.cylinder({
187 start:[0,0,1], end: [0,0,-6.7/*somewhat arbitrary*/], 189 start:[0,0,1], end: [0,0,-6.7/*somewhat arbitrary*/],
188 radius: 8/2, resolution: fn 190 radius: 8/2, resolution: fn
189 }),CSG.cylinder({ 191 }),CSG.cylinder({
190 start:[0,0,z-1], end: [0,0,z+14.8], 192 start:[0,0,z-1], end: [0,0,z+14.8],
191 radius: 6/2 /*M7*/, resolution: fn 193 radius: 6/2 /*M7*/, resolution: fn
192 })]); 194 })]);
193 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]);
194 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]);
195 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]);
196 return rv.setColor([0.8,0.8,0.8,0.9]); 198 return rv.setColor([0.8,0.8,0.8,0.9]);
197 } 199 }