-
Notifications
You must be signed in to change notification settings - Fork 0
/
eyepiece_plug.sb
535 lines (535 loc) · 31.9 KB
/
eyepiece_plug.sb
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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
{
"nodes": [
{
"datums": [
{
"expr": "0.0",
"name": "zmin",
"type": "float",
"uid": 0
},
{
"expr": "20",
"name": "zmax",
"type": "float",
"uid": 1
},
{
"expr": "0.0",
"name": "x",
"type": "float",
"uid": 2
},
{
"expr": "0.0",
"name": "y",
"type": "float",
"uid": 3
},
{
"expr": "self.R-2",
"name": "r",
"type": "float",
"uid": 4
},
{
"expr": "22.2/2-grips.r/2+1/2",
"name": "R",
"type": "float",
"uid": 5
},
{
"expr": "\u0012fab.types.Shape('aam__f1-r+qXqYf11.35a-f0Z-Zf20nam__f1-r+qXqYf9.35a-f0Z-Zf20',float('-11.350000'),float('-11.350000'),float('0.000000'),float('11.350000'),float('11.350000'),float('20.000000'))",
"name": "shape",
"type": "_fabtypes.Shape",
"uid": 6
}
],
"inspector": [
43,
-4
],
"name": "r0",
"script": [
"import fab",
"import math",
"",
"title('Ring (Z)')",
"",
"input('zmin', float)",
"input('zmax', float)",
"input('x', float)",
"input('y', float)",
"input('r', float)",
"input('R', float)",
"",
"output('shape', fab.shapes.cylinder(x,y, zmin, zmax, R) & ~fab.shapes.cylinder(x, y, zmin, zmax, r))",
"",
"# UI",
"sb.ui.wireframe([(x, y, zmin), (x, y, zmax)])",
"sb.ui.wireframe([(x, y, zmax), (x, y, zmax + r)])",
"sb.ui.wireframe([(x, y,zmin), (x, y, zmin + R)])",
"",
"sb.ui.wireframe([",
" (math.cos(i/36. * 2*math.pi) * R + x, ",
" math.sin(i/36. * 2*math.pi) * R + y, zmin)",
" for i in range(36)], close=True)",
"",
"sb.ui.wireframe([",
" (math.cos(i/36. * 2*math.pi) * r + x,",
" math.sin(i/36. * 2*math.pi) * r + y, zmax)",
" for i in range(36)], close=True)",
"",
"sb.ui.point(x, y, zmin)",
"sb.ui.point(x, y, zmax)",
"sb.ui.point(x, y, zmin + R, drag=(None, None, R))",
"sb.ui.point(x, y, zmax + r, drag=(None, None, r))",
""
],
"uid": 0
},
{
"datums": [
{
"expr": "\u0011[__0.__1]",
"name": "zmin",
"type": "float",
"uid": 0
},
{
"expr": "self.zmin+4",
"name": "zmax",
"type": "float",
"uid": 1
},
{
"expr": "\u0011[__0.__2]",
"name": "x",
"type": "float",
"uid": 2
},
{
"expr": "\u0011[__0.__3]",
"name": "y",
"type": "float",
"uid": 3
},
{
"expr": "0",
"name": "r",
"type": "float",
"uid": 4
},
{
"expr": "r0.R+2",
"name": "R",
"type": "float",
"uid": 5
},
{
"expr": "\u0012fab.types.Shape('aam__f1-r+qXqYf13.35a-f20Z-Zf24nam__f1-r+qXqYf0a-f20Z-Zf24',float('-13.350000'),float('-13.350000'),float('20.000000'),float('13.350000'),float('13.350000'),float('24.000000'))",
"name": "shape",
"type": "_fabtypes.Shape",
"uid": 6
}
],
"inspector": [
431.2953681484671,
-130.18670181885773
],
"name": "r1",
"script": [
"import fab",
"import math",
"",
"title('Ring (Z)')",
"",
"input('zmin', float)",
"input('zmax', float)",
"input('x', float)",
"input('y', float)",
"input('r', float)",
"input('R', float)",
"",
"output('shape', fab.shapes.cylinder(x,y, zmin, zmax, R) & ~fab.shapes.cylinder(x, y, zmin, zmax, r))",
"",
"# UI",
"sb.ui.wireframe([(x, y, zmin), (x, y, zmax)])",
"sb.ui.wireframe([(x, y, zmax), (x, y, zmax + r)])",
"sb.ui.wireframe([(x, y,zmin), (x, y, zmin + R)])",
"",
"sb.ui.wireframe([",
" (math.cos(i/36. * 2*math.pi) * R + x, ",
" math.sin(i/36. * 2*math.pi) * R + y, zmin)",
" for i in range(36)], close=True)",
"",
"sb.ui.wireframe([",
" (math.cos(i/36. * 2*math.pi) * r + x,",
" math.sin(i/36. * 2*math.pi) * r + y, zmax)",
" for i in range(36)], close=True)",
"",
"sb.ui.point(x, y, zmin)",
"sb.ui.point(x, y, zmax)",
"sb.ui.point(x, y, zmin + R, drag=(None, None, R))",
"sb.ui.point(x, y, zmax + r, drag=(None, None, r))",
""
],
"uid": 1
},
{
"datums": [
{
"expr": "\u0011[__0.__6,__4.__4,__7.__2]",
"name": "shape",
"type": "_fabtypes.Shape",
"uid": 0
},
{
"expr": "\u0012fab.types.Shape('iiaam__f1-r+qXqYf11.35a-f0Z-Zf20nam__f1-r+qXqYf9.35a-f0Z-Zf20iiiiiiiiiiim-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f0.866025X*f0.5Y+*f-0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f0.5X*f0.866025Y+*f-0.866025X*f0.5Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1Y+*f-1X*f6.12323e-17Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f-0.866025X*f0.5Y+*f-0.5X*f-0.866025Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f-1X*f1.22465e-16Y+*f-1.22465e-16X*f-1Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f-0.866025X*f-0.5Y+*f0.5X*f-0.866025Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qY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f-14.1qYf1a-f20Z-Zf24',float('-13.350000'),float('-13.350000'),float('0.000000'),float('13.350000'),float('13.350000'),float('24.000000'))",
"name": "out",
"type": "_fabtypes.Shape",
"uid": 1
}
],
"inspector": [
1397.8856477978964,
249.35923996288665
],
"name": "m0",
"script": [
"import fab",
"",
"title('Mesh (.stl)')",
"",
"input('shape', fab.types.Shape)",
"output('out', shape)",
"",
"sb.export.stl(shape)",
""
],
"uid": 2
},
{
"datums": [
{
"expr": "r0.x-r0.R+self.r/2",
"name": "x",
"type": "float",
"uid": 0
},
{
"expr": "r0.y",
"name": "y",
"type": "float",
"uid": 1
},
{
"expr": "r0.zmin",
"name": "zmin",
"type": "float",
"uid": 2
},
{
"expr": "r0.zmax",
"name": "zmax",
"type": "float",
"uid": 3
},
{
"expr": "1/2",
"name": "r",
"type": "float",
"uid": 4
},
{
"expr": "\u0012fab.types.Shape('am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20',float('-11.600000'),float('-0.500000'),float('0.000000'),float('-10.600000'),float('0.500000'),float('20.000000'))",
"name": "shape",
"type": "_fabtypes.Shape",
"uid": 5
}
],
"inspector": [
203,
458
],
"name": "grips",
"script": [
"import fab",
"import math",
"",
"title('Cylinder (Z)')",
"",
"input('x', float)",
"input('y', float)",
"input('zmin', float)",
"input('zmax', float)",
"input('r', float)",
"",
"output('shape', fab.shapes.cylinder(x, y, zmin, zmax, r))",
"",
"# UI",
"sb.ui.wireframe([(x, y, zmin), (x, y, zmax)])",
"sb.ui.wireframe([(x, y, zmin), (x+r, y, zmin)])",
"",
"sb.ui.wireframe([",
" (math.cos(i/36. * 2*math.pi) * r + x,",
" math.sin(i/36. * 2*math.pi) * r + y, zmin)",
" for i in range(36)], close=True)",
"",
"sb.ui.wireframe([",
" (math.cos(i/36. * 2*math.pi) * r + x,",
" math.sin(i/36. * 2*math.pi) * r + y, zmax)",
" for i in range(36)], close=True)",
"",
"sb.ui.point(x, y, zmin)",
"sb.ui.point(x, y, zmax)",
"sb.ui.point(x + r, y, zmin, drag=(r, None, None))",
""
],
"uid": 3
},
{
"datums": [
{
"expr": "\u0011[__3.__5]",
"name": "shape",
"type": "_fabtypes.Shape",
"uid": 0
},
{
"expr": "r0.x",
"name": "x",
"type": "float",
"uid": 1
},
{
"expr": "r0.y",
"name": "y",
"type": "float",
"uid": 2
},
{
"expr": "12",
"name": "n",
"type": "int",
"uid": 3
},
{
"expr": "\u0012fab.types.Shape('iiiiiiiiiiim-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f0.866025X*f0.5Y+*f-0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f0.5X*f0.866025Y+*f-0.866025X*f0.5Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1Y+*f-1X*f6.12323e-17Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f-0.866025X*f0.5Y+*f-0.5X*f-0.866025Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f-1X*f1.22465e-16Y+*f-1.22465e-16X*f-1Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f-0.866025X*f-0.5Y+*f0.5X*f-0.866025Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f-0.5X*f-0.866025Y+*f0.866025X*f-0.5Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f-1.83697e-16X*f-1Y+*f1X*f-1.83697e-16Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20m-Xf0-Yf0-Zf0m+*f0.866025X*f-0.5Y+*f0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-11.1qYf0.5a-f0Z-Zf20',float('-11.600000'),float('-11.600000'),float('0.000000'),float('11.600000'),float('11.600000'),float('20.000000'))",
"name": "array",
"type": "_fabtypes.Shape",
"uid": 4
}
],
"inspector": [
599,
609
],
"name": "a0",
"script": [
"import fab",
"import math",
"",
"title('Array (polar)')",
"",
"input('shape', fab.types.Shape)",
"input('x', float)",
"input('y', float)",
"input('n', int)",
"",
"output('array', fab.shapes.iterate_polar(shape, x, y, n))",
"",
"# UI",
"sb.ui.wireframe([",
" (math.cos(i/36. * 2*math.pi) * 0.3 + x,",
" math.sin(i/36. * 2*math.pi) * 0.3 + y, 0)",
" for i in range(36)], close=True, color=sb.color.teal)",
"",
"sb.ui.point(x, y, 0, color=sb.color.teal)",
""
],
"uid": 4
},
{
"datums": [
{
"expr": "r1.x-r1.R-.75",
"name": "x",
"type": "float",
"uid": 0
},
{
"expr": "r1.y",
"name": "y",
"type": "float",
"uid": 1
},
{
"expr": "r1.zmin",
"name": "zmin",
"type": "float",
"uid": 2
},
{
"expr": "r1.zmax",
"name": "zmax",
"type": "float",
"uid": 3
},
{
"expr": "1",
"name": "r",
"type": "float",
"uid": 4
},
{
"expr": "\u0012fab.types.Shape('am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24',float('-15.100000'),float('-1.000000'),float('20.000000'),float('-13.100000'),float('1.000000'),float('24.000000'))",
"name": "shape",
"type": "_fabtypes.Shape",
"uid": 5
}
],
"inspector": [
18.0930387203656,
-580.1080539717228
],
"name": "knurl",
"script": [
"import fab",
"import math",
"",
"title('Cylinder (Z)')",
"",
"input('x', float)",
"input('y', float)",
"input('zmin', float)",
"input('zmax', float)",
"input('r', float)",
"",
"output('shape', fab.shapes.cylinder(x, y, zmin, zmax, r))",
"",
"# UI",
"sb.ui.wireframe([(x, y, zmin), (x, y, zmax)])",
"sb.ui.wireframe([(x, y, zmin), (x+r, y, zmin)])",
"",
"sb.ui.wireframe([",
" (math.cos(i/36. * 2*math.pi) * r + x,",
" math.sin(i/36. * 2*math.pi) * r + y, zmin)",
" for i in range(36)], close=True)",
"",
"sb.ui.wireframe([",
" (math.cos(i/36. * 2*math.pi) * r + x,",
" math.sin(i/36. * 2*math.pi) * r + y, zmax)",
" for i in range(36)], close=True)",
"",
"sb.ui.point(x, y, zmin)",
"sb.ui.point(x, y, zmax)",
"sb.ui.point(x + r, y, zmin, drag=(r, None, None))",
""
],
"uid": 5
},
{
"datums": [
{
"expr": "\u0011[__5.__5]",
"name": "shape",
"type": "_fabtypes.Shape",
"uid": 0
},
{
"expr": "r1.x",
"name": "x",
"type": "float",
"uid": 1
},
{
"expr": "r1.y",
"name": "y",
"type": "float",
"uid": 2
},
{
"expr": "36",
"name": "n",
"type": "int",
"uid": 3
},
{
"expr": "\u0012fab.types.Shape('iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiim-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24m-Xf0-Yf0-Zf0m+*f0.984808X*f0.173648Y+*f-0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24m-X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xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24m-Xf0-Yf0-Zf0m+*f0.866025X*f-0.5Y+*f0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24m-Xf0-Yf0-Zf0m+*f0.939693X*f-0.34202Y+*f0.34202X*f0.939693Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24',float('-15.100000'),float('-15.100000'),float('20.000000'),float('15.100000'),float('15.100000'),float('24.000000'))",
"name": "array",
"type": "_fabtypes.Shape",
"uid": 4
}
],
"inspector": [
428.5788546886607,
-530.3521974907175
],
"name": "a1",
"script": [
"import fab",
"import math",
"",
"title('Array (polar)')",
"",
"input('shape', fab.types.Shape)",
"input('x', float)",
"input('y', float)",
"input('n', int)",
"",
"output('array', fab.shapes.iterate_polar(shape, x, y, n))",
"",
"# UI",
"sb.ui.wireframe([",
" (math.cos(i/36. * 2*math.pi) * 0.3 + x,",
" math.sin(i/36. * 2*math.pi) * 0.3 + y, 0)",
" for i in range(36)], close=True, color=sb.color.teal)",
"",
"sb.ui.point(x, y, 0, color=sb.color.teal)",
""
],
"uid": 6
},
{
"datums": [
{
"expr": "\u0011[__1.__6]",
"name": "a",
"type": "_fabtypes.Shape",
"uid": 0
},
{
"expr": "\u0011[__6.__4]",
"name": "b",
"type": "_fabtypes.Shape",
"uid": 1
},
{
"expr": "\u0012fab.types.Shape('aaam__f1-r+qXqYf13.35a-f20Z-Zf24nam__f1-r+qXqYf0a-f20Z-Zf24niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiim-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.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+*f0.766044X*f0.642788Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24m-Xf0-Yf0-Zf0m+*f0.866025X*f-0.5Y+*f0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24m-Xf0-Yf0-Zf0m+*f0.939693X*f-0.34202Y+*f0.34202X*f0.939693Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0am__f1-r+q-Xf-14.1qYf1a-f20Z-Zf24',float('-13.350000'),float('-13.350000'),float('20.000000'),float('13.350000'),float('13.350000'),float('24.000000'))",
"name": "shape",
"type": "_fabtypes.Shape",
"uid": 2
}
],
"inspector": [
987.2014251799495,
-272.52639572550726
],
"name": "d0",
"script": [
"import fab.types",
"",
"title('Difference')",
"input('a', fab.types.Shape)",
"input('b', fab.types.Shape)",
"",
"output('shape', a & ~b)",
""
],
"uid": 7
}
],
"protocol": 6,
"type": "sb"
}