@buerli.io/headless 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/build/cjs/history.js +1964 -1952
- package/build/cjs/index.js +35 -59
- package/build/cjs/solid.js +478 -467
- package/build/cjs/utils/meshes.js +24 -24
- package/build/cjs/utils/selection.js +32 -32
- package/build/esm/history.js +1959 -1949
- package/build/esm/index.js +8 -8
- package/build/esm/solid.js +472 -462
- package/build/esm/utils/meshes.js +20 -20
- package/build/esm/utils/selection.js +25 -25
- package/build/types/history.d.ts +1643 -1641
- package/build/types/index.d.ts +29 -29
- package/build/types/solid.d.ts +519 -475
- package/build/types/utils/meshes.d.ts +14 -14
- package/build/types/utils/selection.d.ts +4 -4
- package/package.json +38 -38
package/build/types/history.d.ts
CHANGED
|
@@ -1,1641 +1,1643 @@
|
|
|
1
|
-
import { BooleanOperationType, ChamferType, FlipType, ReorientedType, WorkAxisType, WorkCoordSystemType, WorkPlaneType, WorkPointType, ViewType,
|
|
2
|
-
import { DrawingID, ObjectIdent, ObjectID,
|
|
3
|
-
import { BufferGeometry, Material, Object3D, Scene } from 'three';
|
|
4
|
-
/**
|
|
5
|
-
* History based modeling is similar to solid modeling, but it is non-destructive and
|
|
6
|
-
* parametric. You can move back and forth in the modeling history and create feature
|
|
7
|
-
* expressions which you can alter at a later time, prompting your model to re-calculate.
|
|
8
|
-
* Use this for assembly and variant configurators.
|
|
9
|
-
*
|
|
10
|
-
* > The history modeling approach relies heavily on the underlying `assemblyBuilder ClassCAD API`.
|
|
11
|
-
* Since this part of the API is still under construction, the interfaces of the history functions
|
|
12
|
-
* can still change.
|
|
13
|
-
*
|
|
14
|
-
* ```sh
|
|
15
|
-
* npm install @buerli.io/headless
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* ```js
|
|
19
|
-
* import {
|
|
20
|
-
* const cad = new
|
|
21
|
-
* cad.init(async api => {
|
|
22
|
-
* // Your code goes here
|
|
23
|
-
* })
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare type ApiHistory = {
|
|
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
|
-
* @param productId id of the product where the views
|
|
164
|
-
* @param
|
|
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
|
-
* @param
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* @
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
*
|
|
216
|
-
* @param
|
|
217
|
-
* @param
|
|
218
|
-
*
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
*
|
|
241
|
-
* @param
|
|
242
|
-
* @param
|
|
243
|
-
* @
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
*
|
|
253
|
-
* @param
|
|
254
|
-
* @param
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
* @
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
*
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
*
|
|
270
|
-
* @param
|
|
271
|
-
* @param
|
|
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
|
-
* @param
|
|
346
|
-
* @
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
* const
|
|
353
|
-
*
|
|
354
|
-
* const
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
* const
|
|
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
|
-
* @param
|
|
409
|
-
* @param
|
|
410
|
-
* @param
|
|
411
|
-
* @param
|
|
412
|
-
* @param
|
|
413
|
-
* @param
|
|
414
|
-
* @param
|
|
415
|
-
* @param
|
|
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
|
-
* @param
|
|
473
|
-
* @param
|
|
474
|
-
* @param
|
|
475
|
-
* @
|
|
476
|
-
* @
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
*
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
*
|
|
498
|
-
* @param
|
|
499
|
-
* @param
|
|
500
|
-
* @
|
|
501
|
-
* @
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
*
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
*
|
|
510
|
-
* @param
|
|
511
|
-
* @param
|
|
512
|
-
* @
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
*
|
|
527
|
-
* @param
|
|
528
|
-
* @param
|
|
529
|
-
* @
|
|
530
|
-
* @
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
*
|
|
535
|
-
* @
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
*
|
|
540
|
-
* @param
|
|
541
|
-
* @
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
*
|
|
559
|
-
* @
|
|
560
|
-
* @
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
*
|
|
565
|
-
* @param
|
|
566
|
-
* @param
|
|
567
|
-
* @
|
|
568
|
-
* @
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
*
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
*
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
*
|
|
598
|
-
* @param
|
|
599
|
-
* @param
|
|
600
|
-
* @param
|
|
601
|
-
* @param
|
|
602
|
-
* @
|
|
603
|
-
* @
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
*
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
*
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
*
|
|
641
|
-
* @
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
*
|
|
654
|
-
* @param
|
|
655
|
-
* @param
|
|
656
|
-
*
|
|
657
|
-
* @
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
}) => Promise<
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
*
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
*
|
|
678
|
-
*
|
|
679
|
-
*
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
* return
|
|
683
|
-
* @
|
|
684
|
-
*/
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
*
|
|
699
|
-
*
|
|
700
|
-
*
|
|
701
|
-
*
|
|
702
|
-
*
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
*
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
*
|
|
716
|
-
*
|
|
717
|
-
*
|
|
718
|
-
*
|
|
719
|
-
*
|
|
720
|
-
* //
|
|
721
|
-
*
|
|
722
|
-
* const
|
|
723
|
-
* const
|
|
724
|
-
* const
|
|
725
|
-
* const
|
|
726
|
-
*
|
|
727
|
-
* const
|
|
728
|
-
*
|
|
729
|
-
*
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
*
|
|
734
|
-
*
|
|
735
|
-
*
|
|
736
|
-
*
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
* const
|
|
742
|
-
* const
|
|
743
|
-
*
|
|
744
|
-
*
|
|
745
|
-
*
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
* const
|
|
749
|
-
* const
|
|
750
|
-
* api.
|
|
751
|
-
*
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
*
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
*
|
|
763
|
-
*
|
|
764
|
-
*
|
|
765
|
-
*
|
|
766
|
-
* const
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
*
|
|
770
|
-
*
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
*
|
|
775
|
-
*
|
|
776
|
-
*
|
|
777
|
-
*
|
|
778
|
-
*
|
|
779
|
-
*
|
|
780
|
-
*
|
|
781
|
-
*
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
*
|
|
790
|
-
*
|
|
791
|
-
* const
|
|
792
|
-
* api.
|
|
793
|
-
*
|
|
794
|
-
*
|
|
795
|
-
*
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
*
|
|
803
|
-
* @
|
|
804
|
-
*
|
|
805
|
-
*
|
|
806
|
-
*
|
|
807
|
-
*
|
|
808
|
-
*
|
|
809
|
-
*
|
|
810
|
-
*
|
|
811
|
-
*
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
*
|
|
816
|
-
*
|
|
817
|
-
*
|
|
818
|
-
*
|
|
819
|
-
*
|
|
820
|
-
*
|
|
821
|
-
*
|
|
822
|
-
*
|
|
823
|
-
* @
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
*
|
|
828
|
-
*
|
|
829
|
-
*
|
|
830
|
-
*
|
|
831
|
-
*
|
|
832
|
-
*
|
|
833
|
-
*
|
|
834
|
-
*
|
|
835
|
-
*
|
|
836
|
-
*
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
*
|
|
841
|
-
*
|
|
842
|
-
*
|
|
843
|
-
*
|
|
844
|
-
*
|
|
845
|
-
*
|
|
846
|
-
*
|
|
847
|
-
*
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
*
|
|
851
|
-
*
|
|
852
|
-
*
|
|
853
|
-
* const
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
*
|
|
860
|
-
*
|
|
861
|
-
*
|
|
862
|
-
*
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
*
|
|
866
|
-
*
|
|
867
|
-
*
|
|
868
|
-
*
|
|
869
|
-
*
|
|
870
|
-
*
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
*
|
|
875
|
-
*
|
|
876
|
-
*
|
|
877
|
-
*
|
|
878
|
-
*
|
|
879
|
-
*
|
|
880
|
-
* @
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
*
|
|
888
|
-
* @param
|
|
889
|
-
* @param
|
|
890
|
-
* @
|
|
891
|
-
*
|
|
892
|
-
*
|
|
893
|
-
*
|
|
894
|
-
*
|
|
895
|
-
*
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
*
|
|
903
|
-
*
|
|
904
|
-
*
|
|
905
|
-
* @param
|
|
906
|
-
* @param
|
|
907
|
-
* @
|
|
908
|
-
* @
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
*
|
|
914
|
-
*
|
|
915
|
-
*
|
|
916
|
-
*
|
|
917
|
-
*
|
|
918
|
-
*
|
|
919
|
-
*
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
*
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
*
|
|
928
|
-
*
|
|
929
|
-
*
|
|
930
|
-
* @param
|
|
931
|
-
* @param
|
|
932
|
-
* @param
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
*
|
|
939
|
-
*
|
|
940
|
-
*
|
|
941
|
-
*
|
|
942
|
-
*
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
*
|
|
951
|
-
* @param
|
|
952
|
-
*
|
|
953
|
-
* @param
|
|
954
|
-
* @
|
|
955
|
-
*
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
*
|
|
962
|
-
* @
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
*
|
|
967
|
-
*
|
|
968
|
-
* [
|
|
969
|
-
*
|
|
970
|
-
*
|
|
971
|
-
*
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
*
|
|
976
|
-
*
|
|
977
|
-
*
|
|
978
|
-
* @param
|
|
979
|
-
* @
|
|
980
|
-
*
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
*
|
|
985
|
-
*
|
|
986
|
-
*
|
|
987
|
-
* @
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
*
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
*
|
|
996
|
-
*
|
|
997
|
-
*
|
|
998
|
-
*
|
|
999
|
-
*
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
*
|
|
1004
|
-
*
|
|
1005
|
-
*
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
*
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
*
|
|
1014
|
-
*
|
|
1015
|
-
*
|
|
1016
|
-
*
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
*
|
|
1021
|
-
*
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
/**
|
|
1028
|
-
* Returns
|
|
1029
|
-
*
|
|
1030
|
-
*
|
|
1031
|
-
* @
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
*
|
|
1041
|
-
*
|
|
1042
|
-
* @param
|
|
1043
|
-
* @
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
*
|
|
1055
|
-
* @example // tbd
|
|
1056
|
-
* @return
|
|
1057
|
-
*/
|
|
1058
|
-
|
|
1059
|
-
/**
|
|
1060
|
-
* Returns the
|
|
1061
|
-
*
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
*
|
|
1066
|
-
*
|
|
1067
|
-
*
|
|
1068
|
-
*
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
*
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
*
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
*
|
|
1086
|
-
*
|
|
1087
|
-
*
|
|
1088
|
-
* @
|
|
1089
|
-
* //
|
|
1090
|
-
*
|
|
1091
|
-
*
|
|
1092
|
-
*
|
|
1093
|
-
*
|
|
1094
|
-
*
|
|
1095
|
-
*
|
|
1096
|
-
*
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
*
|
|
1101
|
-
*
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
*
|
|
1109
|
-
*
|
|
1110
|
-
* @
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
*
|
|
1115
|
-
*
|
|
1116
|
-
*
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
*
|
|
1124
|
-
*
|
|
1125
|
-
*
|
|
1126
|
-
* @
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1132
|
-
*
|
|
1133
|
-
*
|
|
1134
|
-
*
|
|
1135
|
-
*
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
*
|
|
1141
|
-
* @param id id of the instance or
|
|
1142
|
-
* @param
|
|
1143
|
-
* @
|
|
1144
|
-
* @return
|
|
1145
|
-
*/
|
|
1146
|
-
|
|
1147
|
-
/**
|
|
1148
|
-
* Returns
|
|
1149
|
-
* @
|
|
1150
|
-
* @param
|
|
1151
|
-
* @
|
|
1152
|
-
* @
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
*
|
|
1157
|
-
*
|
|
1158
|
-
*
|
|
1159
|
-
*
|
|
1160
|
-
*
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
*
|
|
1166
|
-
* @param
|
|
1167
|
-
* @
|
|
1168
|
-
* @
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
*
|
|
1174
|
-
* @param
|
|
1175
|
-
* @
|
|
1176
|
-
* @
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
*
|
|
1182
|
-
* @param
|
|
1183
|
-
* @
|
|
1184
|
-
* @
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
*
|
|
1190
|
-
* @param
|
|
1191
|
-
* @
|
|
1192
|
-
* @
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
*
|
|
1198
|
-
* @param
|
|
1199
|
-
* @param
|
|
1200
|
-
* @example // tbd
|
|
1201
|
-
* @return
|
|
1202
|
-
*/
|
|
1203
|
-
|
|
1204
|
-
/**
|
|
1205
|
-
* Returns
|
|
1206
|
-
*
|
|
1207
|
-
*
|
|
1208
|
-
*
|
|
1209
|
-
*
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
*
|
|
1217
|
-
*
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
*
|
|
1222
|
-
*
|
|
1223
|
-
* @
|
|
1224
|
-
* @
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
*
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
*
|
|
1237
|
-
* @
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
*
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
*
|
|
1248
|
-
* @
|
|
1249
|
-
* @
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
*
|
|
1262
|
-
* @
|
|
1263
|
-
*
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1266
|
-
* return
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
*
|
|
1274
|
-
* @param
|
|
1275
|
-
* @param
|
|
1276
|
-
* @
|
|
1277
|
-
* @
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
*
|
|
1285
|
-
*
|
|
1286
|
-
* @param
|
|
1287
|
-
* @
|
|
1288
|
-
*
|
|
1289
|
-
*
|
|
1290
|
-
*
|
|
1291
|
-
*
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
*
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
*
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
*
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
*
|
|
1321
|
-
* @param
|
|
1322
|
-
* @param
|
|
1323
|
-
* @example // tbd
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
*
|
|
1330
|
-
*
|
|
1331
|
-
* @param
|
|
1332
|
-
* @
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
*
|
|
1342
|
-
* @
|
|
1343
|
-
*
|
|
1344
|
-
*
|
|
1345
|
-
*
|
|
1346
|
-
*
|
|
1347
|
-
*
|
|
1348
|
-
*
|
|
1349
|
-
* return
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
*
|
|
1355
|
-
* @param
|
|
1356
|
-
* @param
|
|
1357
|
-
* @
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
*
|
|
1370
|
-
*
|
|
1371
|
-
*
|
|
1372
|
-
*
|
|
1373
|
-
*
|
|
1374
|
-
*
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
*
|
|
1380
|
-
* @param
|
|
1381
|
-
*
|
|
1382
|
-
* @param
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
/**
|
|
1394
|
-
* Creates a
|
|
1395
|
-
*
|
|
1396
|
-
* @param partId id of the part where the
|
|
1397
|
-
* @param operations ids of the operations which are used for this
|
|
1398
|
-
* e.g. box, extrusion, chamfer operation
|
|
1399
|
-
* @param
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
*
|
|
1406
|
-
*
|
|
1407
|
-
* @param
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
*
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
/** optional
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
/**
|
|
1489
|
-
|
|
1490
|
-
/**
|
|
1491
|
-
|
|
1492
|
-
/** offset in
|
|
1493
|
-
|
|
1494
|
-
/** offset in
|
|
1495
|
-
|
|
1496
|
-
/**
|
|
1497
|
-
|
|
1498
|
-
/** rotation around
|
|
1499
|
-
|
|
1500
|
-
/** rotation around
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
/**
|
|
1507
|
-
|
|
1508
|
-
/**
|
|
1509
|
-
|
|
1510
|
-
/**
|
|
1511
|
-
|
|
1512
|
-
/** offset in
|
|
1513
|
-
|
|
1514
|
-
/** offset in
|
|
1515
|
-
|
|
1516
|
-
/**
|
|
1517
|
-
|
|
1518
|
-
/** rotation around
|
|
1519
|
-
|
|
1520
|
-
/** rotation around
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
/**
|
|
1527
|
-
|
|
1528
|
-
/**
|
|
1529
|
-
|
|
1530
|
-
/**
|
|
1531
|
-
|
|
1532
|
-
/**
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
/**
|
|
1539
|
-
|
|
1540
|
-
/**
|
|
1541
|
-
|
|
1542
|
-
/**
|
|
1543
|
-
|
|
1544
|
-
/** offset in
|
|
1545
|
-
|
|
1546
|
-
/**
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
/**
|
|
1553
|
-
|
|
1554
|
-
/**
|
|
1555
|
-
|
|
1556
|
-
/**
|
|
1557
|
-
|
|
1558
|
-
/**
|
|
1559
|
-
|
|
1560
|
-
/** min and max limit for the
|
|
1561
|
-
|
|
1562
|
-
/** min and max limit for the
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
/**
|
|
1569
|
-
|
|
1570
|
-
/**
|
|
1571
|
-
|
|
1572
|
-
/**
|
|
1573
|
-
|
|
1574
|
-
/** min and max limit for the
|
|
1575
|
-
|
|
1576
|
-
/** min and max limit for the
|
|
1577
|
-
|
|
1578
|
-
/** min and max limit for the z-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
/**
|
|
1585
|
-
|
|
1586
|
-
/**
|
|
1587
|
-
|
|
1588
|
-
/**
|
|
1589
|
-
|
|
1590
|
-
/** min and max limit for the z-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
*
|
|
1597
|
-
*
|
|
1598
|
-
*
|
|
1599
|
-
*
|
|
1600
|
-
*
|
|
1601
|
-
*
|
|
1602
|
-
*
|
|
1603
|
-
*
|
|
1604
|
-
*
|
|
1605
|
-
*
|
|
1606
|
-
*
|
|
1607
|
-
*
|
|
1608
|
-
*
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
number
|
|
1616
|
-
number
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
number
|
|
1622
|
-
number
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
number,
|
|
1627
|
-
number,
|
|
1628
|
-
number,
|
|
1629
|
-
number
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
*
|
|
1635
|
-
* -
|
|
1636
|
-
* -
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1
|
+
import { BooleanOperationType, ChamferType, FlipType, ReorientedType, WorkAxisType, WorkCoordSystemType, WorkPlaneType, WorkPointType, ViewType, ExtrusionType, WorkGeomType, SVGModusType, LimitsParam, DimensionParam, LimitedValue } from '@buerli.io/classcad';
|
|
2
|
+
import { DrawingID, ObjectIdent, ObjectID, GraphicType, InteractionInfo, GeometryElement, DrawingState, BuerliState } from '@buerli.io/core';
|
|
3
|
+
import { BufferGeometry, Material, Object3D, Scene } from 'three';
|
|
4
|
+
/**
|
|
5
|
+
* History based modeling is similar to solid modeling, but it is non-destructive and
|
|
6
|
+
* parametric. You can move back and forth in the modeling history and create feature
|
|
7
|
+
* expressions which you can alter at a later time, prompting your model to re-calculate.
|
|
8
|
+
* Use this for assembly and variant configurators.
|
|
9
|
+
*
|
|
10
|
+
* > The history modeling approach relies heavily on the underlying `assemblyBuilder ClassCAD API`.
|
|
11
|
+
* Since this part of the API is still under construction, the interfaces of the history functions
|
|
12
|
+
* can still change.
|
|
13
|
+
*
|
|
14
|
+
* ```sh
|
|
15
|
+
* npm install @buerli.io/headless
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* ```js
|
|
19
|
+
* import { History } from '@buerli.io/headless'
|
|
20
|
+
* const cad = new History(url)
|
|
21
|
+
* cad.init(async api => {
|
|
22
|
+
* // Your code goes here
|
|
23
|
+
* })
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare type ApiHistory = {
|
|
27
|
+
/**
|
|
28
|
+
* Returns the drawing id of the current headless-session
|
|
29
|
+
* @returns DrawingID
|
|
30
|
+
* @example
|
|
31
|
+
* const drawingId = api.getDrawingId()
|
|
32
|
+
*/
|
|
33
|
+
getDrawingId: () => DrawingID;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the drawing of the current headless-session
|
|
36
|
+
* @returns DrawingState
|
|
37
|
+
* @example
|
|
38
|
+
* const drawing = api.getDrawing()
|
|
39
|
+
* // Get all graphic containers
|
|
40
|
+
* const containers = Object.values(drawing.graphic.containers)
|
|
41
|
+
* containers.forEach(container => {
|
|
42
|
+
* // Get all surfaces
|
|
43
|
+
* const surfaces = container.meshes.map(mesh => mesh.properties.surface)
|
|
44
|
+
* // Filter non cylindric
|
|
45
|
+
* const cylinders = surfaces.filter(surface => surface.type === 'cylinder')
|
|
46
|
+
* // Check if all cylinders have a radius greater than 4
|
|
47
|
+
* cylinders.forEach(meta => expect(meta.radius).toBeGreaterThanOrEqual(4))
|
|
48
|
+
* })
|
|
49
|
+
*/
|
|
50
|
+
getDrawing: () => DrawingState;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the state tree of the current headless-session
|
|
53
|
+
* @returns BuerliState
|
|
54
|
+
* @example
|
|
55
|
+
* const state = api.getState()
|
|
56
|
+
*/
|
|
57
|
+
getState: () => BuerliState;
|
|
58
|
+
/**
|
|
59
|
+
* Sets the global faceting parameters that will stick for this drawing.
|
|
60
|
+
* This defines how detailed solids will be displayed and can yield smaller payloads.
|
|
61
|
+
* @param distanceTol distance tolerance
|
|
62
|
+
* @param angleTol angle tolerance
|
|
63
|
+
* @returns void
|
|
64
|
+
* @example
|
|
65
|
+
* api.setFacetingParameters(0.1, 0)
|
|
66
|
+
*/
|
|
67
|
+
setFacetingParameters: (distanceTol: number, angleTol: number) => Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Adds products as instances to root assembly, assembly instance or assembly template.
|
|
70
|
+
* - If the owner is an instance in the expanded tree, its template in the assembly container will also be updated.
|
|
71
|
+
* - If the onwer is an assembly template, all instances of the template will also be updated
|
|
72
|
+
* @param instances array of objects containing the information of "to add" instances. See following parameter descriptions.
|
|
73
|
+
* @param productId id, identifier or name of the product to instantiate
|
|
74
|
+
* @param ownerId id, identifier or name of the owner of to adding instance, owner can be root assembly, assembly instance or assembly template.
|
|
75
|
+
* @param transformation transformation (origin, x-Dir, y-Dir) of the instance
|
|
76
|
+
* @param name optional name for the instance
|
|
77
|
+
* @param options optional object containing ident property, to define a identifier for the adding instance
|
|
78
|
+
* @return array containing the ids of added instances direct to owner
|
|
79
|
+
* @example // tbd
|
|
80
|
+
*/
|
|
81
|
+
addInstances: (...instances: {
|
|
82
|
+
productId: VID | ObjectIdent;
|
|
83
|
+
ownerId: VID | ObjectIdent;
|
|
84
|
+
transformation: Transform;
|
|
85
|
+
name?: string;
|
|
86
|
+
options?: {
|
|
87
|
+
ident?: ObjectIdent;
|
|
88
|
+
};
|
|
89
|
+
}[]) => Promise<ObjectID[] | null>;
|
|
90
|
+
/**
|
|
91
|
+
* Adds multiple dimensions to products in the 3D view
|
|
92
|
+
* @param dimensions dimensions to be added to products
|
|
93
|
+
* @example
|
|
94
|
+
* // Get the current product
|
|
95
|
+
* const productId = await api.getCurrentProduct()
|
|
96
|
+
*
|
|
97
|
+
* // Create dimensions
|
|
98
|
+
* const dimension1: DimensionType = {
|
|
99
|
+
* productId: productId,
|
|
100
|
+
* dimParam: {
|
|
101
|
+
* dimType: 'LinearDimension',
|
|
102
|
+
* dimLabel: 'Breite = ',
|
|
103
|
+
* dimStartPos: { x: 0, y: 0, z: 0 },
|
|
104
|
+
* dimEndPos: { x: 100, y: 0, z: 0 },
|
|
105
|
+
* dimTextPos: { x: 50, y: -10, z: 0 },
|
|
106
|
+
* dimTextAngle: 0,
|
|
107
|
+
* dimOrientation: 'Horizontal',
|
|
108
|
+
* },
|
|
109
|
+
* dxfView: 'Top',
|
|
110
|
+
* }
|
|
111
|
+
*
|
|
112
|
+
* const dimension2: DimensionType = {
|
|
113
|
+
* productId: productId,
|
|
114
|
+
* dimParam: {
|
|
115
|
+
* dimType: 'LinearDimension',
|
|
116
|
+
* dimLabel: 'Laenge = ',
|
|
117
|
+
* dimStartPos: { x: 0, y: 0, z: 0 },
|
|
118
|
+
* dimEndPos: { x: 0, y: 100, z: 0 },
|
|
119
|
+
* dimTextPos: { x: 10, y: 50, z: 0 },
|
|
120
|
+
* dimTextAngle: 0,
|
|
121
|
+
* dimOrientation: 'Horizontal',
|
|
122
|
+
* },
|
|
123
|
+
* dxfView: 'Top',
|
|
124
|
+
* }
|
|
125
|
+
*
|
|
126
|
+
* // Add the dimensions
|
|
127
|
+
* const dimensionIds = await api.addDimensions(dimension1, dimension2)
|
|
128
|
+
* @return array containing the ids of added dimensions
|
|
129
|
+
*/
|
|
130
|
+
addDimensions: (...dimensions: DimensionType[]) => Promise<ObjectID[] | null>;
|
|
131
|
+
/**
|
|
132
|
+
* Creates different 2D views, depending on the given view types, in the given product.
|
|
133
|
+
* @param productId id of the product where the view will be created in
|
|
134
|
+
* @param viewTypes array of view types. E.g. [ViewType.TOP, ViewType.RIGHT_90, ViewType.ISO, ...
|
|
135
|
+
* @param viewOptions optional object of options (currently color and layer) to set for the views.
|
|
136
|
+
* - color: number value 0 - 256, see AutoCAD Color Index (ACI). 256 = color defined by layer
|
|
137
|
+
* - layer: string value, defines the view's layer
|
|
138
|
+
* - Default = { color: 256, layer: '0'}
|
|
139
|
+
* @example
|
|
140
|
+
* // Optionally add dimensions to the product, see addDimension() or addDimensions()
|
|
141
|
+
* await api.addDimensions(...)
|
|
142
|
+
*
|
|
143
|
+
* // Create the wanted views
|
|
144
|
+
* await api.create2DViews(productId, [ViewType.TOP, ViewType.RIGHT_90, ViewType.ISO], { color: 2, layer: '6'})
|
|
145
|
+
* @return array containing the ids of created views
|
|
146
|
+
*/
|
|
147
|
+
create2DViews: (productId: VID, viewTypes: ViewType[], viewOptions?: ViewOptionsType) => IDs;
|
|
148
|
+
/**
|
|
149
|
+
* This method returns the boundary box of the given views.
|
|
150
|
+
* @param productId id of the product from where the boundary box will returned
|
|
151
|
+
* @param viewTypes array of view types. E.g. 'Top', 'Front', 'Iso', ...
|
|
152
|
+
* @example
|
|
153
|
+
* // After views have been created, see create2DViews(), you can get boundary boxes
|
|
154
|
+
* const bbs = await api.getBoundaryBoxFromViews(productId, ['Top', 'Right_90°', 'Iso'])
|
|
155
|
+
*
|
|
156
|
+
* // Returns for each view a min and max point
|
|
157
|
+
* console.info(bbs) // [[{x: -105, y: -89, z: 0}, {x: 105, y: 55, z: 0}], [...], [...]]
|
|
158
|
+
* @return array of tuples, each tuple contains a min and max value for one of the given view types. The min an max values represent a Vector with x-, y- and z-coordinates.
|
|
159
|
+
*/
|
|
160
|
+
getBoundaryBoxFromViews: (productId: VID, viewTypes?: ViewType[]) => Promise<[Vec, Vec][]>;
|
|
161
|
+
/**
|
|
162
|
+
* Place the 2D views relatively to the origin.
|
|
163
|
+
* @param productId id of the product where the views will be placed in
|
|
164
|
+
* @param viewPositions array of objects, containing the viewType and a vector which defines the moving vector of the given view
|
|
165
|
+
* @example
|
|
166
|
+
* // After the views have been created, see create2DViews(), you can place them relatively to origin {0,0,0}
|
|
167
|
+
* await api.place2DViews(productId, [
|
|
168
|
+
* { viewType: 'Iso', vector: { x: 500, y: 500, z: 0 } },
|
|
169
|
+
* { viewType: 'Right_90°', vector: { x: 500, y: 0, z: 0 } },
|
|
170
|
+
* ])
|
|
171
|
+
*/
|
|
172
|
+
place2DViews: (productId: VID, viewPositions: {
|
|
173
|
+
viewType: ViewType;
|
|
174
|
+
vector: Vec;
|
|
175
|
+
}[]) => Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* Export the placed views as dxf file.
|
|
178
|
+
* @param productId id of the product where the views exist for export
|
|
179
|
+
* @param dxfTemplateFilename optional filename to load different dxf template. E.g. 'StandardTemplate.dxf'
|
|
180
|
+
* @example
|
|
181
|
+
* // After creating and placing the views, see place2DViews(), you can export them
|
|
182
|
+
* // You will get the dxf stream back
|
|
183
|
+
* await api.exportDXF(productId)
|
|
184
|
+
*/
|
|
185
|
+
exportDXF: (productId: VID, dxfTemplateFilename?: string) => Promise<Uint8Array | null>;
|
|
186
|
+
/**
|
|
187
|
+
* Exports the placed views as dxf and converts it into svg stream.
|
|
188
|
+
* @param productId id of the product where the views exist for export
|
|
189
|
+
* @param modus optional modus to define how drawing will fit into svg file,
|
|
190
|
+
* - SVGModusType.WHOLE_DRAWING or SVGModusType.FIT_WHOLE_DRAWING
|
|
191
|
+
* - Default = SVGModusType.FIT_WHOLE_DRAWING
|
|
192
|
+
* @param renderSize optional rendered size [x, y] of the drawing.
|
|
193
|
+
* - x = horizontal size, y = vertical size
|
|
194
|
+
* - Default = 1024 x 768
|
|
195
|
+
* - Effects only if modus = SVGModusType.WHOLE_DRAWING
|
|
196
|
+
* @param dxfTemplateFilename optional filename to load different dxf template. E.g. 'StandardTemplate.dxf'
|
|
197
|
+
* @example
|
|
198
|
+
* // After creating and placing the views, see place2DViews(), you can export them
|
|
199
|
+
* // You will get the svg stream back
|
|
200
|
+
* await api.exportSVG(productId)
|
|
201
|
+
*/
|
|
202
|
+
exportSVG: (productId: VID, modus?: SVGModusType, renderSize?: {
|
|
203
|
+
x: number;
|
|
204
|
+
y: number;
|
|
205
|
+
}, dxfTemplateFilename?: string) => Promise<Uint8Array | null>;
|
|
206
|
+
/**
|
|
207
|
+
* Remove existing dimensions from the view.
|
|
208
|
+
* @param dimensionIds ids of the dimensions to be removed
|
|
209
|
+
* @example
|
|
210
|
+
* // You can remove existing dimensions
|
|
211
|
+
* await api.removeDimensions(dimensionIds)
|
|
212
|
+
*/
|
|
213
|
+
removeDimensions: (dimensionIds: VID[]) => Promise<void>;
|
|
214
|
+
/**
|
|
215
|
+
* Creates a linear pattern operation
|
|
216
|
+
* @param partId Id of the part to create the linear pattern in.
|
|
217
|
+
* @param operations ids of the operations which are used for this linear pattern operation,
|
|
218
|
+
* e.g. box, extrusion, chamfer operation
|
|
219
|
+
* @param references1 references for the first axis of the pattern. E.g. edge / work axis or 2 vertices / work points
|
|
220
|
+
* @param params1 parameter object which includes inverted flag, distance, count and merged flag
|
|
221
|
+
* for the first direction of the pattern.
|
|
222
|
+
* @param references2 optional references for the second axis of the pattern.
|
|
223
|
+
* @param params2 optional parameter object for second direction of pattern.
|
|
224
|
+
* @return id of the linear pattern operation
|
|
225
|
+
*/
|
|
226
|
+
linearPattern: (partId: VID, operations: VID[], references1: VID[], params1: {
|
|
227
|
+
inverted: 0 | 1;
|
|
228
|
+
distance: number | string;
|
|
229
|
+
count: number | string;
|
|
230
|
+
merged: 0 | 1;
|
|
231
|
+
}, references2?: VID[], params2?: {
|
|
232
|
+
inverted: 0 | 1;
|
|
233
|
+
distance: number | string;
|
|
234
|
+
count: number | string;
|
|
235
|
+
}) => ID;
|
|
236
|
+
/**
|
|
237
|
+
* Creates a circular pattern operation
|
|
238
|
+
* @param partId Id of the part to create the circular pattern in.
|
|
239
|
+
* @param operations ids of the operations which are used for this circular pattern operation,
|
|
240
|
+
* e.g. box, extrusion, chamfer operation
|
|
241
|
+
* @param references references for the rotation axis of the pattern. E.g. edge / work axis or 2 vertices / work points
|
|
242
|
+
* @param params parameter object which includes inverted flag, angle, count and merged flag.
|
|
243
|
+
* @return id of the circular pattern operation
|
|
244
|
+
*/
|
|
245
|
+
circularPattern: (partId: VID, operations: VID[], references: VID[], params: {
|
|
246
|
+
inverted: 0 | 1;
|
|
247
|
+
angle: number | string;
|
|
248
|
+
count: number | string;
|
|
249
|
+
merged: 0 | 1;
|
|
250
|
+
}) => ID;
|
|
251
|
+
/**
|
|
252
|
+
* Creates an extrusion operation
|
|
253
|
+
* @param partId Id of the part to create the extrusion in.
|
|
254
|
+
* @param sketchOrRegionIds Id of the sketch to extrude or multiple ids of sketch regions
|
|
255
|
+
* @param type Type of extrusion (up, down, symmetric, custom)
|
|
256
|
+
* @param limit1 Start of extrusion (0 = start at sketch, only for type custom necessary)
|
|
257
|
+
* @param limit2 End of extrusion, which is actually the height
|
|
258
|
+
* @param taperAngle Angle of taper for extrusion
|
|
259
|
+
* @param direction Direction of extrusion
|
|
260
|
+
* @param capEnds If true, ends will be capped, else a sheet will be created
|
|
261
|
+
* @return id of the extrusion operation
|
|
262
|
+
*/
|
|
263
|
+
extrusion: (partId: VID, sketchOrRegionIds: VID | VIDs, type: ExtrusionType, limit1: number | string, limit2: number | string, taperAngle: number | string, direction: Vec<number | string>, capEnds: 0 | 1) => ID;
|
|
264
|
+
/**
|
|
265
|
+
* Creates a revolve operation
|
|
266
|
+
* @param partId Id of the part to create the revolve in.
|
|
267
|
+
* @param sketchOrRegionIds Id of the sketch to extrude or multiple ids of sketch regions
|
|
268
|
+
* @param axisIds Array of ids, either [lineId] or [point1Id, point2Id], ids can be both ccId or graphicId
|
|
269
|
+
* @param angle1 Start of revolve in degrees
|
|
270
|
+
* @param angle2 End of revolve in degrees
|
|
271
|
+
* @param inverted flag, whether to invert the axis or not
|
|
272
|
+
* @return id of the revolve operation
|
|
273
|
+
*/
|
|
274
|
+
revolve: (partId: VID, sketchOrRegionIds: VID | VIDs, axisIds: VID[], angle1: number | string, angle2: number | string, inverted: 0 | 1) => ID;
|
|
275
|
+
/**
|
|
276
|
+
* Creates a boolean operation.
|
|
277
|
+
* @param partId id of the part where the operation will be created on
|
|
278
|
+
* @param type type of boolean operation.
|
|
279
|
+
* @param operations ids of the operations for this boolean operation, e.g. Box, Chamfer.
|
|
280
|
+
* At least two operations are needed. First operation in the array is the basic operation,
|
|
281
|
+
* all following are the tool operations, which will be unified, subtract or intersect with/from the first operation.
|
|
282
|
+
* @example
|
|
283
|
+
* // Creates a box and subtracts a cylinder from it
|
|
284
|
+
* const part = api.createPart('Part')
|
|
285
|
+
* const cyl = api.cylinder(part, [], 10, 100)
|
|
286
|
+
* const box = api.box(part, [], 20, 20, 20)
|
|
287
|
+
* api.boolean(part, BooleanOperationType.Subtraction, [box, cyl])
|
|
288
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
289
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
290
|
+
* @return id of the boolean operation
|
|
291
|
+
*/
|
|
292
|
+
boolean: (partId: VID, type: BooleanOperationType, operations: VID[]) => ID;
|
|
293
|
+
/**
|
|
294
|
+
* Creates a box operation
|
|
295
|
+
* @param partId id of the part where the box will be created
|
|
296
|
+
* @param references reference of work coordinate system to place the box at
|
|
297
|
+
* @param length length of the box (x-axis)
|
|
298
|
+
* @param width width of the box (y-axis)
|
|
299
|
+
* @param height height of the box (z-axis)
|
|
300
|
+
* @example
|
|
301
|
+
* // Creates a box with a length, width and height of 20
|
|
302
|
+
* const part = api.createPart('Part')
|
|
303
|
+
* const box = api.box(part, [], 20, 20, 20)
|
|
304
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
305
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
306
|
+
* @return id of the box operation
|
|
307
|
+
*/
|
|
308
|
+
box: (partId: VID, references: VID[], width: number | string, length: number | string, height: number | string) => ID;
|
|
309
|
+
/**
|
|
310
|
+
* Creates a cylinder operation
|
|
311
|
+
* @param partId id of the part where the cylinder will be created
|
|
312
|
+
* @param references reference of work coordinate system to place the cylinder at
|
|
313
|
+
* @param diameter diameter of the cylinder (x/y-axis)
|
|
314
|
+
* @param height height of the cylinder (z-axis)
|
|
315
|
+
* @example
|
|
316
|
+
* // Creates a cylinder with height = 50 and diameter = 20
|
|
317
|
+
* const part = api.createPart('Part')
|
|
318
|
+
* api.cylinder(part, [], 20, 50)
|
|
319
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
320
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
321
|
+
* @return id of the cylinder operation
|
|
322
|
+
*/
|
|
323
|
+
cylinder: (partId: VID, references: VID[], diameter: number | string, height: number | string) => ID;
|
|
324
|
+
/**
|
|
325
|
+
* Creates a chamfer operation
|
|
326
|
+
* @param partId id of the part where the chamfers will be created
|
|
327
|
+
* @param type type of chamfer operation.
|
|
328
|
+
* @param references edge references where the chmamfers will be created on
|
|
329
|
+
* @param dist1 1st distance of the chamfer from the edge
|
|
330
|
+
* @param dist2 2nd distance of the chamfer from the edge. Optional if type = Equal_Distance or Distance_And_Angle
|
|
331
|
+
* @param angle angle of the chamfer. Optional if type = Equal_Distance or Two_Distances
|
|
332
|
+
* @example
|
|
333
|
+
* // Creates a cylinder and puts a chamfer at the bottom edge
|
|
334
|
+
* const part = api.createPart('Part')
|
|
335
|
+
* api.cylinder(part, [], 10, 100)
|
|
336
|
+
* const bottomEdges = await api.pick(part, 'edge', [{ x: 0, y: 0, z: 0 }])
|
|
337
|
+
* api.chamfer(part, ChamferType.Equal_Distance, bottomEdges, 2, 0, 0)
|
|
338
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
339
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
340
|
+
* @return id of the chamfer operation
|
|
341
|
+
*/
|
|
342
|
+
chamfer: (partId: VID, type: ChamferType, references: VIDs, dist1: number | string, dist2: number | string, angle: number | string) => ID;
|
|
343
|
+
/**
|
|
344
|
+
* Creates a cone operation.
|
|
345
|
+
* @param partId id of the part where the cone will be created
|
|
346
|
+
* @param references reference of work coordinate system to place the cone at
|
|
347
|
+
* @param bDiameter bottom diameter of the cone
|
|
348
|
+
* @param tDiameter top diameter of the cone
|
|
349
|
+
* @param height height of the cone
|
|
350
|
+
* @example
|
|
351
|
+
* // Creates a cone with bottom diameter = 20, top diameter = 0 and height = 20
|
|
352
|
+
* const part = api.createPart('Part')
|
|
353
|
+
* api.cone(part, [], 20, 0, 20)
|
|
354
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
355
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
356
|
+
* @return id of the cone operation
|
|
357
|
+
*/
|
|
358
|
+
cone: (partId: VID, references: VID[], bDiameter: number | string, tDiameter: number | string, height: number | string) => ID;
|
|
359
|
+
/**
|
|
360
|
+
* Creates a fastened constraint between mate1 and mate2 within an assembly.
|
|
361
|
+
* @param id id of the root assembly or an assembly template to create constraints on
|
|
362
|
+
* @param mate1 contains the mate path ids to its 1st part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
363
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
364
|
+
* @param xOffset defines a offset in x-axis from mate1 to mate2
|
|
365
|
+
* @param yOffset defines a offset in y-axis from mate1 to mate2
|
|
366
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
367
|
+
* @param name name of the constraint
|
|
368
|
+
* @param xRotation [optional] defines a rotation of mate2 around x-axis of mate1
|
|
369
|
+
* @param yRotation [optional] defines a rotation of mate2 around y-axis of mate1
|
|
370
|
+
* @param zRotation [optional] defines a rotation of mate2 around z-axis of mate1
|
|
371
|
+
* @example
|
|
372
|
+
* // Defines some consts
|
|
373
|
+
* const orig = { x: 0, y: 0, z: 0 }
|
|
374
|
+
* const xDir = { x: 1, y: 0, z: 0 }
|
|
375
|
+
* const yDir = { x: 0, y: 1, z: 0 }
|
|
376
|
+
* const rot = { x: 0, y: 0, z: 0 }
|
|
377
|
+
* const offset1 = { x: 0, y: 0, z: 0 }
|
|
378
|
+
* const offset2 = { x: 0, y: 0, z: 0 }
|
|
379
|
+
* const offset3 = { x: 15, y: 15, z: 30 }
|
|
380
|
+
*
|
|
381
|
+
* // Creates the root assembly first
|
|
382
|
+
* const rootAsm = await api.createRootAssembly('Root_Assembly')
|
|
383
|
+
*
|
|
384
|
+
* // Creates a part template and adds geometry to it
|
|
385
|
+
* const partTempl1 = await api.createPartAsTemplate('Part_Template1')
|
|
386
|
+
* const wcs1 = await api.createWorkCoordSystem(partTempl1, WorkCoordSystemType.WCS_Custom, [], offset1, rot, false, 'wcs1')
|
|
387
|
+
* const wcs3 = await api.createWorkCoordSystem(partTempl1, WorkCoordSystemType.WCS_Custom, [], offset3, rot, false, 'wcs3')
|
|
388
|
+
* api.box(partTempl1, [wcs1], 30, 30, 30)
|
|
389
|
+
*
|
|
390
|
+
* // Creates another part template and adds geometry to it
|
|
391
|
+
* const partTempl2 = await api.createPartAsTemplate('Part_Template2')
|
|
392
|
+
* const wcs2 = await api.createWorkCoordSystem(partTempl2, WorkCoordSystemType.WCS_Custom, [], offset2, rot, false, 'wcs2')
|
|
393
|
+
* api.cone(partTempl2, [wcs2], 30, 0.1, 30)
|
|
394
|
+
*
|
|
395
|
+
* // Adds the created part templates as instances to the root assembly
|
|
396
|
+
* const prt1 = await api.addInstances(partTempl1, rootAsm, [orig, xDir, yDir])
|
|
397
|
+
* const prt2 = await api.addInstances(partTempl2, rootAsm, [orig, xDir, yDir])
|
|
398
|
+
*
|
|
399
|
+
* // Creates a fastened constraint between the instances
|
|
400
|
+
* await api.createFastenedConstraint(rootAsm, { matePath: [prt1], wcsId: wcs3 }, { matePath: [prt2], wcsId: wcs2 }, 0, 0, 0, 'FC', 0, 0, 0)
|
|
401
|
+
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
402
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
403
|
+
* @return id of the fastened constraint
|
|
404
|
+
*/
|
|
405
|
+
createFastenedConstraint: (id: VID, mate1: MateParam, mate2: MateParam, xOffset: number | string, yOffset: number | string, zOffset: number | string, name: string, xRotation?: number | string, yRotation?: number | string, zRotation?: number | string) => Promise<ObjectID | null>;
|
|
406
|
+
/**
|
|
407
|
+
* Updates multiple fastened constraints
|
|
408
|
+
* @param constraints array of constraint parameter objects. See following parameter descriptions.
|
|
409
|
+
* @param mate1 contains the mate path ids to its 1st part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
410
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
411
|
+
* @param xOffset defines a offset in x-axis from mate1 to mate2
|
|
412
|
+
* @param yOffset defines a offset in y-axis from mate1 to mate2
|
|
413
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
414
|
+
* @param xRotation [optional] defines a rotation of mate2 around x-axis of mate1
|
|
415
|
+
* @param yRotation [optional] defines a rotation of mate2 around y-axis of mate1
|
|
416
|
+
* @param zRotation [optional] defines a rotation of mate2 around z-axis of mate1
|
|
417
|
+
* @example // tbd
|
|
418
|
+
*/
|
|
419
|
+
updateFastenedConstraints: (...constraints: {
|
|
420
|
+
constrId: VID;
|
|
421
|
+
mate1: MateParam;
|
|
422
|
+
mate2: MateParam;
|
|
423
|
+
xOffset: number | string;
|
|
424
|
+
yOffset: number | string;
|
|
425
|
+
zOffset: number | string;
|
|
426
|
+
xRotation?: number | string;
|
|
427
|
+
yRotation?: number | string;
|
|
428
|
+
zRotation?: number | string;
|
|
429
|
+
}[]) => Promise<void>;
|
|
430
|
+
/**
|
|
431
|
+
* Creates a fastened origin constraint for mate1 to the origin (0, 0, 0).
|
|
432
|
+
* @param id id of the root assembly or an assembly template to create constraints on
|
|
433
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
434
|
+
* @param xOffset defines a offset in x-axis from mate1 to mate2
|
|
435
|
+
* @param yOffset defines a offset in y-axis from mate1 to mate2
|
|
436
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
437
|
+
* @param name name of the constraint
|
|
438
|
+
* @param xRotation [optional] defines a rotation of mate2 around x-axis of mate1
|
|
439
|
+
* @param yRotation [optional] defines a rotation of mate2 around y-axis of mate1
|
|
440
|
+
* @param zRotation [optional] defines a rotation of mate2 around z-axis of mate1
|
|
441
|
+
* @example
|
|
442
|
+
* // Defines some consts
|
|
443
|
+
* const orig = { x: 0, y: 0, z: 0 }
|
|
444
|
+
* const xDir = { x: 1, y: 0, z: 0 }
|
|
445
|
+
* const yDir = { x: 0, y: 1, z: 0 }
|
|
446
|
+
* const rot = { x: 0, y: 0, z: 0 }
|
|
447
|
+
* const offset1 = { x: 0, y: 0, z: 0 }
|
|
448
|
+
* const offset2 = { x: 15, y: 15, z: 15 }
|
|
449
|
+
*
|
|
450
|
+
* // Creates the root assembly first
|
|
451
|
+
* const rootAsm = await api.createRootAssembly('Root_Assembly')
|
|
452
|
+
*
|
|
453
|
+
* // Creates a part template and adds geometry to it
|
|
454
|
+
* const partTempl = await api.createPartAsTemplate('Part_Template')
|
|
455
|
+
* const wcs1 = await api.createWorkCoordSystem(partTempl, WorkCoordSystemType.WCS_Custom, [], offset1, rot, false, 'wcs')
|
|
456
|
+
* const wcs2 = await api.createWorkCoordSystem(partTempl, WorkCoordSystemType.WCS_Custom, [], offset2, rot, false, 'wcs')
|
|
457
|
+
* api.box(partTempl, [wcs1], 30, 30, 30)
|
|
458
|
+
*
|
|
459
|
+
* // Adds the created part template as an instance to the root assembly
|
|
460
|
+
* const prt = await api.addInstances(partTempl, rootAsm, [orig, xDir, yDir])
|
|
461
|
+
*
|
|
462
|
+
* // Creates a fastened origin constraint. The box of the part will be centered in origin
|
|
463
|
+
* await api.createFastenedOriginConstraint(rootAsm, { matePath: [prt], wcsId: wcs2 }, 0, 0, 0, 'FOC', 0, 0, 0)
|
|
464
|
+
*
|
|
465
|
+
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
466
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial({ transparent: true, opacity: 0.5 })))
|
|
467
|
+
* @return id of the fastened origin constraint
|
|
468
|
+
*/
|
|
469
|
+
createFastenedOriginConstraint: (id: VID, mate1: MateParam, xOffset: number | string, yOffset: number | string, zOffset: number | string, name: string, xRotation?: number | string, yRotation?: number | string, zRotation?: number | string) => Promise<ObjectID | null>;
|
|
470
|
+
/**
|
|
471
|
+
* Updates multiple fastened origin constraints
|
|
472
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
473
|
+
* @param mate1 contains the mate path ids to its 1st part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
474
|
+
* @param xOffset defines a offset in x-axis from mate1 to mate2
|
|
475
|
+
* @param yOffset defines a offset in y-axis from mate1 to mate2
|
|
476
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
477
|
+
* @param xRotation [optional] defines a rotation of mate2 around x-axis of mate1
|
|
478
|
+
* @param yRotation [optional] defines a rotation of mate2 around y-axis of mate1
|
|
479
|
+
* @param zRotation [optional] defines a rotation of mate2 around z-axis of mate1
|
|
480
|
+
* @example // tbd
|
|
481
|
+
*/
|
|
482
|
+
updateFastenedOriginConstraints: (...constraints: {
|
|
483
|
+
constrId: VID;
|
|
484
|
+
mate1: MateParam;
|
|
485
|
+
xOffset: number | string;
|
|
486
|
+
yOffset: number | string;
|
|
487
|
+
zOffset: number | string;
|
|
488
|
+
xRotation?: number | string;
|
|
489
|
+
yRotation?: number | string;
|
|
490
|
+
zRotation?: number | string;
|
|
491
|
+
}[]) => Promise<void>;
|
|
492
|
+
/**
|
|
493
|
+
* Creates a cylindrical constraint between mate1 and mate2 within an assembly.
|
|
494
|
+
* @param id id of the root assembly or an assembly template to create constraints on
|
|
495
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
496
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
497
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
498
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
499
|
+
* @param name name of the constraint
|
|
500
|
+
* @example // tbd
|
|
501
|
+
* @return id of the cylindrical constraint
|
|
502
|
+
*/
|
|
503
|
+
createCylindricalConstraint: (id: VID, mate1: MateParam, mate2: MateParam, zOffsetLimits: LimitsParam, zRotationLimits: LimitsParam, name: string) => Promise<ObjectID | null>;
|
|
504
|
+
/**
|
|
505
|
+
* Updates multiple cylindrical constraints.
|
|
506
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
507
|
+
* @param constrId id of the constraint to update
|
|
508
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
509
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
510
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
511
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
512
|
+
* @example // tbd
|
|
513
|
+
*/
|
|
514
|
+
updateCylindricalConstraints: (...constraints: {
|
|
515
|
+
constrId: VID;
|
|
516
|
+
mate1: MateParam;
|
|
517
|
+
mate2: MateParam;
|
|
518
|
+
zOffsetLimits: LimitsParam;
|
|
519
|
+
zRotationLimits: LimitsParam;
|
|
520
|
+
}[]) => Promise<void>;
|
|
521
|
+
/**
|
|
522
|
+
* Creates a revolute constraint between mate1 and mate2 within an assembly.
|
|
523
|
+
* @param id id of the root assembly or an assembly template to create constraints on
|
|
524
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
525
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
526
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
527
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
528
|
+
* @param name name of the constraint
|
|
529
|
+
* @example // tbd
|
|
530
|
+
* @return id of the revolute constraint
|
|
531
|
+
*/
|
|
532
|
+
createRevoluteConstraint: (id: VID, mate1: MateParam, mate2: MateParam, zOffset: number | string, zRotationLimits: LimitsParam, name: string) => Promise<ObjectID | null>;
|
|
533
|
+
/**
|
|
534
|
+
* Updates multiple revolute constraints.
|
|
535
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
536
|
+
* @param constrId id of the constraint to update
|
|
537
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
538
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
539
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
540
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
541
|
+
* @example // tbd
|
|
542
|
+
*/
|
|
543
|
+
updateRevoluteConstraints: (...constraints: {
|
|
544
|
+
constrId: VID;
|
|
545
|
+
mate1: MateParam;
|
|
546
|
+
mate2: MateParam;
|
|
547
|
+
zOffset: number | string;
|
|
548
|
+
zRotationLimits: LimitsParam;
|
|
549
|
+
}[]) => Promise<void>;
|
|
550
|
+
/**
|
|
551
|
+
* Creates a slider constraint between mate1 and mate2 within an assembly.
|
|
552
|
+
* @param id id of the root assembly or an assembly template to create constraints on
|
|
553
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
554
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
555
|
+
* @param xOffset defines a offset in x-axis from mate1 to mate2
|
|
556
|
+
* @param yOffset defines a offset in y-axis from mate1 to mate2
|
|
557
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
558
|
+
* @param name name of the constraint
|
|
559
|
+
* @example // tbd
|
|
560
|
+
* @return id of the slider constraint
|
|
561
|
+
*/
|
|
562
|
+
createSliderConstraint: (id: VID, mate1: MateParam, mate2: MateParam, xOffset: number | string, yOffset: number | string, zOffsetLimits: LimitsParam, name: string) => Promise<ObjectID | null>;
|
|
563
|
+
/**
|
|
564
|
+
* Updates multiple slider constraints.
|
|
565
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
566
|
+
* @param constrId id of the constraint to update
|
|
567
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
568
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
569
|
+
* @param xOffset defines a offset in x-axis from mate1 to mate2
|
|
570
|
+
* @param yOffset defines a offset in y-axis from mate1 to mate2
|
|
571
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
572
|
+
* @example // tbd
|
|
573
|
+
*/
|
|
574
|
+
updateSliderConstraints: (...constraints: {
|
|
575
|
+
constrId: VID;
|
|
576
|
+
mate1: MateParam;
|
|
577
|
+
mate2: MateParam;
|
|
578
|
+
xOffset: number | string;
|
|
579
|
+
yOffset: number | string;
|
|
580
|
+
zOffsetLimits: LimitsParam;
|
|
581
|
+
}[]) => Promise<void>;
|
|
582
|
+
/**
|
|
583
|
+
* Creates a planar constraint between mate1 and mate2 within an assembly.
|
|
584
|
+
* @param id id of the root assembly or an assembly template to create constraints on
|
|
585
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
586
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
587
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
588
|
+
* @param xOffsetLimits min and max value of offset along x
|
|
589
|
+
* @param yOffsetLimits min and max value of offset along y
|
|
590
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
591
|
+
* @param name name of the constraint
|
|
592
|
+
* @example // tbd
|
|
593
|
+
* @return id of the planar constraint
|
|
594
|
+
*/
|
|
595
|
+
createPlanarConstraint: (id: VID, mate1: MateParam, mate2: MateParam, zOffset: number | string, xOffsetLimits: LimitsParam, yOffsetLimits: LimitsParam, zRotationLimits: LimitsParam, name: string) => Promise<ObjectID | null>;
|
|
596
|
+
/**
|
|
597
|
+
* Updates multiple planar constraints.
|
|
598
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
599
|
+
* @param constrId id of the constraint to update
|
|
600
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
601
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
602
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
603
|
+
* @param xOffsetLimits min and max value of offset along x
|
|
604
|
+
* @param yOffsetLimits min and max value of offset along y
|
|
605
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
606
|
+
* @example // tbd
|
|
607
|
+
*/
|
|
608
|
+
updatePlanarConstraints: (...constraints: {
|
|
609
|
+
constrId: VID;
|
|
610
|
+
mate1: MateParam;
|
|
611
|
+
mate2: MateParam;
|
|
612
|
+
zOffset: number | string;
|
|
613
|
+
xOffsetLimits: LimitsParam;
|
|
614
|
+
yOffsetLimits: LimitsParam;
|
|
615
|
+
zRotationLimits: LimitsParam;
|
|
616
|
+
}[]) => Promise<void>;
|
|
617
|
+
/**
|
|
618
|
+
* Creates a parallel constraint between mate1 and mate2 within an assembly.
|
|
619
|
+
* @param id id of the root assembly or an assembly template to create constraints on
|
|
620
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
621
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
622
|
+
* @param xOffsetLimits min and max value of offset along x
|
|
623
|
+
* @param yOffsetLimits min and max value of offset along y
|
|
624
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
625
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
626
|
+
* @param name name of the constraint
|
|
627
|
+
* @example // tbd
|
|
628
|
+
* @return id of the parallel constraint
|
|
629
|
+
*/
|
|
630
|
+
createParallelConstraint: (id: VID, mate1: MateParam, mate2: MateParam, xOffsetLimits: LimitsParam, yOffsetLimits: LimitsParam, zOffsetLimits: LimitsParam, zRotationLimits: LimitsParam, name: string) => Promise<ObjectID | null>;
|
|
631
|
+
/**
|
|
632
|
+
* Updates multiple parallel constraints.
|
|
633
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
634
|
+
* @param constrId id of the constraint to update
|
|
635
|
+
* @param mate1 contains the mate path ids to its part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
636
|
+
* @param mate2 contains the mate path ids to its 2nd part and its work coordinate system id, and also the flip (0-5) and reoriented (0-3) states
|
|
637
|
+
* @param xOffsetLimits min and max value of offset along x
|
|
638
|
+
* @param yOffsetLimits min and max value of offset along y
|
|
639
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
640
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
641
|
+
* @example // tbd
|
|
642
|
+
*/
|
|
643
|
+
updateParallelConstraints: (...constraints: {
|
|
644
|
+
constrId: VID;
|
|
645
|
+
mate1: MateParam;
|
|
646
|
+
mate2: MateParam;
|
|
647
|
+
xOffsetLimits: LimitsParam;
|
|
648
|
+
yOffsetLimits: LimitsParam;
|
|
649
|
+
zOffsetLimits: LimitsParam;
|
|
650
|
+
zRotationLimits: LimitsParam;
|
|
651
|
+
}[]) => Promise<void>;
|
|
652
|
+
/**
|
|
653
|
+
* Updates limited value specified (with 'paramName') of multiple constraints
|
|
654
|
+
* @param constrValues array of constraint value objects. See following parameter description for that.
|
|
655
|
+
* @param constrId id of the constraint to update the limited value
|
|
656
|
+
* @param paramName name of the limited parameter
|
|
657
|
+
* @param value new value to set
|
|
658
|
+
*/
|
|
659
|
+
update3dConstraintValues: (...constrValues: {
|
|
660
|
+
constrId: VID;
|
|
661
|
+
paramName: LimitedValue;
|
|
662
|
+
value: number;
|
|
663
|
+
}[]) => Promise<void>;
|
|
664
|
+
/**
|
|
665
|
+
* Creates the buffer geometry of any product (part or assembly).
|
|
666
|
+
* @param productId id of the product to create buffer geometry from
|
|
667
|
+
* @example
|
|
668
|
+
* // Creates a cone with bottom diameter = 20, top diameter = 0 and height = 30
|
|
669
|
+
* const part = api.createPart('Part')
|
|
670
|
+
* api.cone(part, [], 20, 0, 30)
|
|
671
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
672
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
673
|
+
* @return array of buffer geometry
|
|
674
|
+
*/
|
|
675
|
+
createBufferGeometry: (productId: VID) => Promise<BufferGeometry[] | undefined>;
|
|
676
|
+
/**
|
|
677
|
+
* Creates the threeJS scene of any product (part or assembly).
|
|
678
|
+
* @param productId id of the product to create scene from
|
|
679
|
+
* @param options optional object to define different settings.
|
|
680
|
+
* @param meshPerGeometry boolean flag to define if a part/solid will have a mesh for each
|
|
681
|
+
* geometry element or if the elements will be merged to one mesh
|
|
682
|
+
* @return object containing all the created THREE objects like scene, nodes and materials
|
|
683
|
+
* @example // tbd
|
|
684
|
+
*/
|
|
685
|
+
createScene: (productId?: VID, options?: {
|
|
686
|
+
meshPerGeometry?: boolean;
|
|
687
|
+
structureOnly?: boolean;
|
|
688
|
+
}) => Promise<{
|
|
689
|
+
scene: Scene;
|
|
690
|
+
nodes: {
|
|
691
|
+
[key: string]: Object3D;
|
|
692
|
+
};
|
|
693
|
+
materials: {
|
|
694
|
+
[key: string]: Material;
|
|
695
|
+
};
|
|
696
|
+
}>;
|
|
697
|
+
/**
|
|
698
|
+
* Creates one or more expressions.
|
|
699
|
+
* @param partId id or identifier of the part to create the expressions in
|
|
700
|
+
* @param members array of members which contain a name and a value. Value can be an expression, e.g. '2 * laenge'
|
|
701
|
+
* @example
|
|
702
|
+
* // Creates an expression and links it with the width of the box
|
|
703
|
+
* const part = api.createPart('Part')
|
|
704
|
+
* api.createExpressions(part, { name: 'width', value: 20 })
|
|
705
|
+
* api.box(part, [], 'ExpressionSet.width', 20, 20)
|
|
706
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
707
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
708
|
+
* @return true or false, depending on whether creating the expressions was successful or not
|
|
709
|
+
*/
|
|
710
|
+
createExpressions: (partId: VID | ObjectIdent, ...members: {
|
|
711
|
+
name: string;
|
|
712
|
+
value: number | string;
|
|
713
|
+
}[]) => Promise<boolean>;
|
|
714
|
+
/**
|
|
715
|
+
* Creates a new assembly template. This template will be added to the assembly container
|
|
716
|
+
* and can be instantiated multiple times as a sub assembly in the root assembly or in other assembly template.
|
|
717
|
+
* Assembly templates can only be created if the root is already an assembly.
|
|
718
|
+
* @param name [optional] name of the assembly template. Default = 'Assembly'
|
|
719
|
+
* @example
|
|
720
|
+
* // Defines some consts
|
|
721
|
+
* const orig = { x: 0, y: 0, z: 0 }
|
|
722
|
+
* const xDir = { x: 1, y: 0, z: 0 }
|
|
723
|
+
* const yDir = { x: 0, y: 1, z: 0 }
|
|
724
|
+
* const rot = { x: 0, y: 0, z: 0 }
|
|
725
|
+
* const offset1 = { x: 0, y: 0, z: 0 }
|
|
726
|
+
* const offset2 = { x: 0, y: 0, z: 0 }
|
|
727
|
+
* const offset3 = { x: 50, y: 0, z: 0 }
|
|
728
|
+
*
|
|
729
|
+
* // Creates the root assembly first
|
|
730
|
+
* const rootAsm = await api.createRootAssembly('Root_Assembly')
|
|
731
|
+
*
|
|
732
|
+
* // Creates a assembly template
|
|
733
|
+
* const asmTempl = await api.createAssemblyAsTemplate('Assembly_Template')
|
|
734
|
+
*
|
|
735
|
+
* // Creates a part template and adds geometry to it
|
|
736
|
+
* const partTempl1 = await api.createPartAsTemplate('Part_Template1')
|
|
737
|
+
* const wcs1 = await api.createWorkCoordSystem(partTempl1, WorkCoordSystemType.WCS_Custom, [], offset1, rot, false, 'wcs1')
|
|
738
|
+
* api.box(partTempl1, [wcs1], 30, 30, 30)
|
|
739
|
+
*
|
|
740
|
+
* // Creates another part template and adds geometry to it
|
|
741
|
+
* const partTempl2 = await api.createPartAsTemplate('Part_Template2')
|
|
742
|
+
* const wcs2 = await api.createWorkCoordSystem(partTempl2, WorkCoordSystemType.WCS_Custom, [], offset2, rot, false, 'wcs2')
|
|
743
|
+
* api.cone(partTempl2, [wcs2], 30, 0.1, 30)
|
|
744
|
+
*
|
|
745
|
+
* // Adds the created part templates as instances to the assembly
|
|
746
|
+
* // and the assembly itself multiple times to the root assembly
|
|
747
|
+
* const prt1 = await api.addInstances(partTempl1, asmTempl, [orig, xDir, yDir])
|
|
748
|
+
* const prt2 = await api.addInstances(partTempl2, asmTempl, [orig, xDir, yDir])
|
|
749
|
+
* const asm1 = await api.addInstances(asmTempl, rootAsm, [orig, xDir, yDir])
|
|
750
|
+
* const asm2 = await api.addInstances(asmTempl, rootAsm, [offset3, xDir, yDir])
|
|
751
|
+
*
|
|
752
|
+
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
753
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
754
|
+
* @return id of the assembly template
|
|
755
|
+
*/
|
|
756
|
+
createAssemblyAsTemplate: (name?: string) => ID;
|
|
757
|
+
/**
|
|
758
|
+
* Creates a new root assembly. This is the top level assembly.
|
|
759
|
+
* @param name [optional] name of the root assembly. Default = 'AssemblyRoot'
|
|
760
|
+
* @param options optional object containing ident property to define an identifier for the created root assembly
|
|
761
|
+
* @example
|
|
762
|
+
* // Defines some consts
|
|
763
|
+
* const orig = { x: 0, y: 0, z: 0 }
|
|
764
|
+
* const xDir = { x: 1, y: 0, z: 0 }
|
|
765
|
+
* const yDir = { x: 0, y: 1, z: 0 }
|
|
766
|
+
* const rot = { x: 0, y: 0, z: 0 }
|
|
767
|
+
* const offset = { x: 20, y: 0, z: 0 }
|
|
768
|
+
*
|
|
769
|
+
* // Creates the root assembly first
|
|
770
|
+
* const rootAsm = await api.createRootAssembly('Root_Assembly')
|
|
771
|
+
*
|
|
772
|
+
* // Creates a part template and adds geometry to it
|
|
773
|
+
* const partTempl = await api.createPartAsTemplate('Part_Template')
|
|
774
|
+
* const wcs = await api.createWorkCoordSystem(partTempl, WorkCoordSystemType.WCS_Custom, [], offset, rot, false, 'wcs')
|
|
775
|
+
* api.box(partTempl, [wcs], 30, 30, 10)
|
|
776
|
+
*
|
|
777
|
+
* // Adds the created part template as an instance to the root assembly
|
|
778
|
+
* const partRef = await api.addInstances(partTempl, rootAsm, [orig, xDir, yDir])
|
|
779
|
+
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
780
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
781
|
+
* @return id of the root assembly
|
|
782
|
+
*/
|
|
783
|
+
createRootAssembly: (name?: string, options?: {
|
|
784
|
+
ident?: ObjectIdent;
|
|
785
|
+
}) => ID;
|
|
786
|
+
/**
|
|
787
|
+
* Creates a new root part. This is the top level part.
|
|
788
|
+
* @param name [optional] name of the part. Default = 'Part'
|
|
789
|
+
* @example
|
|
790
|
+
* // Creates a box and subtracts a cylinder from it
|
|
791
|
+
* const part = api.createPart('Part')
|
|
792
|
+
* api.cylinder(part, [], 10, 100)
|
|
793
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
794
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
795
|
+
* @return id of the root part
|
|
796
|
+
*/
|
|
797
|
+
createPart: (name?: string) => ID;
|
|
798
|
+
/**
|
|
799
|
+
* Creates a new part template. This template will be added to the part container
|
|
800
|
+
* and can be instantiated multiple times in the root assembly or in assembly templates.
|
|
801
|
+
* Part templates can only be created if the root is already an assembly.
|
|
802
|
+
* @param name [optional] name of the part. Default = 'Part'
|
|
803
|
+
* @example
|
|
804
|
+
* // Defines some consts
|
|
805
|
+
* const orig = { x: 0, y: 0, z: 0 }
|
|
806
|
+
* const xDir = { x: 1, y: 0, z: 0 }
|
|
807
|
+
* const yDir = { x: 0, y: 1, z: 0 }
|
|
808
|
+
* const rot = { x: 0, y: 0, z: 0 }
|
|
809
|
+
* const offset = { x: 20, y: 0, z: 0 }
|
|
810
|
+
*
|
|
811
|
+
* // Creates the root assembly first
|
|
812
|
+
* const rootAsm = await api.createRootAssembly('Root_Assembly')
|
|
813
|
+
*
|
|
814
|
+
* // Creates a part template and adds geometry to it
|
|
815
|
+
* const partTempl = await api.createPartAsTemplate('Part_Template')
|
|
816
|
+
* const wcs = await api.createWorkCoordSystem(partTempl, WorkCoordSystemType.WCS_Custom, [], offset, rot, false, 'wcs')
|
|
817
|
+
* api.box(partTempl, [wcs], 30, 30, 10)
|
|
818
|
+
*
|
|
819
|
+
* // Adds the created part template as an instance to the root assembly
|
|
820
|
+
* const partRef = await api.addInstances(partTempl, rootAsm, [orig, xDir, yDir])
|
|
821
|
+
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
822
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
823
|
+
* @return id of the part template
|
|
824
|
+
*/
|
|
825
|
+
createPartAsTemplate: (name?: string) => ID;
|
|
826
|
+
/**
|
|
827
|
+
* Creates a new work axis for the given part
|
|
828
|
+
* @param partId id of the part to add the new work axis to
|
|
829
|
+
* @param type type of the work axis
|
|
830
|
+
* @param references references for the work axis, needed for all types except 'Custom'
|
|
831
|
+
* @param position position of axis, only needed if type = 'Custom'
|
|
832
|
+
* @param direction direction of axis, only needed if type = 'Custom'
|
|
833
|
+
* @param local if true, work axis is set in local coordinates of part???
|
|
834
|
+
* @param name name of the work axis, if not set default name = 'WorkAxis'
|
|
835
|
+
* @example //tbd
|
|
836
|
+
* @return id of the work axis
|
|
837
|
+
*/
|
|
838
|
+
createWorkAxis: (partId: VID, type: WorkAxisType, references: VID[], position: Vec<number | string>, direction: Vec<number | string>, local: boolean, name?: string) => ID;
|
|
839
|
+
/**
|
|
840
|
+
* Creates a new work coordinate system for the given part.
|
|
841
|
+
* @param partId id of the part to add the new work coord system to
|
|
842
|
+
* @param type type of the work coordinate system
|
|
843
|
+
* @param references references for the work coordinate system (point and 2 axis). If empty array, the work coordinate system will set to origin (0, 0, 0)
|
|
844
|
+
* @param offset offset from work coordinate system in x-, y- and z-direction
|
|
845
|
+
* @param rotation rotation around x-, y- and z-axis from work coordinate system
|
|
846
|
+
* @param inverted inverts the direction of the primary axis
|
|
847
|
+
* @param name name of the work coordinate system, if not set default name = 'WorkCoordSystem'
|
|
848
|
+
* @example
|
|
849
|
+
* // Defines some consts
|
|
850
|
+
* const orig = { x: 0, y: 0, z: 0 }
|
|
851
|
+
* const xDir = { x: 1, y: 0, z: 0 }
|
|
852
|
+
* const yDir = { x: 0, y: 1, z: 0 }
|
|
853
|
+
* const rot = { x: 0, y: 0, z: 0 }
|
|
854
|
+
* const offset1 = { x: 0, y: 0, z: 0 }
|
|
855
|
+
* const offset2 = { x: 0, y: 0, z: 0 }
|
|
856
|
+
* const offset3 = { x: 15, y: 15, z: 30 }
|
|
857
|
+
*
|
|
858
|
+
* // Creates the root assembly first
|
|
859
|
+
* const rootAsm = await api.createRootAssembly('Root_Assembly')
|
|
860
|
+
*
|
|
861
|
+
* // Creates a part template and adds geometry to it
|
|
862
|
+
* const partTempl1 = await api.createPartAsTemplate('Part_Template1')
|
|
863
|
+
* const wcs1 = await api.createWorkCoordSystem(partTempl1, WorkCoordSystemType.WCS_Custom, [], offset1, rot, false, 'wcs1')
|
|
864
|
+
* const wcs3 = await api.createWorkCoordSystem(partTempl1, WorkCoordSystemType.WCS_Custom, [], offset3, rot, false, 'wcs3')
|
|
865
|
+
* api.box(partTempl1, [wcs1], 30, 30, 30)
|
|
866
|
+
*
|
|
867
|
+
* // Creates another part template and adds geometry to it
|
|
868
|
+
* const partTempl2 = await api.createPartAsTemplate('Part_Template2')
|
|
869
|
+
* const wcs2 = await api.createWorkCoordSystem(partTempl2, WorkCoordSystemType.WCS_Custom, [], offset2, rot, false, 'wcs2')
|
|
870
|
+
* api.cone(partTempl2, [wcs2], 30, 0.1, 30)
|
|
871
|
+
*
|
|
872
|
+
* // Adds the created part templates as instances to the root assembly
|
|
873
|
+
* const prt1 = await api.addInstances(partTempl1, rootAsm, [orig, xDir, yDir])
|
|
874
|
+
* const prt2 = await api.addInstances(partTempl2, rootAsm, [orig, xDir, yDir])
|
|
875
|
+
*
|
|
876
|
+
* // Creates a fastened constraint between the instances
|
|
877
|
+
* await api.createFastenedConstraint(rootAsm, { matePath: [prt1], wcsId: wcs3 }, { matePath: [prt2], wcsId: wcs2 }, 0, 0, 0, 0, 0, 'FC')
|
|
878
|
+
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
879
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
880
|
+
* @return id of the work coordinate system
|
|
881
|
+
*/
|
|
882
|
+
createWorkCoordSystem: (partId: VID, type: WorkCoordSystemType, references: VID[], offset: Vec<number | string>, rotation: Vec<number | string>, inverted: boolean, name?: string) => ID;
|
|
883
|
+
/**
|
|
884
|
+
* Creates a new work plane for the given part
|
|
885
|
+
* @param partId id of the part to add the new work plane to
|
|
886
|
+
* @param type type of the work plane
|
|
887
|
+
* @param references references for the work plane, needed for all types except 'Custom'
|
|
888
|
+
* @param offset offset in normal direction, can be used for all types except 'LinePlaneAndAngle'
|
|
889
|
+
* @param angle angle in degrees, needed for type 'LinePlaneAndAngle'
|
|
890
|
+
* @param position position of plane, only needed if type = 'Custom'
|
|
891
|
+
* @param normal normal vector of work plane, only needed if type = 'Custom'
|
|
892
|
+
* @param local if true, work plane is set in local coordinates of part???
|
|
893
|
+
* @param name name of the work plane, if not set default name = 'WorkAxis'
|
|
894
|
+
* @example // tbd
|
|
895
|
+
* @return id of the work plane
|
|
896
|
+
*/
|
|
897
|
+
createWorkPlane: (partId: VID, type: WorkPlaneType, references: VID[], offset: number, angle: number, position: Vec<number | string>, normal: Vec<number | string>, local: boolean, name?: string) => ID;
|
|
898
|
+
/**
|
|
899
|
+
* Creates a new work point for the given part
|
|
900
|
+
* @param partId id of the part to add the new work point to
|
|
901
|
+
* @param type type of the work point
|
|
902
|
+
* @param references references for the work point, needed for all types except 'Custom'
|
|
903
|
+
* @param position position of point, only needed if type = 'Custom'
|
|
904
|
+
* @param direction direction of point, only needed if type = 'Custom'
|
|
905
|
+
* @param local if true, work point is set in local coordinates of part???
|
|
906
|
+
* @param name name of the work point, if not set default name = 'WorkPoint'
|
|
907
|
+
* @example // tbd
|
|
908
|
+
* @return id of the work point
|
|
909
|
+
*/
|
|
910
|
+
createWorkPoint: (partId: VID, type: WorkPointType, references: VID[], position: Vec<number | string>, local: boolean, name?: string) => ID;
|
|
911
|
+
/**
|
|
912
|
+
* Deletes existing expressions.
|
|
913
|
+
* @param partId id or identifier of part to delete expressions from
|
|
914
|
+
* @param members name of members to delete
|
|
915
|
+
* @example
|
|
916
|
+
* // Deletes an expression from part's expression set
|
|
917
|
+
* const part = api.createPart('Part')
|
|
918
|
+
* api.createExpressions(part, { name: 'width', value: 20 }, { name: 'height', value: 40 })
|
|
919
|
+
* api.deleteExpressions(part, ['height'])
|
|
920
|
+
* await api.box(part, [], 'ExpressionSet.width', 20, 20)
|
|
921
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
922
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
923
|
+
* @return true or false, depending on whether deleting the expressions was successful or not
|
|
924
|
+
*/
|
|
925
|
+
deleteExpressions: (partId: VID | ObjectIdent, members: string[]) => Promise<boolean>;
|
|
926
|
+
/**
|
|
927
|
+
* Loads a sketch from a ofb filestream and adds its elements to a new sketch.
|
|
928
|
+
* The id of this new created sketch will be returned.
|
|
929
|
+
*
|
|
930
|
+
* @param partId id of the part we want to create the new sketch and copy the sketch elements into it
|
|
931
|
+
* @param strm stream of ofb file which contains the sketch
|
|
932
|
+
* @param planeId id of the face or workplane to set the new sketch on
|
|
933
|
+
* @param name optional name of the sketch to load from filestream
|
|
934
|
+
* @return id of the new sketch, containing the sketch elements from loaded sketch
|
|
935
|
+
*/
|
|
936
|
+
loadSketch: (partId: VID, strm: ArrayBuffer, planeId: VID, name?: string) => ID;
|
|
937
|
+
/**
|
|
938
|
+
* Copy an existing sketch and adds its elements to a new sketch.
|
|
939
|
+
* The id of this new created sketch will be returned.
|
|
940
|
+
*
|
|
941
|
+
* @param partId id of the part we want to create the new sketch and copy the sketch elements into it
|
|
942
|
+
* @param sketchId id of the sketch to copy
|
|
943
|
+
* @param planeId id of the face or workplane to set the new sketch on
|
|
944
|
+
* @return id of the new sketch, containing the sketch elements form copied sketch
|
|
945
|
+
*/
|
|
946
|
+
copySketch: (partId: VID, sketchId: VID, planeId: VID) => ID;
|
|
947
|
+
/**
|
|
948
|
+
* Place/position the sketch with plane, axis and origin references.
|
|
949
|
+
*
|
|
950
|
+
* @param sketchId id of the sketch to place
|
|
951
|
+
* @param planeId - id of a face or a workplane. This will be the plane where the sketch lies on.
|
|
952
|
+
* If a plane reference already exists, planeId is optional
|
|
953
|
+
* @param invertPlane - if true, the normal of the plane will be inverted
|
|
954
|
+
* @param axisId - optional id of an edge or workaxis. This will be the x-Axis
|
|
955
|
+
* @param isXAxis - if true, the axisId will be the x-axis of the sketch, else the x-Axis will be the crossvector of the normal and the axisId
|
|
956
|
+
* @param invertAxis - if true, the direction of the axis will be inverted
|
|
957
|
+
* @param originId - optional point or vertex of the sketch's origin reference
|
|
958
|
+
*/
|
|
959
|
+
placeSketch: (sketchId: VID, planeId: VID, invertPlane: boolean, axisId: VID, isXAxis: boolean, invertAxis: boolean, originId: VID) => Promise<void>;
|
|
960
|
+
/**
|
|
961
|
+
* Creates a sphere operation
|
|
962
|
+
* @param partId id of the part where the sphere will be created
|
|
963
|
+
* @param references reference of work coordinate system to place the cone at
|
|
964
|
+
* @param radius bottom diameter of the cone
|
|
965
|
+
* @example
|
|
966
|
+
* // Creates a sphere with radius = 20
|
|
967
|
+
* const part = api.createPart('Part')
|
|
968
|
+
* api.sphere(part, [], 20)
|
|
969
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
970
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
971
|
+
* @return id of the sphere operation
|
|
972
|
+
*/
|
|
973
|
+
sphere: (partId: VID, references: VID[], radius: number | string) => ID;
|
|
974
|
+
/**
|
|
975
|
+
* Creates a fillet operation
|
|
976
|
+
* @param partId id of the part where the fillet will be created
|
|
977
|
+
* @param references edge references where the fillet will be created on
|
|
978
|
+
* @param radius radius of the fillet
|
|
979
|
+
* @example
|
|
980
|
+
* // Creates a cylinder and puts a fillet at the top edge
|
|
981
|
+
* const part = api.createPart('Part')
|
|
982
|
+
* api.cylinder(part, [], 10, 100)
|
|
983
|
+
* const topEdges = await api.pick(part, 'edge', [{ x: 0, y: 0, z: 100 }])
|
|
984
|
+
* api.fillet(part, topEdges, 2)
|
|
985
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
986
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
987
|
+
* @return id of the fillet operation
|
|
988
|
+
*/
|
|
989
|
+
fillet: (partId: VID, references: VIDs, radius: number | string) => ID;
|
|
990
|
+
/**
|
|
991
|
+
* Important note: To use this method, you need to add the BuerliGeometry component to your application.
|
|
992
|
+
* Otherwise the selection of geometry won't work.
|
|
993
|
+
* [See this link to buerli geometry](https://buerli.io/docs/training-for-programmers/More/graphics#3-using-the-buerligeometry-react-component)
|
|
994
|
+
*
|
|
995
|
+
* Lets the user select geometry in graphical interface. As soon as the geometry of given type has been selected, the method
|
|
996
|
+
* will return necessary information about it.
|
|
997
|
+
* [See this link to selections](https://buerli.io/docs/training-for-programmers/history/HowTos/useSelectionInHeadless)
|
|
998
|
+
*
|
|
999
|
+
* The _userData_ of the returned object contains additional information about the selected geometry. All geometric
|
|
1000
|
+
* information in the _userData_ is already transformed to the correct position. This is especially important for
|
|
1001
|
+
* assemblies.
|
|
1002
|
+
*
|
|
1003
|
+
* @param types array of types to filter user selection.
|
|
1004
|
+
* @param count optional number of selections to make (count must be >= 1). Default = 1.
|
|
1005
|
+
* @return array of objects containing information about selected geometries
|
|
1006
|
+
*/
|
|
1007
|
+
selectGeometry: <T = GeometryElement>(types: GrT[], count?: number) => Promise<InteractionInfo<T>[]>;
|
|
1008
|
+
/**
|
|
1009
|
+
* Find geometries of given type on solids in the given part at the given global positions.
|
|
1010
|
+
* @param partId Id of the part where geometries tried to be found.
|
|
1011
|
+
* @param type Type of the geometry to look for
|
|
1012
|
+
* @param positions Array of elements containing one or more positions to look for the geometry
|
|
1013
|
+
* @example
|
|
1014
|
+
* // Find planes at two different positions
|
|
1015
|
+
* const planes = await api.findGeometry(productId, GraphicType.PLANE, [[{x: 50, y: 50, z: 100}], [{x: 100, y: 50, z: 50}]])
|
|
1016
|
+
* @return array containing ids of found geometries
|
|
1017
|
+
*/
|
|
1018
|
+
findGeometry: (partId: VID, type: GrT, positions: Vec[][]) => IDs;
|
|
1019
|
+
/**
|
|
1020
|
+
* Returns the assembly template with given name from assembly container.
|
|
1021
|
+
* If asmName is empty, all assemblies from assembly container will be returned.
|
|
1022
|
+
* @param asmName Name of assembly to look for
|
|
1023
|
+
* @example // tbd
|
|
1024
|
+
* @return array containing ids of assembly templates
|
|
1025
|
+
*/
|
|
1026
|
+
getAssemblyTemplate: (asmName?: string) => IDs;
|
|
1027
|
+
/**
|
|
1028
|
+
* Returns an instance or all instances of a node, depending on whether a name is given or not.
|
|
1029
|
+
* The node is the parent of the instance/instances we're looking for and can be a root assembly,
|
|
1030
|
+
* another instance or an assembly template.
|
|
1031
|
+
* @param id id of the node from which we are searching the children for instances that have the name we are looking for.
|
|
1032
|
+
* @param instanceName name of the instance we are looking for
|
|
1033
|
+
* @example // tbd
|
|
1034
|
+
* @return array containing the ids of the found instances
|
|
1035
|
+
*/
|
|
1036
|
+
getInstance: (id: VID, instanceName?: string) => IDs;
|
|
1037
|
+
/**
|
|
1038
|
+
* Find first instance which can be identified by given identifier or name.
|
|
1039
|
+
* If both optional parameters has been set, the identifier is treated with priority.
|
|
1040
|
+
* If no instance with given identifier will be found, the name is used to find an instance.
|
|
1041
|
+
*
|
|
1042
|
+
* @param drawingId The drawing id.
|
|
1043
|
+
* @param options Optional parameters to identify to find instance.
|
|
1044
|
+
* @param options.instanceIdent Identifier to find the instance by an identifier
|
|
1045
|
+
* @param options.instanceName Name to find the instance by its name
|
|
1046
|
+
* @returns first found instance which meets the searching conditions or null if nothing could be found
|
|
1047
|
+
*/
|
|
1048
|
+
findInstance: (options: {
|
|
1049
|
+
instanceIdent?: ObjectIdent;
|
|
1050
|
+
instanceName?: string;
|
|
1051
|
+
}) => ID;
|
|
1052
|
+
/**
|
|
1053
|
+
* Returns the product ids of the given instance ids.
|
|
1054
|
+
* @param instanceIds ids of the instances to get the product ids from
|
|
1055
|
+
* @example // tbd
|
|
1056
|
+
* @return array containing the product ids of the given instance ids
|
|
1057
|
+
*/
|
|
1058
|
+
getProductsOfInstances: (instanceIds: VID[]) => IDs;
|
|
1059
|
+
/**
|
|
1060
|
+
* Returns the id of the current product
|
|
1061
|
+
* @example // tbd
|
|
1062
|
+
*/
|
|
1063
|
+
getCurrentProduct: () => ID;
|
|
1064
|
+
/**
|
|
1065
|
+
* Sets the instance with id to the new current instance
|
|
1066
|
+
*
|
|
1067
|
+
* @param id id of the instance to set as the current
|
|
1068
|
+
* @example // tbd
|
|
1069
|
+
*/
|
|
1070
|
+
setCurrentInstance: (id: VID) => Promise<void>;
|
|
1071
|
+
/**
|
|
1072
|
+
* Sets the product with productId to the new current product
|
|
1073
|
+
*
|
|
1074
|
+
* @param productId Id of the product to set as the current
|
|
1075
|
+
* @example // tbd
|
|
1076
|
+
*/
|
|
1077
|
+
setCurrentProduct: (productId: VID) => Promise<void>;
|
|
1078
|
+
/**
|
|
1079
|
+
* Returns the id of the current instance
|
|
1080
|
+
* @example // tbd
|
|
1081
|
+
* @return id of the current instance
|
|
1082
|
+
*/
|
|
1083
|
+
getCurrentInstance: () => ID;
|
|
1084
|
+
/**
|
|
1085
|
+
* Returns the global transformation of the given id.
|
|
1086
|
+
* Currently only ids of instances supported.
|
|
1087
|
+
*
|
|
1088
|
+
* @param id id of the object to get the global transformation from
|
|
1089
|
+
* @example // tbd
|
|
1090
|
+
* @return transformation of instance as two-dimensional array containing origin position and direction for x, y and z
|
|
1091
|
+
* [
|
|
1092
|
+
* [origin.x, origin.y, origin.z],
|
|
1093
|
+
* [xVec.x, xVec.y, xVec.z],
|
|
1094
|
+
* [yVec.x, yVec.y, yVec.z],
|
|
1095
|
+
* [zVec.x, zVec.y, zVec.z]
|
|
1096
|
+
* ]
|
|
1097
|
+
*/
|
|
1098
|
+
getTransformation: (id: VID) => Promise<number[][]>;
|
|
1099
|
+
/**
|
|
1100
|
+
* Returns the part template with given name from part container.
|
|
1101
|
+
* If partName is empty, all parts from part container will be returned.
|
|
1102
|
+
* @param partName Name of part to look for
|
|
1103
|
+
* @example // tbd
|
|
1104
|
+
* @return array containing ids of part templates
|
|
1105
|
+
*/
|
|
1106
|
+
getPartTemplate: (partName?: string) => IDs;
|
|
1107
|
+
/**
|
|
1108
|
+
* Returns the work coord system with the given wcsName from the given reference.
|
|
1109
|
+
* If wcsName is not set, all work coord systems of the reference will be returned.
|
|
1110
|
+
* @deprecated use getWorkGeometry() instead, getWorkCoordSystem() will be removed in a future release.
|
|
1111
|
+
* @param refId id of the reference to look for the work coord system
|
|
1112
|
+
* @param wcsName name of the work coord system to look for
|
|
1113
|
+
* @example
|
|
1114
|
+
* // Adds a loaded part to an assembly. To set the part to the origin of the
|
|
1115
|
+
* // assembly with a constraint, the work coord system can be get from part by name.
|
|
1116
|
+
* const pt0 = { x: 0, y: 0, z: 0 }
|
|
1117
|
+
* const xDir = { x: 1, y: 0, z: 0 }
|
|
1118
|
+
* const yDir = { x: 0, y: 1, z: 0 }
|
|
1119
|
+
* const nutBoltAsm = await api.createRootAssembly('NutBolt_Asm')
|
|
1120
|
+
* const bolt = await api.loadProduct(arraybuffer, 'ofb')
|
|
1121
|
+
* const boltRefId = await api.addInstances(bolt, nutBoltAsm, [pt0, xDir, yDir])
|
|
1122
|
+
* const wcsIdOrigin = await api.getWorkCoordSystem(boltRefId, 'WCS_Origin')
|
|
1123
|
+
* await api.createFastenedOriginConstraint(nutBoltAsm, { refId: boltRefId, wcsId: wcsIdOrigin[0] }, 0, 0, 0, 0, 0, 'FOC')
|
|
1124
|
+
* const geoms = await api.createBufferGeometry(nutBoltAsm)
|
|
1125
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
1126
|
+
* @return array containing ids of work coordinate systems
|
|
1127
|
+
*/
|
|
1128
|
+
getWorkCoordSystem: (id: VID, wcsName?: string) => IDs;
|
|
1129
|
+
/**
|
|
1130
|
+
* Returns the sketch region with the given sketchRegionName from the given instance or part id.
|
|
1131
|
+
* If sketchRegionName is not set, all sketch regions of the reference will be returned.
|
|
1132
|
+
* @param id id of the instance or part to look for the sketch region
|
|
1133
|
+
* @param wcsName name of the sketch region to look for
|
|
1134
|
+
* @example // tbd
|
|
1135
|
+
* @return array containing ids of the sketch regions
|
|
1136
|
+
*/
|
|
1137
|
+
getSketchRegion: (id: VID, sketchRegionName?: string) => IDs;
|
|
1138
|
+
/**
|
|
1139
|
+
* Returns the work geometry of given type with given name from the given instance or part id.
|
|
1140
|
+
* If the name of the work geometry is empty, all found work geometry of given type is returned
|
|
1141
|
+
* @param id id of the instance or part to look for the work geometry
|
|
1142
|
+
* @param type type of the work geometry to look for
|
|
1143
|
+
* @param wgName optional name of the work geometry to look for
|
|
1144
|
+
* @return array containing ids of the work geometry
|
|
1145
|
+
*/
|
|
1146
|
+
getWorkGeometry: (id: VID, type: WorkGeomType, wgName?: string) => IDs;
|
|
1147
|
+
/**
|
|
1148
|
+
* Returns information about a constraint in the given reference
|
|
1149
|
+
* @deprecated use specific methods e.g. getFastenedConstraint() instead, getConstraint() will be removed in a future release.
|
|
1150
|
+
* @param refId id of the reference to look for the constraint
|
|
1151
|
+
* @param constrName name of the constraint to look for
|
|
1152
|
+
* @example // tbd
|
|
1153
|
+
* @return array containing information about the constraint
|
|
1154
|
+
* [
|
|
1155
|
+
* constraintId,
|
|
1156
|
+
* [ reference id of first mate, workcoordsystem id of first mate, flip type of first mate, reoriented type of first mate ],
|
|
1157
|
+
* [ reference id of second mate, workcoordsystem id of second mate, flip type of second mate, reoriented type of second mate ],
|
|
1158
|
+
* xOffset,
|
|
1159
|
+
* yOffset,
|
|
1160
|
+
* zOffset
|
|
1161
|
+
* ]
|
|
1162
|
+
*/
|
|
1163
|
+
getConstraint: (refId: VID, constrName?: string) => Promise<ConstraintType>;
|
|
1164
|
+
/**
|
|
1165
|
+
* Returns the fastened constraint of given instance or assembly id with specified name.
|
|
1166
|
+
* @param id id of the instance or assembly to look for the constraint
|
|
1167
|
+
* @param constrName name of the constraint to look for
|
|
1168
|
+
* @example // tbd
|
|
1169
|
+
* @return found fastened constraint as object.
|
|
1170
|
+
*/
|
|
1171
|
+
getFastenedConstraint: (id: VID, constrName: string) => Promise<FastenedConstraintType>;
|
|
1172
|
+
/**
|
|
1173
|
+
* Returns the fastened origin constraint of given instance or assembly with specified name.
|
|
1174
|
+
* @param id id of the instance or assembly to look for the constraint
|
|
1175
|
+
* @param constrName name of the constraint to look for
|
|
1176
|
+
* @example // tbd
|
|
1177
|
+
* @return found fastened origin constraint as object.
|
|
1178
|
+
*/
|
|
1179
|
+
getFastenedOriginConstraint: (id: VID, constrName: string) => Promise<FastenedOriginConstraintType>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Returns the revolute constraint of given instance or assembly with specified name.
|
|
1182
|
+
* @param id id of the instance or assembly to look for the constraint
|
|
1183
|
+
* @param constrName name of the constraint to look for
|
|
1184
|
+
* @example // tbd
|
|
1185
|
+
* @return found revolute constraint as object.
|
|
1186
|
+
*/
|
|
1187
|
+
getRevoluteConstraint: (id: VID, constrName: string) => Promise<RevoluteConstraintType>;
|
|
1188
|
+
/**
|
|
1189
|
+
* Returns the slider constraint of given instance or assembly with specified name.
|
|
1190
|
+
* @param id id of the instance or assembly to look for the constraint
|
|
1191
|
+
* @param constrName name of the constraint to look for
|
|
1192
|
+
* @example // tbd
|
|
1193
|
+
* @return found slider constraint as object.
|
|
1194
|
+
*/
|
|
1195
|
+
getSliderConstraint: (id: VID, constrName: string) => Promise<SliderConstraintType>;
|
|
1196
|
+
/**
|
|
1197
|
+
* Returns the planar constraint of given instance or assembly with specified name.
|
|
1198
|
+
* @param id id of the instance or assembly to look for the constraint
|
|
1199
|
+
* @param constrName name of the constraint to look for
|
|
1200
|
+
* @example // tbd
|
|
1201
|
+
* @return found planar constraint as object.
|
|
1202
|
+
*/
|
|
1203
|
+
getPlanarConstraint: (id: VID, constrName: string) => Promise<PlanarConstraintType>;
|
|
1204
|
+
/**
|
|
1205
|
+
* Returns the parallel constraint of given instance or assembly with specified name.
|
|
1206
|
+
* @param id id of the instance or assembly to look for the constraint
|
|
1207
|
+
* @param constrName name of the constraint to look for
|
|
1208
|
+
* @example // tbd
|
|
1209
|
+
* @return found parallel constraint as object.
|
|
1210
|
+
*/
|
|
1211
|
+
getParallelConstraint: (id: VID, constrName: string) => Promise<ParallelConstraintType>;
|
|
1212
|
+
/**
|
|
1213
|
+
* Returns the cylindrical constraint of given instance or assembly with specified name.
|
|
1214
|
+
* @param id id of the instance or assembly to look for the constraint
|
|
1215
|
+
* @param constrName name of the constraint to look for
|
|
1216
|
+
* @example // tbd
|
|
1217
|
+
* @return found cylindrical constraint as object.
|
|
1218
|
+
*/
|
|
1219
|
+
getCylindricalConstraint: (id: VID, constrName: string) => Promise<CylindricalConstraintType>;
|
|
1220
|
+
/**
|
|
1221
|
+
* Returns the id of the feature / operation with name = featureName. The feature can then
|
|
1222
|
+
* be used for further operations, like boolean, transformations and so on.
|
|
1223
|
+
* @param partId id of the part where to look for the feature / operation
|
|
1224
|
+
* @param featureName name of the feature to look for
|
|
1225
|
+
* @example // tbd
|
|
1226
|
+
* @return id of the feature / operation
|
|
1227
|
+
*/
|
|
1228
|
+
getFeatureByName: (partId: VID, featureName: string) => ID;
|
|
1229
|
+
/**
|
|
1230
|
+
* Returns an object containing the center of gravity and the volume of the given
|
|
1231
|
+
* product, instance or solid. Depending on the input parameter the calculations were made
|
|
1232
|
+
* on a single solid, a part, a subassembly, the whole model, ... E.g. the center of gravity of
|
|
1233
|
+
* a root assembly, will be the sum of all solid's center of gravity over the whole assembly structure
|
|
1234
|
+
*
|
|
1235
|
+
* @param id id of the part, assembly, instance or solid we want the information from
|
|
1236
|
+
* @example // tbd
|
|
1237
|
+
* @return object containing the geometry information
|
|
1238
|
+
*/
|
|
1239
|
+
getGeometryInformation: (id: VID) => Promise<ModelInfo | null>;
|
|
1240
|
+
/**
|
|
1241
|
+
* Writes the current drawing to a stream and returns the data.
|
|
1242
|
+
*
|
|
1243
|
+
* Important notes about the ofb format:
|
|
1244
|
+
* - It contains binary geometry blocks.
|
|
1245
|
+
* - Do not try to convert it to text, the geometry blocks will get damaged!
|
|
1246
|
+
*
|
|
1247
|
+
* @param type type to write
|
|
1248
|
+
* @example // tbd
|
|
1249
|
+
* @return stream data
|
|
1250
|
+
*/
|
|
1251
|
+
save: (type: 'ofb' | 'stp') => Promise<Uint8Array | null>;
|
|
1252
|
+
/**
|
|
1253
|
+
* Writes the current drawing to a stream and POSTs the result to the given url.
|
|
1254
|
+
* @param url The url to POST the model to.
|
|
1255
|
+
* @param filetype The file type be saved (ofb, stp).
|
|
1256
|
+
* @example // tbd
|
|
1257
|
+
* @return true if saving was successful
|
|
1258
|
+
*/
|
|
1259
|
+
saveToUrl: (url: string, filetype: 'ofb' | 'stp') => Promise<boolean>;
|
|
1260
|
+
/**
|
|
1261
|
+
* Loads the given buffer.
|
|
1262
|
+
* @param content data as arraybuffer
|
|
1263
|
+
* @param type type of the data to load
|
|
1264
|
+
* @param options optional object containing ident property to define an identifier for the loaded root product
|
|
1265
|
+
* @example // tbd
|
|
1266
|
+
* @return array containing the id of the loaded product in the file
|
|
1267
|
+
*/
|
|
1268
|
+
load: (content: ArrayBuffer, type: 'ofb' | 'stp', options?: {
|
|
1269
|
+
ident?: ObjectIdent;
|
|
1270
|
+
}) => Promise<number[] | null>;
|
|
1271
|
+
/**
|
|
1272
|
+
* Loads from the given url.
|
|
1273
|
+
* @param url The url to load data from.
|
|
1274
|
+
* @param filetype The type of data delivered by the url (ofb, stp).
|
|
1275
|
+
* @param options optional object containing ident property to define an identifier for the loaded root product
|
|
1276
|
+
* @example // tbd
|
|
1277
|
+
* @return array containing the id of the loaded product from url
|
|
1278
|
+
*/
|
|
1279
|
+
loadFromUrl: (url: string, filetype: 'ofb' | 'stp', options?: {
|
|
1280
|
+
ident?: ObjectIdent;
|
|
1281
|
+
}) => Promise<number[] | null>;
|
|
1282
|
+
/**
|
|
1283
|
+
* Loads a product into the current drawing and adds it to the part- or assembly container.
|
|
1284
|
+
* @param content data as arraybuffer
|
|
1285
|
+
* @param type type of the data to load
|
|
1286
|
+
* @param options optional object containing ident property to define an identifier for the loaded product
|
|
1287
|
+
* @example
|
|
1288
|
+
* // Loads an existing product
|
|
1289
|
+
* const part = api.loadProduct(arraybuffer, 'ofb')
|
|
1290
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
1291
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
1292
|
+
* @return array containing the id of the loaded products
|
|
1293
|
+
*/
|
|
1294
|
+
loadProduct: (content: ArrayBuffer, type: 'ofb' | 'stp', options?: {
|
|
1295
|
+
ident?: ObjectIdent;
|
|
1296
|
+
}) => Promise<number[] | null>;
|
|
1297
|
+
/**
|
|
1298
|
+
* Loads a product from the given URL into the current drawing and adds it to the part- or assembly container.
|
|
1299
|
+
* @param url The url to load data from.
|
|
1300
|
+
* @param filetype The type of data delivered by the url ('ofb', 'stp').
|
|
1301
|
+
* @param options optional object containing ident property, to define a identifier for the loaded product
|
|
1302
|
+
* @example // tbd
|
|
1303
|
+
* @return array containing the id of the loaded products
|
|
1304
|
+
*/
|
|
1305
|
+
loadProductFromUrl: (url: string, filetype: 'ofb' | 'stp', options?: {
|
|
1306
|
+
ident?: ObjectIdent;
|
|
1307
|
+
}) => Promise<number[] | null>;
|
|
1308
|
+
/**
|
|
1309
|
+
* Creates a import feature operation and appends geometry to it. This method can be used to import specific geometry
|
|
1310
|
+
* which can be used for further operations like boolean, translations and so on.
|
|
1311
|
+
* @param partId id of the part where to add the new feature
|
|
1312
|
+
* @param content data buffer to add to the import feature
|
|
1313
|
+
* @param format the content format
|
|
1314
|
+
* @param name optional name for the feature, default = 'Import'
|
|
1315
|
+
* @example // tbd
|
|
1316
|
+
* @return id of the import feature operation
|
|
1317
|
+
*/
|
|
1318
|
+
importFeature: (partId: VID, content: ArrayBuffer, format: 'stp' | 'step', name?: string) => ID;
|
|
1319
|
+
/**
|
|
1320
|
+
* Removes instances from root assembly, other instances or assembly templates.
|
|
1321
|
+
* @param instances array of instance objects. See following parameter descriptions.
|
|
1322
|
+
* @param id id, identifier or name of the instance to remove
|
|
1323
|
+
* @example // tbd
|
|
1324
|
+
*/
|
|
1325
|
+
removeInstances: (...instances: {
|
|
1326
|
+
id: VID | ObjectIdent;
|
|
1327
|
+
}[]) => Promise<void>;
|
|
1328
|
+
/**
|
|
1329
|
+
* Transforms instances by the given transformation.
|
|
1330
|
+
* The transformations are local to the instances parent, which is an assembly.
|
|
1331
|
+
* @param instances array of instance objects. See following descriptions.
|
|
1332
|
+
* @param id id, identifier or name of the instance to transform
|
|
1333
|
+
* @param transformation transformation (origin, xDir, yDir) of the instance local to the owner.
|
|
1334
|
+
* @example // tbd
|
|
1335
|
+
*/
|
|
1336
|
+
transformInstances: (...instances: {
|
|
1337
|
+
id: VID | ObjectIdent;
|
|
1338
|
+
transformation: Transform;
|
|
1339
|
+
}[]) => Promise<void>;
|
|
1340
|
+
/**
|
|
1341
|
+
* Creates a translate operation
|
|
1342
|
+
* @param partId id ot the part where features will be translated
|
|
1343
|
+
* @param operations ids of the operations which are used for this translate operation,
|
|
1344
|
+
* e.g. box, extrusion, chamfer operation
|
|
1345
|
+
* @param references references which define the direction of translation. E.g workaxis, 2 workpoints,..
|
|
1346
|
+
* @param inverted flag if direction is inverted or not
|
|
1347
|
+
* @param distance distance of translation
|
|
1348
|
+
* @example // tbd
|
|
1349
|
+
* @return id of the translate operation
|
|
1350
|
+
*/
|
|
1351
|
+
translate: (partId: VID, operations: VID[], references: VID[], inverted: 0 | 1, distance: number | string) => ID;
|
|
1352
|
+
/**
|
|
1353
|
+
* Updates a already created translation. To update value will be distance of translation
|
|
1354
|
+
* @deprecated use translate() instead, updateTranslate() will be removed in a future release.
|
|
1355
|
+
* @param translationId id of the translation (feature id) which will be updated
|
|
1356
|
+
* @param distance new value for distance
|
|
1357
|
+
* @example // tbd
|
|
1358
|
+
*/
|
|
1359
|
+
updateTranslate: (translationId: VID, distance: number) => Promise<void>;
|
|
1360
|
+
/**
|
|
1361
|
+
* Returns found vertices, edges or faces depending on
|
|
1362
|
+
* given type and points. Given points define where to look for elements.
|
|
1363
|
+
* @deprecated use findGeometry() instead, pick() will be removed in a future release.
|
|
1364
|
+
* @param partId id of the part to pick elements
|
|
1365
|
+
* @param type type of element to pick
|
|
1366
|
+
* @param points points containing 3D coordinates to look for possible element
|
|
1367
|
+
* @example
|
|
1368
|
+
* // Creates a cylinder an puts a fillet on the top edge
|
|
1369
|
+
* const part = api.createPart('Part')
|
|
1370
|
+
* api.cylinder(part, [], 10, 100)
|
|
1371
|
+
* const edges = await api.pick(part, 'edge', [{ x: 0, y: 0, z: 100 }])
|
|
1372
|
+
* api.fillet(part, edges, 2)
|
|
1373
|
+
* const geoms = await api.createBufferGeometry(part)
|
|
1374
|
+
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
1375
|
+
* @return array containing ids of found geometries
|
|
1376
|
+
*/
|
|
1377
|
+
pick: (partId: VID, type: 'vertex' | 'edge' | 'face', points: Vec[]) => IDs;
|
|
1378
|
+
/**
|
|
1379
|
+
* Updates multiple expressions in different parts at once
|
|
1380
|
+
* @param expressions array of expression objects containing the part id and the expression to set
|
|
1381
|
+
* @param partId id, identifier or name of part to update expression
|
|
1382
|
+
* @param members array of members to update which contain a name and a value. Value can be an expression, e.g. '2 * laenge'
|
|
1383
|
+
* @example // tbd
|
|
1384
|
+
* @returns true, if updating expressions in all parts was successfull
|
|
1385
|
+
*/
|
|
1386
|
+
setExpressions: (...expressions: {
|
|
1387
|
+
partId: VID | ObjectIdent;
|
|
1388
|
+
members: {
|
|
1389
|
+
name: string;
|
|
1390
|
+
value: number | string;
|
|
1391
|
+
}[];
|
|
1392
|
+
}[]) => Promise<boolean>;
|
|
1393
|
+
/**
|
|
1394
|
+
* Creates a mirror operation.
|
|
1395
|
+
* Mirrors the entities of an operation at the position of the plane reference
|
|
1396
|
+
* @param partId id of the part where the mirror will be created
|
|
1397
|
+
* @param operations ids of the operations which are used for this mirror operation,
|
|
1398
|
+
* e.g. box, extrusion, chamfer operation
|
|
1399
|
+
* @param references id of the references which will be used to mirror (e.g. Workplane)
|
|
1400
|
+
*/
|
|
1401
|
+
mirror: (partId: VID, operations: VID[], references: VID[]) => Promise<ObjectID | null>;
|
|
1402
|
+
/**
|
|
1403
|
+
* Removes the given operations or the operations which are added after 'toOperation' in history, depending
|
|
1404
|
+
* on whether operations or toOperation parameter is given.
|
|
1405
|
+
* @param operations ids of all to remove operations. First element in the array will be removed first.
|
|
1406
|
+
* This means operations which depend on each other, need to be removed from newest to oldest.
|
|
1407
|
+
* @param toOperation all operations, from rollback bar until the id of this operation, will be deleted
|
|
1408
|
+
*/
|
|
1409
|
+
removeOperations: (operations: VID[], toOperation: VID) => Promise<void>;
|
|
1410
|
+
/**
|
|
1411
|
+
* Creates and returns the mate path as array from the given instance id up to the current instance.
|
|
1412
|
+
* This helps to get the right path to set constraints between instances which are located in
|
|
1413
|
+
* nested assemblies.
|
|
1414
|
+
* @param instanceId id of the instance to get the mate path from
|
|
1415
|
+
* @return array containing the ids as a path from given instance to current instance
|
|
1416
|
+
*/
|
|
1417
|
+
getMatePath: (instanceId: VID | ObjectIdent) => Promise<ObjectID[]>;
|
|
1418
|
+
/**
|
|
1419
|
+
* Creates a slice operation.
|
|
1420
|
+
* Slices the entities of the given operations by the given reference.
|
|
1421
|
+
* @param partId id of the part where the slice will be created
|
|
1422
|
+
* @param operations ids of the operations which are used for this slice operation,
|
|
1423
|
+
* e.g. box, extrusion, chamfer operation
|
|
1424
|
+
* @param reference id of the workplane reference to use for the slice
|
|
1425
|
+
* @param sideFlag flag to toggle which side of the slice will be kept
|
|
1426
|
+
* @return id of the slice operation
|
|
1427
|
+
*/
|
|
1428
|
+
slice: (partId: VID, operations: VID[], reference: VID, sideFlag: boolean) => ID;
|
|
1429
|
+
/**
|
|
1430
|
+
* Creates a slice by sheet operation.
|
|
1431
|
+
* Slices the entity of an operation with a sheet entity of another operation
|
|
1432
|
+
* @param partId id of the part where the slice will be created
|
|
1433
|
+
* @param operationToSlice id of the operation which will be sliced in this slice by sheet operation
|
|
1434
|
+
* @param operationOfSheet id of the operation which is used as the slice
|
|
1435
|
+
* @param sideFlag flag to toggle which side of the slice will be kept
|
|
1436
|
+
* @return id of the slice by sheet operation
|
|
1437
|
+
*/
|
|
1438
|
+
sliceBySheet: (partId: VID, operationToSlice: VID, operationOfSheet: VID, sideFlag: boolean) => ID;
|
|
1439
|
+
};
|
|
1440
|
+
export declare class History {
|
|
1441
|
+
drawingId: DrawingID | null;
|
|
1442
|
+
queue: Promise<number>;
|
|
1443
|
+
constructor();
|
|
1444
|
+
resolve(callback: (...results: any) => Promise<any>, ...args: any[]): Promise<any>;
|
|
1445
|
+
init(callback: (api: ApiHistory) => void): () => Promise<void>;
|
|
1446
|
+
destroy(): void;
|
|
1447
|
+
}
|
|
1448
|
+
export declare class history extends History {
|
|
1449
|
+
constructor();
|
|
1450
|
+
}
|
|
1451
|
+
declare type VID = ObjectID | null | Promise<ObjectID | null>;
|
|
1452
|
+
declare type VIDs = ObjectID[] | Promise<ObjectID[]>;
|
|
1453
|
+
declare type ID = Promise<ObjectID | null>;
|
|
1454
|
+
declare type IDs = Promise<ObjectID[]>;
|
|
1455
|
+
declare type Point = {
|
|
1456
|
+
x: number;
|
|
1457
|
+
y: number;
|
|
1458
|
+
z: number;
|
|
1459
|
+
};
|
|
1460
|
+
declare type ModelInfo = {
|
|
1461
|
+
centerOfGravity: Vec;
|
|
1462
|
+
volume: number;
|
|
1463
|
+
};
|
|
1464
|
+
declare type MateParam = {
|
|
1465
|
+
matePath: VID[];
|
|
1466
|
+
wcsId: VID;
|
|
1467
|
+
flip: FlipType;
|
|
1468
|
+
reoriented: ReorientedType;
|
|
1469
|
+
};
|
|
1470
|
+
declare type GrT = GraphicType.POINT | GraphicType.LINE | GraphicType.ARC | GraphicType.CIRCLE | GraphicType.PLANE | GraphicType.CYLINDER | GraphicType.CONE | GraphicType.SPHERE | GraphicType.NURBSCURVE | GraphicType.NURBSSURFACE;
|
|
1471
|
+
/**
|
|
1472
|
+
* Array type containing three points of type Point = {x: number, y: number, z: number}.
|
|
1473
|
+
* - [0] = origin position containing x-, y- and z-coordinates
|
|
1474
|
+
* - [1] = x-direction vector
|
|
1475
|
+
* - [2] = y-direction vector
|
|
1476
|
+
*/
|
|
1477
|
+
export declare type Transform = [Point, Point, Point];
|
|
1478
|
+
export declare type DimensionType = DimensionParam<VID, Vec>;
|
|
1479
|
+
export declare type ViewOptionsType = {
|
|
1480
|
+
/** optional color (autocad color index) to set for the 2d view, if color = 256 then color will be taken from layer definition */
|
|
1481
|
+
color?: number;
|
|
1482
|
+
/** optional layer to set for the 2d view, layers are defined in the dxf file */
|
|
1483
|
+
layer?: string;
|
|
1484
|
+
};
|
|
1485
|
+
export declare type FastenedOriginConstraintType = {
|
|
1486
|
+
/** id of the constraint */
|
|
1487
|
+
constrId: VID;
|
|
1488
|
+
/** first mate constraint */
|
|
1489
|
+
mate1: MateParam;
|
|
1490
|
+
/** offset in x-direction */
|
|
1491
|
+
xOffset: number | string;
|
|
1492
|
+
/** offset in y-direction */
|
|
1493
|
+
yOffset: number | string;
|
|
1494
|
+
/** offset in z-direction */
|
|
1495
|
+
zOffset: number | string;
|
|
1496
|
+
/** rotation around x-axis */
|
|
1497
|
+
xRotation?: number | string;
|
|
1498
|
+
/** rotation around y-axis */
|
|
1499
|
+
yRotation?: number | string;
|
|
1500
|
+
/** rotation around z-axis */
|
|
1501
|
+
zRotation?: number | string;
|
|
1502
|
+
};
|
|
1503
|
+
export declare type FastenedConstraintType = {
|
|
1504
|
+
/** id of the constraint */
|
|
1505
|
+
constrId: VID;
|
|
1506
|
+
/** first mate constraint */
|
|
1507
|
+
mate1: MateParam;
|
|
1508
|
+
/** second mate constraint */
|
|
1509
|
+
mate2: MateParam;
|
|
1510
|
+
/** offset in x-direction */
|
|
1511
|
+
xOffset: number | string;
|
|
1512
|
+
/** offset in y-direction */
|
|
1513
|
+
yOffset: number | string;
|
|
1514
|
+
/** offset in z-direction */
|
|
1515
|
+
zOffset: number | string;
|
|
1516
|
+
/** rotation around x-axis */
|
|
1517
|
+
xRotation?: number | string;
|
|
1518
|
+
/** rotation around y-axis */
|
|
1519
|
+
yRotation?: number | string;
|
|
1520
|
+
/** rotation around z-axis */
|
|
1521
|
+
zRotation?: number | string;
|
|
1522
|
+
};
|
|
1523
|
+
export declare type RevoluteConstraintType = {
|
|
1524
|
+
/** id of the constraint */
|
|
1525
|
+
constrId: VID;
|
|
1526
|
+
/** first mate constraint */
|
|
1527
|
+
mate1: MateParam;
|
|
1528
|
+
/** second mate constraint */
|
|
1529
|
+
mate2: MateParam;
|
|
1530
|
+
/** offset in z-direction */
|
|
1531
|
+
zOffset: number | string;
|
|
1532
|
+
/** min and max limit for the rotation around z-Axis */
|
|
1533
|
+
zRotationLimits: LimitsParam;
|
|
1534
|
+
};
|
|
1535
|
+
export declare type SliderConstraintType = {
|
|
1536
|
+
/** id of the constraint */
|
|
1537
|
+
constrId: VID;
|
|
1538
|
+
/** first mate constraint */
|
|
1539
|
+
mate1: MateParam;
|
|
1540
|
+
/** second mate constraint */
|
|
1541
|
+
mate2: MateParam;
|
|
1542
|
+
/** offset in x-direction */
|
|
1543
|
+
xOffset: number | string;
|
|
1544
|
+
/** offset in y-direction */
|
|
1545
|
+
yOffset: number | string;
|
|
1546
|
+
/** min and max limit for the z-offset */
|
|
1547
|
+
zOffsetLimits: LimitsParam;
|
|
1548
|
+
};
|
|
1549
|
+
export declare type PlanarConstraintType = {
|
|
1550
|
+
/** id of the constraint */
|
|
1551
|
+
constrId: VID;
|
|
1552
|
+
/** first mate constraint */
|
|
1553
|
+
mate1: MateParam;
|
|
1554
|
+
/** second mate constraint */
|
|
1555
|
+
mate2: MateParam;
|
|
1556
|
+
/** offset in z-direction */
|
|
1557
|
+
zOffset: number | string;
|
|
1558
|
+
/** min and max limit for the x-offset */
|
|
1559
|
+
xOffsetLimits: LimitsParam;
|
|
1560
|
+
/** min and max limit for the y-offset */
|
|
1561
|
+
yOffsetLimits: LimitsParam;
|
|
1562
|
+
/** min and max limit for the rotation around z-Axis */
|
|
1563
|
+
zRotationLimits: LimitsParam;
|
|
1564
|
+
};
|
|
1565
|
+
export declare type ParallelConstraintType = {
|
|
1566
|
+
/** id of the constraint */
|
|
1567
|
+
constrId: VID;
|
|
1568
|
+
/** first mate constraint */
|
|
1569
|
+
mate1: MateParam;
|
|
1570
|
+
/** second mate constraint */
|
|
1571
|
+
mate2: MateParam;
|
|
1572
|
+
/** min and max limit for the x-offset */
|
|
1573
|
+
xOffsetLimits: LimitsParam;
|
|
1574
|
+
/** min and max limit for the y-offset */
|
|
1575
|
+
yOffsetLimits: LimitsParam;
|
|
1576
|
+
/** min and max limit for the z-offset */
|
|
1577
|
+
zOffsetLimits: LimitsParam;
|
|
1578
|
+
/** min and max limit for the rotation around z-Axis */
|
|
1579
|
+
zRotationLimits: LimitsParam;
|
|
1580
|
+
};
|
|
1581
|
+
export declare type CylindricalConstraintType = {
|
|
1582
|
+
/** id of the constraint */
|
|
1583
|
+
constrId: VID;
|
|
1584
|
+
/** first mate constraint */
|
|
1585
|
+
mate1: MateParam;
|
|
1586
|
+
/** second mate constraint */
|
|
1587
|
+
mate2: MateParam;
|
|
1588
|
+
/** min and max limit for the z-offset */
|
|
1589
|
+
zOffsetLimits: LimitsParam;
|
|
1590
|
+
/** min and max limit for the rotation around z-Axis */
|
|
1591
|
+
zRotationLimits: LimitsParam;
|
|
1592
|
+
};
|
|
1593
|
+
/**
|
|
1594
|
+
* Information about constraint.
|
|
1595
|
+
* [
|
|
1596
|
+
* constraintId,
|
|
1597
|
+
* [ path to product reference,
|
|
1598
|
+
* workcoordsystem id of 1st mate,
|
|
1599
|
+
* flip type of 1st mate,
|
|
1600
|
+
* reoriented type of 1st mate ],
|
|
1601
|
+
* [ path to product reference,
|
|
1602
|
+
* workcoordsystem id of 2nd mate,
|
|
1603
|
+
* flip type of 2nd mate,
|
|
1604
|
+
* reoriented type of 2nd mate ],
|
|
1605
|
+
* xOffset,
|
|
1606
|
+
* yOffset,
|
|
1607
|
+
* zOffset
|
|
1608
|
+
* ]
|
|
1609
|
+
*/
|
|
1610
|
+
export declare type ConstraintType = [
|
|
1611
|
+
number,
|
|
1612
|
+
[
|
|
1613
|
+
number[],
|
|
1614
|
+
number,
|
|
1615
|
+
number,
|
|
1616
|
+
number
|
|
1617
|
+
],
|
|
1618
|
+
[
|
|
1619
|
+
number[],
|
|
1620
|
+
number,
|
|
1621
|
+
number,
|
|
1622
|
+
number
|
|
1623
|
+
],
|
|
1624
|
+
number,
|
|
1625
|
+
number,
|
|
1626
|
+
number,
|
|
1627
|
+
number,
|
|
1628
|
+
number,
|
|
1629
|
+
number
|
|
1630
|
+
];
|
|
1631
|
+
/**
|
|
1632
|
+
* General, generic vector type representing following types:
|
|
1633
|
+
* - Value[]
|
|
1634
|
+
* - {x: Value, y: Value, z: Value}
|
|
1635
|
+
* - THREE.Vector [See threejs documentation](https://threejs.org/docs/?q=Vect#api/en/math/Vector3)
|
|
1636
|
+
* - THREE.Euler [See threejs documentation](https://threejs.org/docs/?q=Euler#api/en/math/Euler)
|
|
1637
|
+
*/
|
|
1638
|
+
export declare type Vec<Value = number> = Value[] | {
|
|
1639
|
+
x: Value;
|
|
1640
|
+
y: Value;
|
|
1641
|
+
z: Value;
|
|
1642
|
+
} | THREE.Vector3 | THREE.Euler;
|
|
1643
|
+
export {};
|