-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorrery2.scad
384 lines (310 loc) · 8.56 KB
/
orrery2.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
/*
* Two-shaft orrery of the first six planets
* and the moon of the third.
*/
include <gears.scad>
// 1mm shaft walls turned out to be too thin
shaft_wall = 2;
// mars - saturn have too much space; maybe needs thicker wall?
shaft_sizes = [
5 + 2.75*0, // 0 mercury
5 + 2.75*1, // 1 venus
5 + 2.75*2, // 2 earth
5 + 2.75*3, // 3 moon (extra thick)
5 + 2.75*5, // 4 mars
5 + 2.75*7, // 5 jupiter
5 + 2.75*9, // 6 saturn
5 + 2.75*11, // 7 top plate
];
// The inner stack turns mercury, earth, venus and mars.
// it turns in the NEGATIVE direction, to mesh with the
// positive turning planet gears.
// The entire stack turns on a solid 5mm shaft and
// has a real washer at the top.
module inner_stack(h=5)
{
bore_diameter=5;
spokes=9;
//shaft(h*5, bore_diameter, 1);
// mars, double height with a washer on top
translate([0,0,3*h])
orrery_gear(32, height=2*h-washer, direction=-1, bore_diameter=bore_diameter, spokes=spokes);
/*
// spokes to hold up the mars gear during printing
translate([0,0,3*h])
{
fanout(spokes, [bore_diameter/2,-3/2 - 3,0])
cube([
pitch*32/(2*PI)-bore_diameter/2-2,
3,
height
]);
render() difference() {
cylinder(d=bore_diameter+2*5, h=height, $fn=spokes);
translate([0,0,-1]) cylinder(d=bore_diameter, h=height+2, $fn=32);
}
}
*/
// earth
translate([0,0,2*h]) orrery_gear(46,height=h, direction=-1, bore_diameter=bore_diameter, spokes=spokes);
// venus
translate([0,0,1*h]) orrery_gear(57,height=h, direction=-1, bore_diameter=bore_diameter, spokes=spokes);
// mercury
translate([0,0,0*h]) orrery_gear(74,height=h, direction=-1, bore_diameter=bore_diameter, spokes=spokes);
}
// The outer planet stack turns in the NEGATIVE direction
// and is powered by the Mars takeoff (turning in the positive
// direction), and in turn drives the Jupiter and Saturn
// gears (both in positive direction).
// The outer stack turns on a solid shaft shared with the
// inner stack, so the outer planets must have the same
// total number of teeth as the inner planets.
module outer_stack(h=5)
{
spokes = 7;
bore_diameter = 5;
//shaft(h*3, bore_diameter, 1);
// saturn
translate([0,0,2*h]) orrery_gear(19,height=h, direction=-1, bore_diameter=bore_diameter, spokes=spokes);
// jupiter
translate([0,0,1*h]) orrery_gear(36,height=h, direction=-1, bore_diameter=bore_diameter, spokes=spokes);
// takeoff
translate([0,0,0*h]) orrery_gear(74,height=h, direction=-1, bore_diameter=bore_diameter, spokes=spokes);
}
module mercury_gear(h=5)
{
bore = shaft_sizes[0];
orrery_gear(18, height=h, bore_diameter=bore, spokes=3);
shaft_top(h*16, bore, shaft_wall);
}
module venus_gear(h=5)
{
bore = shaft_sizes[1];
orrery_gear(35, height=h, bore_diameter=bore, spokes=4);
shaft_top(h*14, bore, shaft_wall);
}
module earth_gear(h=5)
{
// need to make room for the moon gear
bore = shaft_sizes[2];
orrery_gear(46, height=h, bore_diameter=bore, spokes=5);
shaft_top(h*12, bore, shaft_wall);
}
module moon_brace(h=5)
{
bore = shaft_sizes[3];
// be sure that the brace clears the earth gear
// and hope it also clears the drive mercury gear
render() difference()
{
union() {
braceplate(h-washer, 0);
// washer for the mars gear to sit on
translate([0,0,h-washer]) cylinder(d=20, h=washer);
}
// make sure there is an opening for the
// other shafts
translate([0,0,-1]) cylinder(d=bore,h=h+2);
// as well as clearance for the earth gear
translate([-center,0,-1]) cylinder(d=48*pitch/PI, h=h+2, $fn=32);
}
// shaft up to the moon gear
shaft_top(h*10, bore, 2*shaft_wall);
}
module moon_gear(h=5)
{
// straight cut, with a finer pitch
bore = shaft_sizes[3];
orrery_gear(
146,
height=h,
spokes=12,
bore_diameter=bore,
direction=0,
pitch=3.5
);
// and a shaft-alignment thingy
shaft_coupler(bore);
}
module mars_gear(h=5)
{
// both the mars gear and the take off
bore = shaft_sizes[4];
// takeoff gear is solid due to sizing
translate([0,0,h])
render() difference()
{
orrery_gear(18, height=h, bore_diameter=bore, spokes=0, hubthickness=0);
translate([0,0,-1]) cylinder(d=bore, h=h+2, $fn=32);
}
// main mars gear
orrery_gear(60, height=h, bore_diameter=bore);
// skip the takeoff gear
translate([0,0,h*2])
shaft_top(h*(8-2), bore, 2*shaft_wall);
}
module jupiter_gear(h=5)
{
bore = shaft_sizes[5];
orrery_gear(56, height=h, bore_diameter=bore, spokes=7);
shaft_top(h*5, bore, 2*shaft_wall);
}
module saturn_gear(h=5)
{
bore = shaft_sizes[6];
orrery_gear(73, height=h, bore_diameter=bore, spokes=8);
shaft_top(h*3, bore, 2*shaft_wall);
}
height = 5;
center = pitch * (46 + 46) / (2*PI) + 0.25;
module braceplate(h=height, do_mainshaft=1, do_hexes=0)
{
// be sure that the brace clears the saturn gear
teeth = 73;
// and hope it also clears the drive mercury gear
render() difference()
{
hull() {
fanout(3, [teeth*pitch/(2*PI),0,0])
cylinder(r=14, h=h);
if (do_mainshaft)
translate([-center,0,0])
cylinder(r=10, h=h);
}
// and the support braces with hexes
fanout(3, [teeth*pitch/(2*PI)+5,0,-1])
{
cylinder(d=shaft_sizes[0], h=h+2, $fn=16);
translate([0,0,h-2]) {
if (do_hexes)
hexnut(5);
else
cylinder(d=12, h=h+2);
}
}
/*
// some fancy holes
fanout(3, [teeth*pitch/(2*PI)*.66,0,-1])
cylinder(d=25, h=h+2, $fn=7);
*/
fanout(9, [teeth*pitch/(2*PI)*.5,0,-1])
cylinder(d=10, h=h+2, $fn=16);
if (do_mainshaft)
translate([-center,0,-1])
cylinder(d=shaft_sizes[0], h=h+2, $fn=32);
}
}
module baseplate(h=height)
{
translate([0,0,h])
mirrordupe([0,0,1])
render() difference()
{
braceplate(h);
translate([0,0,-1]) cylinder(d=shaft_sizes[0],h=h+2, $fn=32);
//translate([-center*.66,0,-1]) cylinder(d=30, h=h+2, $fn=9);
// mainshaft hex nut keeper
translate([-center,0,h-3]) hexnut(5);
translate([0,0,h-3]) hexnut(5);
// and a big cutout
translate([-center*0.7,0,-1])
cylinder(d=20,h=h+2);
}
}
module topplate(h=height)
{
render() difference()
{
braceplate(h);
// clear the saturn shaft
translate([0,0,-1])
cylinder(d=shaft_sizes[7], h=h+2, $fn=32);
}
}
module assembly()
{
translate([-center,0,5*height]) outer_stack(h=height);
color("pink") translate([-center,0,0*height]) inner_stack(h=height);
color("gold") translate([0,0,0*height])
mercury_gear(h=height);
color("blue") translate([0,0,1*height])
venus_gear(h=height);
color("green") translate([0,0,2*height])
earth_gear(h=height);
color("silver") translate([0,0,3*height])
moon_brace(h=height);
color("silver") translate([0,0,12*height])
moon_gear(h=height);
color("red") translate([0,0,4*height])
mars_gear(h=height);
// skip the takeoff
color("purple") translate([0,0,6*height])
jupiter_gear(h=height);
color("white") translate([0,0,7*height])
saturn_gear(h=height);
translate([0,0,-2*height]) baseplate();
translate([0,0,8*height]) topplate();
translate([0,0,washer]) {
translate([0,0,16*height]) rotate([180,0,0]) mercury_arm();
translate([0,0,15*height]) rotate([180,0,0]) venus_arm();
translate([0,0,14*height]) rotate([180,0,0]) earth_arm();
}
}
module plate()
{
translate([0,0,0]) color("yellow") outer_stack(h=height);
translate([100,0,0]) color("pink") inner_stack(h=height);
translate([0,70,0]) color("gold") mercury_gear(h=height);
translate([50,80,0]) color("green") earth_gear(h=height);
translate([120,80,0]) color("blue") venus_gear(h=height);
translate([-30,120,0]) color("silver") moon_brace(h=height);
translate([50,220,0]) color("silver") moon_gear(h=height);
translate([200,-40,0]) color("red") mars_gear(h=height);
translate([200,+40,0]) color("purple") jupiter_gear(h=height);
translate([300,0,0]) color("white") saturn_gear(h=height);
translate([280,100,0]) color("white") baseplate(h=height);
translate([190,170,0]) color("white") topplate(h=height);
}
module planet_arm(len,bore,h=height,thick=1)
{
render() difference() {
hull() {
cylinder(d=bore+shaft_wall*4, h=h-washer);
translate([len,0,0]) cylinder(d=4, h=1, $fn=32);
}
translate([0,0,-1])
cylinder(d=bore+shaft_wall*2, h=height+2);
}
}
module mercury_arm()
{
bore = shaft_sizes[0];
shaft_coupler(bore, shaft_wall);
planet_arm(20, bore);
}
module venus_arm()
{
bore = shaft_sizes[1];
shaft_coupler(bore, shaft_wall);
planet_arm(30, bore);
}
module earth_arm()
{
bore = shaft_sizes[2];
shaft_coupler(bore, shaft_wall);
planet_arm(40, bore);
}
mode = 2;
if (mode==0) assembly(); else
if (mode==1) plate(); else
if (mode==2) {
translate([-20,0,0]) {
color("red") mercury_gear();
translate([0,0,height*17]) rotate([180,0,0]) mercury_arm();
}
translate([+30,0,0]) {
color("red") venus_gear();
translate([0,0,height*16]) rotate([180,0,0]) venus_arm();
}
venus_arm();
}