@buerli.io/headless 0.5.0-beta.2 → 0.5.0-beta.4
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/build/cjs/history.js +671 -188
- package/build/cjs/solid.js +70 -15
- package/build/esm/history.js +671 -188
- package/build/esm/solid.js +71 -16
- package/build/types/history.d.ts +328 -233
- package/build/types/index.d.ts +8 -1
- package/build/types/solid.d.ts +13 -3
- package/package.json +2 -2
package/build/types/history.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BooleanOperationType, ChamferType, FlipType, ReorientedType, WorkAxisType, WorkCoordSystemType, WorkPlaneType, WorkPointType, ViewType, OrientationType, ExtrusionType, BrepElemType, SVGModusType } from '@buerli.io/classcad';
|
|
1
|
+
import { BooleanOperationType, ChamferType, FlipType, ReorientedType, WorkAxisType, WorkCoordSystemType, WorkPlaneType, WorkPointType, ViewType, OrientationType, ExtrusionType, BrepElemType, WorkGeomType, SVGModusType, LimitsParam, LimitedValue } from '@buerli.io/classcad';
|
|
2
2
|
import { ObjectID, PointMemValue } from '@buerli.io/core';
|
|
3
|
-
import { BufferGeometry, Scene } from 'three';
|
|
3
|
+
import { BufferGeometry, Group, Mesh, Scene } from 'three';
|
|
4
4
|
/**
|
|
5
5
|
* History based modeling is similar to solid modeling, but it is non-destructive and
|
|
6
6
|
* parametric. You can move back and forth in the modeling history and create feature
|
|
@@ -25,39 +25,13 @@ import { BufferGeometry, Scene } from 'three';
|
|
|
25
25
|
*/
|
|
26
26
|
export declare type ApiHistory = {
|
|
27
27
|
/**
|
|
28
|
-
* Adds
|
|
28
|
+
* Adds multiple products as nodes to an existing assembly at once
|
|
29
|
+
* @param nodes array of node parameter objects. See following descriptions.
|
|
29
30
|
* @param productId id of the product template to add
|
|
30
31
|
* @param ownerId id of the owner where the product template will be added to
|
|
31
32
|
* @param transformation transformation of the product template in x-, y- and z-axis
|
|
32
33
|
* @param name optional name for adding node
|
|
33
|
-
* @example
|
|
34
|
-
* // Defines some consts
|
|
35
|
-
* const orig = { x: 0, y: 0, z: 0 }
|
|
36
|
-
* const xDir = { x: 1, y: 0, z: 0 }
|
|
37
|
-
* const yDir = { x: 0, y: 1, z: 0 }
|
|
38
|
-
* const rot = { x: 0, y: 0, z: 0 }
|
|
39
|
-
* const offset = { x: 20, y: 0, z: 0 }
|
|
40
|
-
*
|
|
41
|
-
* // Creates the root assembly first
|
|
42
|
-
* const rootAsm = await api.createRootAssembly('Root_Assembly')
|
|
43
|
-
*
|
|
44
|
-
* // Creates a part template and adds geometry to it
|
|
45
|
-
* const partTempl = await api.createPartAsTemplate('Part_Template')
|
|
46
|
-
* const wcs = await api.createWorkCoordSystem(partTempl, 'Custom', [], offset, rot, 0, false, 'wcs')
|
|
47
|
-
* api.box(partTempl, [wcs], 30, 30, 10)
|
|
48
|
-
*
|
|
49
|
-
* // Adds the created part template as a node to the root assembly
|
|
50
|
-
* const partRef = await api.addNode(partTempl, rootAsm, [orig, xDir, yDir])
|
|
51
|
-
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
52
|
-
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
53
|
-
* @image /doc/assets/history/addNode.jpg
|
|
54
|
-
*/
|
|
55
|
-
addNode: (productId: VID, ownerId: VID, transformation: Transform, name?: string) => ID;
|
|
56
|
-
/**
|
|
57
|
-
* Adds multiple products as nodes to an existing assembly at once
|
|
58
|
-
* @param nodes array of node parameter objects. See also addNode().
|
|
59
34
|
* @example // tbd
|
|
60
|
-
* @image // tbd
|
|
61
35
|
*/
|
|
62
36
|
addNodes: (...nodes: {
|
|
63
37
|
productId: VID;
|
|
@@ -65,34 +39,6 @@ export declare type ApiHistory = {
|
|
|
65
39
|
transformation: Transform;
|
|
66
40
|
name?: string;
|
|
67
41
|
}[]) => Promise<ObjectID[] | null>;
|
|
68
|
-
/**
|
|
69
|
-
* Adds a dimension to the product in the 3D view
|
|
70
|
-
* @param dimension dimension to be added to a product
|
|
71
|
-
* @example
|
|
72
|
-
* // Get the current product
|
|
73
|
-
* const productId = await api.getCurrentProduct()
|
|
74
|
-
*
|
|
75
|
-
* // Create a dimension
|
|
76
|
-
* const dimension: DimensionType = {
|
|
77
|
-
* productId: productId,
|
|
78
|
-
* dimParam: {
|
|
79
|
-
* dimType: 'LinearDimension',
|
|
80
|
-
* dimLabel: 'Breite = ',
|
|
81
|
-
* dimStartPos: { x: 0, y: 0, z: 0 },
|
|
82
|
-
* dimEndPos: { x: 100, y: 0, z: 0 },
|
|
83
|
-
* dimTextPos: { x: 50, y: -10, z: 0 },
|
|
84
|
-
* dimTextAngle: 0,
|
|
85
|
-
* dimOrientation: 'Horizontal',
|
|
86
|
-
* },
|
|
87
|
-
* dxfView: 'Top',
|
|
88
|
-
* }
|
|
89
|
-
*
|
|
90
|
-
* // Add the dimension
|
|
91
|
-
* const dimensionId = await api.addDimension(dimension)
|
|
92
|
-
* @image // tbd
|
|
93
|
-
* @return id of the added dimension
|
|
94
|
-
*/
|
|
95
|
-
addDimension: (dimension: DimensionType) => ID;
|
|
96
42
|
/**
|
|
97
43
|
* Adds multiple dimensions to products in the 3D view
|
|
98
44
|
* @param dimensions dimensions to be added to products
|
|
@@ -131,7 +77,6 @@ export declare type ApiHistory = {
|
|
|
131
77
|
*
|
|
132
78
|
* // Add the dimensions
|
|
133
79
|
* const dimensionIds = await api.addDimensions(dimension1, dimension2)
|
|
134
|
-
* @image // tbd
|
|
135
80
|
* @return array of ids of the added dimensions
|
|
136
81
|
*/
|
|
137
82
|
addDimensions: (...dimensions: {
|
|
@@ -165,7 +110,6 @@ export declare type ApiHistory = {
|
|
|
165
110
|
*
|
|
166
111
|
* // Create the wanted views
|
|
167
112
|
* await api.create2DViews(productId, [ViewType.TOP, ViewType.RIGHT_90, ViewType.ISO], { color: 2, layer: '6'})
|
|
168
|
-
* @image // tbd
|
|
169
113
|
*/
|
|
170
114
|
create2DViews: (productId: VID, viewTypes: ViewType[], viewOptions?: ViewOptionsType) => IDs;
|
|
171
115
|
/**
|
|
@@ -178,7 +122,6 @@ export declare type ApiHistory = {
|
|
|
178
122
|
*
|
|
179
123
|
* // Returns for each view a min and max point
|
|
180
124
|
* console.info(bbs) // [[{x: -105, y: -89, z: 0}, {x: 105, y: 55, z: 0}], [...], [...]]
|
|
181
|
-
* @image // tbd
|
|
182
125
|
*/
|
|
183
126
|
getBoundaryBoxFromViews: (productId: VID, viewTypes?: ViewType[]) => Promise<[PointMemValue, PointMemValue][]>;
|
|
184
127
|
/**
|
|
@@ -191,7 +134,6 @@ export declare type ApiHistory = {
|
|
|
191
134
|
* { viewType: 'Iso', vector: { x: 500, y: 500, z: 0 } },
|
|
192
135
|
* { viewType: 'Right_90°', vector: { x: 500, y: 0, z: 0 } },
|
|
193
136
|
* ])
|
|
194
|
-
* @image // tbd
|
|
195
137
|
*/
|
|
196
138
|
place2DViews: (productId: VID, viewPositions: {
|
|
197
139
|
viewType: ViewType;
|
|
@@ -205,7 +147,6 @@ export declare type ApiHistory = {
|
|
|
205
147
|
* // After creating and placing the views, see place2DViews(), you can export them
|
|
206
148
|
* // You will get the dxf stream back
|
|
207
149
|
* await api.exportDXF(productId)
|
|
208
|
-
* @image // tbd
|
|
209
150
|
*/
|
|
210
151
|
exportDXF: (productId: VID, dxfTemplateFilename?: string) => Promise<Uint8Array | null>;
|
|
211
152
|
/**
|
|
@@ -223,7 +164,6 @@ export declare type ApiHistory = {
|
|
|
223
164
|
* // After creating and placing the views, see place2DViews(), you can export them
|
|
224
165
|
* // You will get the svg stream back
|
|
225
166
|
* await api.exportSVG(productId)
|
|
226
|
-
* @image // tbd
|
|
227
167
|
*/
|
|
228
168
|
exportSVG: (productId: VID, modus?: SVGModusType, renderSize?: {
|
|
229
169
|
x: number;
|
|
@@ -235,7 +175,6 @@ export declare type ApiHistory = {
|
|
|
235
175
|
* @example
|
|
236
176
|
* // You can remove existing dimensions
|
|
237
177
|
* await api.removeDimensions(dimensionIds)
|
|
238
|
-
* @image // tbd
|
|
239
178
|
*/
|
|
240
179
|
removeDimensions: (dimensionIds: VID[]) => Promise<void>;
|
|
241
180
|
/**
|
|
@@ -306,7 +245,6 @@ export declare type ApiHistory = {
|
|
|
306
245
|
* api.boolean(part, BooleanOperationType.Subtraction, [box, cyl])
|
|
307
246
|
* const geoms = await api.createBufferGeometry(part)
|
|
308
247
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
309
|
-
* @image /doc/assets/history/boolean.jpg
|
|
310
248
|
*/
|
|
311
249
|
boolean: (partId: VID, type: BooleanOperationType, entities: VID[]) => ID;
|
|
312
250
|
/**
|
|
@@ -322,7 +260,6 @@ export declare type ApiHistory = {
|
|
|
322
260
|
* const box = api.box(part, [], 20, 20, 20)
|
|
323
261
|
* const geoms = await api.createBufferGeometry(part)
|
|
324
262
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
325
|
-
* @image /doc/assets/history/box.jpg
|
|
326
263
|
*/
|
|
327
264
|
box: (partId: VID, references: VID[], width: number | string, length: number | string, height: number | string) => ID;
|
|
328
265
|
/**
|
|
@@ -337,7 +274,6 @@ export declare type ApiHistory = {
|
|
|
337
274
|
* api.cylinder(part, [], 20, 50)
|
|
338
275
|
* const geoms = await api.createBufferGeometry(part)
|
|
339
276
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
340
|
-
* @image /doc/assets/history/cylinder.jpg
|
|
341
277
|
*/
|
|
342
278
|
cylinder: (partId: VID, references: VID[], diameter: number | string, height: number | string) => ID;
|
|
343
279
|
/**
|
|
@@ -356,7 +292,6 @@ export declare type ApiHistory = {
|
|
|
356
292
|
* api.chamfer(part, ChamferType.Equal_Distance, bottomEdges, 2, 0, 0)
|
|
357
293
|
* const geoms = await api.createBufferGeometry(part)
|
|
358
294
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
359
|
-
* @image // tbd
|
|
360
295
|
*/
|
|
361
296
|
chamfer: (partId: VID, type: ChamferType, references: VIDs, dist1: number | string, dist2: number | string, angle: number | string) => ID;
|
|
362
297
|
/**
|
|
@@ -372,11 +307,10 @@ export declare type ApiHistory = {
|
|
|
372
307
|
* api.cone(part, [], 20, 0, 20)
|
|
373
308
|
* const geoms = await api.createBufferGeometry(part)
|
|
374
309
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
375
|
-
* @image /doc/assets/history/cone.jpg
|
|
376
310
|
*/
|
|
377
311
|
cone: (partId: VID, references: VID[], bDiameter: number | string, tDiameter: number | string, height: number | string) => ID;
|
|
378
312
|
/**
|
|
379
|
-
* Creates a fastened constraint between
|
|
313
|
+
* Creates a fastened constraint between mate1 and mate2 within an assembly.
|
|
380
314
|
* @param asmId id of the assembly to create constraints on
|
|
381
315
|
* @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
|
|
382
316
|
* @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
|
|
@@ -416,61 +350,22 @@ export declare type ApiHistory = {
|
|
|
416
350
|
* await api.createFastenedConstraint(rootAsm, { matePath: [prt1], wcsId: wcs3 }, { matePath: [prt2], wcsId: wcs2 }, 0, 0, 0, 0, 0, 'FC')
|
|
417
351
|
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
418
352
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
flip: FlipType;
|
|
425
|
-
reoriented: ReorientedType;
|
|
426
|
-
}, mate2: {
|
|
427
|
-
matePath: VID[];
|
|
428
|
-
wcsId: VID;
|
|
429
|
-
flip: FlipType;
|
|
430
|
-
reoriented: ReorientedType;
|
|
431
|
-
}, xOffset: number | string, yOffset: number | string, zOffset: number | string, name: string) => Promise<ObjectID | null>;
|
|
432
|
-
/**
|
|
433
|
-
* Updates a fastened constraint.
|
|
434
|
-
* @param constrId id of the constraint to update
|
|
353
|
+
*/
|
|
354
|
+
createFastenedConstraint: (asmId: VID, mate1: MateParam, mate2: MateParam, xOffset: number | string, yOffset: number | string, zOffset: number | string, name: string) => Promise<ObjectID | null>;
|
|
355
|
+
/**
|
|
356
|
+
* Updates multiple fastened constraints
|
|
357
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
435
358
|
* @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
|
|
436
359
|
* @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
|
|
437
360
|
* @param xOffset defines a offset in x-axis from mate1 to mate2
|
|
438
361
|
* @param yOffset defines a offset in y-axis from mate1 to mate2
|
|
439
362
|
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
440
363
|
* @example // tbd
|
|
441
|
-
* @image // tbd
|
|
442
|
-
*/
|
|
443
|
-
updateFastenedConstraint: (constrId: VID, mate1: {
|
|
444
|
-
matePath: VID[];
|
|
445
|
-
wcsId: VID;
|
|
446
|
-
flip: FlipType;
|
|
447
|
-
reoriented: ReorientedType;
|
|
448
|
-
}, mate2: {
|
|
449
|
-
matePath: VID[];
|
|
450
|
-
wcsId: VID;
|
|
451
|
-
flip: FlipType;
|
|
452
|
-
reoriented: ReorientedType;
|
|
453
|
-
}, xOffset: number | string, yOffset: number | string, zOffset: number | string) => Promise<void>;
|
|
454
|
-
/**
|
|
455
|
-
* Updates multiple fastened constraints
|
|
456
|
-
* @param constraints array of constraint parameter objects
|
|
457
|
-
* @example // tbd
|
|
458
|
-
* @image // tbd
|
|
459
364
|
*/
|
|
460
365
|
updateFastenedConstraints: (...constraints: {
|
|
461
366
|
constrId: VID;
|
|
462
|
-
mate1:
|
|
463
|
-
|
|
464
|
-
wcsId: VID;
|
|
465
|
-
flip: number;
|
|
466
|
-
reoriented: number;
|
|
467
|
-
};
|
|
468
|
-
mate2: {
|
|
469
|
-
matePath: VID[];
|
|
470
|
-
wcsId: VID;
|
|
471
|
-
flip: number;
|
|
472
|
-
reoriented: number;
|
|
473
|
-
};
|
|
367
|
+
mate1: MateParam;
|
|
368
|
+
mate2: MateParam;
|
|
474
369
|
xOffset: number | string;
|
|
475
370
|
yOffset: number | string;
|
|
476
371
|
zOffset: number | string;
|
|
@@ -509,47 +404,186 @@ export declare type ApiHistory = {
|
|
|
509
404
|
*
|
|
510
405
|
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
511
406
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial({ transparent: true, opacity: 0.5 })))
|
|
512
|
-
* @image /doc/assets/history/fastenedOriginConstraint.jpg
|
|
513
407
|
*/
|
|
514
|
-
createFastenedOriginConstraint: (asmId: VID, mate1:
|
|
515
|
-
matePath: VID[];
|
|
516
|
-
wcsId: VID;
|
|
517
|
-
flip: FlipType;
|
|
518
|
-
reoriented: ReorientedType;
|
|
519
|
-
}, xOffset: number | string, yOffset: number | string, zOffset: number | string, name: string) => Promise<ObjectID | null>;
|
|
408
|
+
createFastenedOriginConstraint: (asmId: VID, mate1: MateParam, xOffset: number | string, yOffset: number | string, zOffset: number | string, name: string) => Promise<ObjectID | null>;
|
|
520
409
|
/**
|
|
521
|
-
* Updates
|
|
522
|
-
* @param
|
|
410
|
+
* Updates multiple fastened origin constraints
|
|
411
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
523
412
|
* @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
|
|
524
413
|
* @param xOffset defines a offset in x-axis from mate1 to mate2
|
|
525
414
|
* @param yOffset defines a offset in y-axis from mate1 to mate2
|
|
526
415
|
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
527
416
|
* @example // tbd
|
|
528
|
-
* @image // tbd
|
|
529
417
|
*/
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
418
|
+
updateFastenedOriginConstraints: (...constraints: {
|
|
419
|
+
constrId: VID;
|
|
420
|
+
mate1: MateParam;
|
|
421
|
+
xOffset: number | string;
|
|
422
|
+
yOffset: number | string;
|
|
423
|
+
zOffset: number | string;
|
|
424
|
+
}[]) => Promise<void>;
|
|
536
425
|
/**
|
|
537
|
-
*
|
|
538
|
-
* @param
|
|
426
|
+
* Creates a cylindrical constraint between mate1 and mate2 within an assembly.
|
|
427
|
+
* @param asmId id of the assembly to create constraints on
|
|
428
|
+
* @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
|
|
429
|
+
* @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
|
|
430
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
431
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
432
|
+
* @param name name of the constraint
|
|
539
433
|
* @example // tbd
|
|
540
|
-
* @image // tbd
|
|
541
434
|
*/
|
|
542
|
-
|
|
435
|
+
createCylindricalConstraint: (asmId: VID, mate1: MateParam, mate2: MateParam, zOffsetLimits: LimitsParam, zRotationLimits: LimitsParam, name: string) => Promise<ObjectID | null>;
|
|
436
|
+
/**
|
|
437
|
+
* Updates multiple cylindrical constraints.
|
|
438
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
439
|
+
* @param constrId id of the constraint to update
|
|
440
|
+
* @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
|
|
441
|
+
* @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
|
|
442
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
443
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
444
|
+
* @example // tbd
|
|
445
|
+
*/
|
|
446
|
+
updateCylindricalConstraints: (...constraints: {
|
|
543
447
|
constrId: VID;
|
|
544
|
-
mate1:
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
448
|
+
mate1: MateParam;
|
|
449
|
+
mate2: MateParam;
|
|
450
|
+
zOffsetLimits: LimitsParam;
|
|
451
|
+
zRotationLimits: LimitsParam;
|
|
452
|
+
}[]) => Promise<void>;
|
|
453
|
+
/**
|
|
454
|
+
* Creates a revolute constraint between mate1 and mate2 within an assembly.
|
|
455
|
+
* @param asmId id of the assembly to create constraints on
|
|
456
|
+
* @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
|
|
457
|
+
* @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
|
|
458
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
459
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
460
|
+
* @param name name of the constraint
|
|
461
|
+
* @example // tbd
|
|
462
|
+
*/
|
|
463
|
+
createRevoluteConstraint: (asmId: VID, mate1: MateParam, mate2: MateParam, zOffset: number | string, zRotationLimits: LimitsParam, name: string) => Promise<ObjectID | null>;
|
|
464
|
+
/**
|
|
465
|
+
* Updates multiple revolute constraints.
|
|
466
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
467
|
+
* @param constrId id of the constraint to update
|
|
468
|
+
* @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
|
|
469
|
+
* @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
|
|
470
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
471
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
472
|
+
* @example // tbd
|
|
473
|
+
*/
|
|
474
|
+
updateRevoluteConstraints: (...constraints: {
|
|
475
|
+
constrId: VID;
|
|
476
|
+
mate1: MateParam;
|
|
477
|
+
mate2: MateParam;
|
|
478
|
+
zOffset: number | string;
|
|
479
|
+
zRotationLimits: LimitsParam;
|
|
480
|
+
}[]) => Promise<void>;
|
|
481
|
+
/**
|
|
482
|
+
* Creates a slider constraint between mate1 and mate2 within an assembly.
|
|
483
|
+
* @param asmId id of the assembly to create constraints on
|
|
484
|
+
* @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
|
|
485
|
+
* @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
|
|
486
|
+
* @param xOffset defines a offset in x-axis from mate1 to mate2
|
|
487
|
+
* @param yOffset defines a offset in y-axis from mate1 to mate2
|
|
488
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
489
|
+
* @param name name of the constraint
|
|
490
|
+
* @example // tbd
|
|
491
|
+
*/
|
|
492
|
+
createSliderConstraint: (asmId: VID, mate1: MateParam, mate2: MateParam, xOffset: number | string, yOffset: number | string, zOffsetLimits: LimitsParam, name: string) => Promise<ObjectID | null>;
|
|
493
|
+
/**
|
|
494
|
+
* Updates multiple slider constraints.
|
|
495
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
496
|
+
* @param constrId id of the constraint to update
|
|
497
|
+
* @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
|
|
498
|
+
* @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
|
|
499
|
+
* @param xOffset defines a offset in x-axis from mate1 to mate2
|
|
500
|
+
* @param yOffset defines a offset in y-axis from mate1 to mate2
|
|
501
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
502
|
+
* @example // tbd
|
|
503
|
+
*/
|
|
504
|
+
updateSliderConstraints: (...constraints: {
|
|
505
|
+
constrId: VID;
|
|
506
|
+
mate1: MateParam;
|
|
507
|
+
mate2: MateParam;
|
|
550
508
|
xOffset: number | string;
|
|
551
509
|
yOffset: number | string;
|
|
510
|
+
zOffsetLimits: LimitsParam;
|
|
511
|
+
}[]) => Promise<void>;
|
|
512
|
+
/**
|
|
513
|
+
* Creates a planar constraint between mate1 and mate2 within an assembly.
|
|
514
|
+
* @param asmId id of the assembly to create constraints on
|
|
515
|
+
* @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
|
|
516
|
+
* @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
|
|
517
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
518
|
+
* @param xOffsetLimits min and max value of offset along x
|
|
519
|
+
* @param yOffsetLimits min and max value of offset along y
|
|
520
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
521
|
+
* @param name name of the constraint
|
|
522
|
+
* @example // tbd
|
|
523
|
+
*/
|
|
524
|
+
createPlanarConstraint: (asmId: VID, mate1: MateParam, mate2: MateParam, zOffset: number | string, xOffsetLimits: LimitsParam, yOffsetLimits: LimitsParam, zRotationLimits: LimitsParam, name: string) => Promise<ObjectID | null>;
|
|
525
|
+
/**
|
|
526
|
+
* Updates multiple planar constraints.
|
|
527
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
528
|
+
* @param constrId id of the constraint to update
|
|
529
|
+
* @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
|
|
530
|
+
* @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
|
|
531
|
+
* @param zOffset defines a offset in z-axis from mate1 to mate2
|
|
532
|
+
* @param xOffsetLimits min and max value of offset along x
|
|
533
|
+
* @param yOffsetLimits min and max value of offset along y
|
|
534
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
535
|
+
* @example // tbd
|
|
536
|
+
*/
|
|
537
|
+
updatePlanarConstraints: (...constraints: {
|
|
538
|
+
constrId: VID;
|
|
539
|
+
mate1: MateParam;
|
|
540
|
+
mate2: MateParam;
|
|
552
541
|
zOffset: number | string;
|
|
542
|
+
xOffsetLimits: LimitsParam;
|
|
543
|
+
yOffsetLimits: LimitsParam;
|
|
544
|
+
zRotationLimits: LimitsParam;
|
|
545
|
+
}[]) => Promise<void>;
|
|
546
|
+
/**
|
|
547
|
+
* Creates a parallel constraint between mate1 and mate2 within an assembly.
|
|
548
|
+
* @param asmId id of the assembly to create constraints on
|
|
549
|
+
* @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
|
|
550
|
+
* @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
|
|
551
|
+
* @param xOffsetLimits min and max value of offset along x
|
|
552
|
+
* @param yOffsetLimits min and max value of offset along y
|
|
553
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
554
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
555
|
+
* @param name name of the constraint
|
|
556
|
+
* @example // tbd
|
|
557
|
+
*/
|
|
558
|
+
createParallelConstraint: (asmId: VID, mate1: MateParam, mate2: MateParam, xOffsetLimits: LimitsParam, yOffsetLimits: LimitsParam, zOffsetLimits: LimitsParam, zRotationLimits: LimitsParam, name: string) => Promise<ObjectID | null>;
|
|
559
|
+
/**
|
|
560
|
+
* Updates multiple parallel constraints.
|
|
561
|
+
* @param constraints array of constraint parameter objects. See following descriptions.
|
|
562
|
+
* @param constrId id of the constraint to update
|
|
563
|
+
* @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
|
|
564
|
+
* @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
|
|
565
|
+
* @param xOffsetLimits min and max value of offset along x
|
|
566
|
+
* @param yOffsetLimits min and max value of offset along y
|
|
567
|
+
* @param zOffsetLimits min and max value of offset along z
|
|
568
|
+
* @param zRotationLimits min and max value of rotation around z
|
|
569
|
+
* @example // tbd
|
|
570
|
+
*/
|
|
571
|
+
updateParallelConstraints: (...constraints: {
|
|
572
|
+
constrId: VID;
|
|
573
|
+
mate1: MateParam;
|
|
574
|
+
mate2: MateParam;
|
|
575
|
+
xOffsetLimits: LimitsParam;
|
|
576
|
+
yOffsetLimits: LimitsParam;
|
|
577
|
+
zOffsetLimits: LimitsParam;
|
|
578
|
+
zRotationLimits: LimitsParam;
|
|
579
|
+
}[]) => Promise<void>;
|
|
580
|
+
/**
|
|
581
|
+
* Updates limited value specified (with 'paramName') of multiple constraints
|
|
582
|
+
*/
|
|
583
|
+
update3dConstraintValues: (...constrValues: {
|
|
584
|
+
constrId: VID;
|
|
585
|
+
paramName: LimitedValue;
|
|
586
|
+
value: number;
|
|
553
587
|
}[]) => Promise<void>;
|
|
554
588
|
/**
|
|
555
589
|
* Creates the buffer geometry of the product (part or assembly).
|
|
@@ -560,21 +594,25 @@ export declare type ApiHistory = {
|
|
|
560
594
|
* api.cone(part, [], 20, 0, 30)
|
|
561
595
|
* const geoms = await api.createBufferGeometry(part)
|
|
562
596
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
563
|
-
* @image // tbd
|
|
564
597
|
*/
|
|
565
598
|
createBufferGeometry: (productId: VID) => Promise<BufferGeometry[] | undefined>;
|
|
566
599
|
/**
|
|
567
600
|
* Creates ThreeJS scene from current product
|
|
568
601
|
* @param productId id of the product to create scene from
|
|
569
602
|
* @param options optional object to define different settings.
|
|
570
|
-
* @param
|
|
571
|
-
* or if the
|
|
603
|
+
* @param meshPerGeometry boolean flag to define if a part/solid will have a mesh for each
|
|
604
|
+
* geometry element or if the elements will be merged to one mesh
|
|
605
|
+
* @return object containing all the created THREE objects like scene, nodes, solids and meshes
|
|
572
606
|
* @example // tbd
|
|
573
|
-
* @image // tbd
|
|
574
607
|
*/
|
|
575
608
|
createScene: (productId: VID, options?: {
|
|
576
|
-
|
|
577
|
-
}) => Promise<
|
|
609
|
+
meshPerGeometry?: boolean;
|
|
610
|
+
}) => Promise<{
|
|
611
|
+
scene: Scene;
|
|
612
|
+
nodes: Group[];
|
|
613
|
+
solids: Group[];
|
|
614
|
+
meshes: Mesh[];
|
|
615
|
+
}>;
|
|
578
616
|
/**
|
|
579
617
|
* Creates one or more expressions.
|
|
580
618
|
* @param partId id of part where to create the expression
|
|
@@ -586,7 +624,6 @@ export declare type ApiHistory = {
|
|
|
586
624
|
* api.box(part, [], 'ExpressionSet.width', 20, 20)
|
|
587
625
|
* const geoms = await api.createBufferGeometry(part)
|
|
588
626
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
589
|
-
* @image // tbd
|
|
590
627
|
*/
|
|
591
628
|
createExpressions: (partId: VID, ...members: {
|
|
592
629
|
name: string;
|
|
@@ -630,7 +667,6 @@ export declare type ApiHistory = {
|
|
|
630
667
|
*
|
|
631
668
|
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
632
669
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
633
|
-
* @image /doc/assets/history/assemblyTemplate.jpg
|
|
634
670
|
*/
|
|
635
671
|
createAssemblyAsTemplate: (name?: string) => ID;
|
|
636
672
|
/**
|
|
@@ -656,7 +692,6 @@ export declare type ApiHistory = {
|
|
|
656
692
|
* const partRef = await api.addNode(partTempl, rootAsm, [orig, xDir, yDir])
|
|
657
693
|
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
658
694
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
659
|
-
* @image // tbd
|
|
660
695
|
*/
|
|
661
696
|
createRootAssembly: (name?: string) => ID;
|
|
662
697
|
/**
|
|
@@ -668,7 +703,6 @@ export declare type ApiHistory = {
|
|
|
668
703
|
* api.cylinder(part, [], 10, 100)
|
|
669
704
|
* const geoms = await api.createBufferGeometry(part)
|
|
670
705
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
671
|
-
* @image // tbd
|
|
672
706
|
*/
|
|
673
707
|
createPart: (name?: string) => ID;
|
|
674
708
|
/**
|
|
@@ -694,7 +728,6 @@ export declare type ApiHistory = {
|
|
|
694
728
|
* const partRef = await api.addNode(partTempl, rootAsm, [orig, xDir, yDir])
|
|
695
729
|
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
696
730
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
697
|
-
* @image // tbd
|
|
698
731
|
*/
|
|
699
732
|
createPartAsTemplate: (name?: string) => ID;
|
|
700
733
|
/**
|
|
@@ -707,7 +740,6 @@ export declare type ApiHistory = {
|
|
|
707
740
|
* @param local if true, work axis is set in local coordinates of part???
|
|
708
741
|
* @param name name of the work axis, if not set default name = 'WorkAxis'
|
|
709
742
|
* @example //tbd
|
|
710
|
-
* @image // tbd
|
|
711
743
|
*/
|
|
712
744
|
createWorkAxis: (partId: VID, type: WorkAxisType, references: VID[], position: PointMemValue, direction: PointMemValue, local: boolean, name?: string) => ID;
|
|
713
745
|
/**
|
|
@@ -752,7 +784,6 @@ export declare type ApiHistory = {
|
|
|
752
784
|
* await api.createFastenedConstraint(rootAsm, { matePath: [prt1], wcsId: wcs3 }, { matePath: [prt2], wcsId: wcs2 }, 0, 0, 0, 0, 0, 'FC')
|
|
753
785
|
* const geoms = await api.createBufferGeometry(rootAsm)
|
|
754
786
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
755
|
-
* @image // tbd
|
|
756
787
|
*/
|
|
757
788
|
createWorkCoordSystem: (partId: VID, type: WorkCoordSystemType, references: VID[], coordinateSystem: PointMemValue[], offset: PointMemValue, rotation: PointMemValue, inverted: 0 | 1, local: boolean, name?: string) => ID;
|
|
758
789
|
/**
|
|
@@ -767,7 +798,6 @@ export declare type ApiHistory = {
|
|
|
767
798
|
* @param local if true, work plane is set in local coordinates of part???
|
|
768
799
|
* @param name name of the work plane, if not set default name = 'WorkAxis'
|
|
769
800
|
* @example // tbd
|
|
770
|
-
* @image // tbd
|
|
771
801
|
*/
|
|
772
802
|
createWorkPlane: (partId: VID, type: WorkPlaneType, references: VID[], offset: number, angle: number, position: PointMemValue, normal: PointMemValue, local: boolean, name?: string) => ID;
|
|
773
803
|
/**
|
|
@@ -780,7 +810,6 @@ export declare type ApiHistory = {
|
|
|
780
810
|
* @param local if true, work point is set in local coordinates of part???
|
|
781
811
|
* @param name name of the work point, if not set default name = 'WorkPoint'
|
|
782
812
|
* @example // tbd
|
|
783
|
-
* @image // tbd
|
|
784
813
|
*/
|
|
785
814
|
createWorkPoint: (partId: VID, type: WorkPointType, references: VID[], position: PointMemValue, local: boolean, name?: string) => ID;
|
|
786
815
|
/**
|
|
@@ -795,7 +824,6 @@ export declare type ApiHistory = {
|
|
|
795
824
|
* await api.box(part, [], 'ExpressionSet.width', 20, 20)
|
|
796
825
|
* const geoms = await api.createBufferGeometry(part)
|
|
797
826
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
798
|
-
* @image // tbd
|
|
799
827
|
*/
|
|
800
828
|
deleteExpressions: (partId: VID, members: string[]) => Promise<boolean>;
|
|
801
829
|
/**
|
|
@@ -841,7 +869,6 @@ export declare type ApiHistory = {
|
|
|
841
869
|
* api.sphere(part, [], 20)
|
|
842
870
|
* const geoms = await api.createBufferGeometry(part)
|
|
843
871
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
844
|
-
* @image // tbd
|
|
845
872
|
*/
|
|
846
873
|
sphere: (partId: VID, references: VID[], radius: number | string) => ID;
|
|
847
874
|
/**
|
|
@@ -857,7 +884,6 @@ export declare type ApiHistory = {
|
|
|
857
884
|
* api.fillet(part, topEdges, 2)
|
|
858
885
|
* const geoms = await api.createBufferGeometry(part)
|
|
859
886
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
860
|
-
* @image // tbd
|
|
861
887
|
*/
|
|
862
888
|
fillet: (partId: VID, references: VIDs, radius: number | string) => ID;
|
|
863
889
|
/**
|
|
@@ -875,7 +901,6 @@ export declare type ApiHistory = {
|
|
|
875
901
|
* If asmName is empty, all assemblies from assembly container will be returned.
|
|
876
902
|
* @param asmName Name of assembly to look for
|
|
877
903
|
* @example // tbd
|
|
878
|
-
* @image // tbd
|
|
879
904
|
*/
|
|
880
905
|
getAssemblyFromContainer: (asmName?: string) => IDs;
|
|
881
906
|
/**
|
|
@@ -884,13 +909,11 @@ export declare type ApiHistory = {
|
|
|
884
909
|
* @param refId Reference of the assembly to look for the node
|
|
885
910
|
* @param nodeName Name of the node to look for
|
|
886
911
|
* @example // tbd
|
|
887
|
-
* @image // tbd
|
|
888
912
|
*/
|
|
889
913
|
getAssemblyNode: (refId: VID, nodeName?: string) => IDs;
|
|
890
914
|
/**
|
|
891
915
|
* Returns the id of the current product
|
|
892
916
|
* @example // tbd
|
|
893
|
-
* @image // tbd
|
|
894
917
|
*/
|
|
895
918
|
getCurrentProduct: () => ID;
|
|
896
919
|
/**
|
|
@@ -898,7 +921,6 @@ export declare type ApiHistory = {
|
|
|
898
921
|
*
|
|
899
922
|
* @param refId Reference id of the node to set as the current
|
|
900
923
|
* @example // tbd
|
|
901
|
-
* @image // tbd
|
|
902
924
|
*/
|
|
903
925
|
setCurrentNode: (refId: VID) => Promise<void>;
|
|
904
926
|
/**
|
|
@@ -906,13 +928,11 @@ export declare type ApiHistory = {
|
|
|
906
928
|
*
|
|
907
929
|
* @param productId Id of the product to set as the current
|
|
908
930
|
* @example // tbd
|
|
909
|
-
* @image // tbd
|
|
910
931
|
*/
|
|
911
932
|
setCurrentProduct: (productId: VID) => Promise<void>;
|
|
912
933
|
/**
|
|
913
934
|
* Returns the id of the current node
|
|
914
935
|
* @example // tbd
|
|
915
|
-
* @image // tbd
|
|
916
936
|
*/
|
|
917
937
|
getCurrentNode: () => ID;
|
|
918
938
|
/**
|
|
@@ -921,7 +941,6 @@ export declare type ApiHistory = {
|
|
|
921
941
|
*
|
|
922
942
|
* @param refId Reference id of the node to get the coordinate system from
|
|
923
943
|
* @example // tbd
|
|
924
|
-
* @image // tbd
|
|
925
944
|
*/
|
|
926
945
|
getCoordSysFromNode: (refId: VID) => Promise<number[][]>;
|
|
927
946
|
/**
|
|
@@ -929,10 +948,11 @@ export declare type ApiHistory = {
|
|
|
929
948
|
* If partName is empty, all parts from part container will be returned.
|
|
930
949
|
* @param partName Name of part to look for
|
|
931
950
|
* @example // tbd
|
|
932
|
-
* @image // tbd
|
|
933
951
|
*/
|
|
934
952
|
getPartFromContainer: (partName?: string) => IDs;
|
|
935
953
|
/**
|
|
954
|
+
* @deprecated use getWorkGeometry() instead, getWorkCoordSystem() will be removed in a future release.
|
|
955
|
+
*
|
|
936
956
|
* Returns the work coord system with the given wcsName from the given reference.
|
|
937
957
|
* If wcsName is not set, all work coord systems of the reference will be returned.
|
|
938
958
|
* @param refId id of the reference to look for the work coord system
|
|
@@ -950,15 +970,23 @@ export declare type ApiHistory = {
|
|
|
950
970
|
* await api.createFastenedOriginConstraint(nutBoltAsm, { refId: boltRefId, wcsId: wcsIdOrigin[0] }, 0, 0, 0, 0, 0, 'FOC')
|
|
951
971
|
* const geoms = await api.createBufferGeometry(nutBoltAsm)
|
|
952
972
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
953
|
-
* @image // tbd
|
|
954
973
|
*/
|
|
955
974
|
getWorkCoordSystem: (refId: VID, wcsName?: string) => IDs;
|
|
956
975
|
/**
|
|
976
|
+
* Returns the work geometry of given type with given name. If the name of the work geometry is empty,
|
|
977
|
+
* all found work geometry of given type is returned
|
|
978
|
+
* @param refId id of the reference to look for the work geometry
|
|
979
|
+
* @param type type of the work geometry to look for
|
|
980
|
+
* @param wgName optional name of the work geometry to look for
|
|
981
|
+
*/
|
|
982
|
+
getWorkGeometry: (refId: VID, type: WorkGeomType, wgName?: string) => IDs;
|
|
983
|
+
/**
|
|
984
|
+
* @deprecated use specific methods e.g. getFastenedConstraint() instead, getConstraint() will be removed in a future release.
|
|
985
|
+
*
|
|
957
986
|
* Returns information about a constraint in the given reference
|
|
958
987
|
* @param refId id of the reference to look for the constraint
|
|
959
988
|
* @param constrName name of the constraint to look for
|
|
960
989
|
* @example // tbd
|
|
961
|
-
* @image // tbd
|
|
962
990
|
* @returns
|
|
963
991
|
* [
|
|
964
992
|
* constraintId,
|
|
@@ -970,13 +998,68 @@ export declare type ApiHistory = {
|
|
|
970
998
|
* ]
|
|
971
999
|
*/
|
|
972
1000
|
getConstraint: (refId: VID, constrName?: string) => Promise<ConstraintType>;
|
|
1001
|
+
/**
|
|
1002
|
+
* Returns the fastened constraint of given reference with specified name.
|
|
1003
|
+
* @param refId id of the reference to look for the constraint
|
|
1004
|
+
* @param constrName name of the constraint to look for
|
|
1005
|
+
* @example // tbd
|
|
1006
|
+
* @returns found fastened constraint as object.
|
|
1007
|
+
*/
|
|
1008
|
+
getFastenedConstraint: (refId: VID, constrName: string) => Promise<FastenedConstraintType>;
|
|
1009
|
+
/**
|
|
1010
|
+
* Returns the fastened origin constraint of given reference with specified name.
|
|
1011
|
+
* @param refId id of the reference to look for the constraint
|
|
1012
|
+
* @param constrName name of the constraint to look for
|
|
1013
|
+
* @example // tbd
|
|
1014
|
+
* @returns found fastened origin constraint as object.
|
|
1015
|
+
*/
|
|
1016
|
+
getFastenedOriginConstraint: (refId: VID, constrName: string) => Promise<FastenedOriginConstraintType>;
|
|
1017
|
+
/**
|
|
1018
|
+
* Returns the revolute constraint of given reference with specified name.
|
|
1019
|
+
* @param refId id of the reference to look for the constraint
|
|
1020
|
+
* @param constrName name of the constraint to look for
|
|
1021
|
+
* @example // tbd
|
|
1022
|
+
* @returns found revolute constraint as object.
|
|
1023
|
+
*/
|
|
1024
|
+
getRevoluteConstraint: (refId: VID, constrName: string) => Promise<RevoluteConstraintType>;
|
|
1025
|
+
/**
|
|
1026
|
+
* Returns the slider constraint of given reference with specified name.
|
|
1027
|
+
* @param refId id of the reference to look for the constraint
|
|
1028
|
+
* @param constrName name of the constraint to look for
|
|
1029
|
+
* @example // tbd
|
|
1030
|
+
* @returns found slider constraint as object.
|
|
1031
|
+
*/
|
|
1032
|
+
getSliderConstraint: (refId: VID, constrName: string) => Promise<SliderConstraintType>;
|
|
1033
|
+
/**
|
|
1034
|
+
* Returns the planar constraint of given reference with specified name.
|
|
1035
|
+
* @param refId id of the reference to look for the constraint
|
|
1036
|
+
* @param constrName name of the constraint to look for
|
|
1037
|
+
* @example // tbd
|
|
1038
|
+
* @returns found planar constraint as object.
|
|
1039
|
+
*/
|
|
1040
|
+
getPlanarConstraint: (refId: VID, constrName: string) => Promise<PlanarConstraintType>;
|
|
1041
|
+
/**
|
|
1042
|
+
* Returns the parallel constraint of given reference with specified name.
|
|
1043
|
+
* @param refId id of the reference to look for the constraint
|
|
1044
|
+
* @param constrName name of the constraint to look for
|
|
1045
|
+
* @example // tbd
|
|
1046
|
+
* @returns found parallel constraint as object.
|
|
1047
|
+
*/
|
|
1048
|
+
getParallelConstraint: (refId: VID, constrName: string) => Promise<ParallelConstraintType>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Returns the cylindrical constraint of given reference with specified name.
|
|
1051
|
+
* @param refId id of the reference to look for the constraint
|
|
1052
|
+
* @param constrName name of the constraint to look for
|
|
1053
|
+
* @example // tbd
|
|
1054
|
+
* @returns found cylindrical constraint as object.
|
|
1055
|
+
*/
|
|
1056
|
+
getCylindricalConstraint: (refId: VID, constrName: string) => Promise<CylindricalConstraintType>;
|
|
973
1057
|
/**
|
|
974
1058
|
* Returns the id of the feature with name = featureName. The feature can then
|
|
975
1059
|
* be used for further operations, like boolean, transformations and so on.
|
|
976
1060
|
* @param partId id of the part where to look for the feature
|
|
977
1061
|
* @param featureName name of the feature to look for
|
|
978
1062
|
* @example // tbd
|
|
979
|
-
* @image // tbd
|
|
980
1063
|
*/
|
|
981
1064
|
getFeatureByName: (partId: VID, featureName: string) => ID;
|
|
982
1065
|
/**
|
|
@@ -988,7 +1071,6 @@ export declare type ApiHistory = {
|
|
|
988
1071
|
*
|
|
989
1072
|
* @param type type to write
|
|
990
1073
|
* @example // tbd
|
|
991
|
-
* @image // tbd
|
|
992
1074
|
*/
|
|
993
1075
|
save: (type: 'ofb' | 'stp') => Promise<Uint8Array | null>;
|
|
994
1076
|
/**
|
|
@@ -996,7 +1078,6 @@ export declare type ApiHistory = {
|
|
|
996
1078
|
* @param url The url to POST the model to.
|
|
997
1079
|
* @param filetype The file type be saved (ofb, stp).
|
|
998
1080
|
* @example // tbd
|
|
999
|
-
* @image // tbd
|
|
1000
1081
|
*/
|
|
1001
1082
|
saveToUrl: (url: string, filetype: 'ofb' | 'stp') => Promise<boolean>;
|
|
1002
1083
|
/**
|
|
@@ -1004,7 +1085,6 @@ export declare type ApiHistory = {
|
|
|
1004
1085
|
* @param content data as arraybuffer
|
|
1005
1086
|
* @param type type of the data to load
|
|
1006
1087
|
* @example // tbd
|
|
1007
|
-
* @image // tbd
|
|
1008
1088
|
*/
|
|
1009
1089
|
load: (content: ArrayBuffer, type: 'ofb' | 'stp') => Promise<number[] | null>;
|
|
1010
1090
|
/**
|
|
@@ -1012,7 +1092,6 @@ export declare type ApiHistory = {
|
|
|
1012
1092
|
* @param url The url to load data from.
|
|
1013
1093
|
* @param filetype The type of data delivered by the url (ofb, stp).
|
|
1014
1094
|
* @example // tbd
|
|
1015
|
-
* @image // tbd
|
|
1016
1095
|
*/
|
|
1017
1096
|
loadFromUrl: (url: string, filetype: 'ofb' | 'stp') => Promise<number[] | null>;
|
|
1018
1097
|
/**
|
|
@@ -1024,7 +1103,6 @@ export declare type ApiHistory = {
|
|
|
1024
1103
|
* const part = api.loadProduct(arraybuffer, 'ofb')
|
|
1025
1104
|
* const geoms = await api.createBufferGeometry(part)
|
|
1026
1105
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
1027
|
-
* @image // tbd
|
|
1028
1106
|
*/
|
|
1029
1107
|
loadProduct: (content: ArrayBuffer, type: 'ofb' | 'stp') => Promise<number[] | null>;
|
|
1030
1108
|
/**
|
|
@@ -1032,7 +1110,6 @@ export declare type ApiHistory = {
|
|
|
1032
1110
|
* @param url The url to load data from.
|
|
1033
1111
|
* @param filetype The type of data delivered by the url ('ofb', 'stp').
|
|
1034
1112
|
* @example // tbd
|
|
1035
|
-
* @image // tbd
|
|
1036
1113
|
*/
|
|
1037
1114
|
loadProductFromUrl: (url: string, filetype: 'ofb' | 'stp') => Promise<number[] | null>;
|
|
1038
1115
|
/**
|
|
@@ -1043,22 +1120,14 @@ export declare type ApiHistory = {
|
|
|
1043
1120
|
* @param format the content format
|
|
1044
1121
|
* @param name optional name for the feature, default = 'Import'
|
|
1045
1122
|
* @example // tbd
|
|
1046
|
-
* @image // tbd
|
|
1047
1123
|
*/
|
|
1048
1124
|
importFeature: (partId: VID, content: ArrayBuffer, format: 'stp' | 'step', name?: string) => ID;
|
|
1049
1125
|
/**
|
|
1050
|
-
* Removes
|
|
1126
|
+
* Removes multiple nodes from an assembly node at once
|
|
1127
|
+
* @param nodes array of node parameter objects. See following descriptions.
|
|
1051
1128
|
* @param referenceId id of the node to remove
|
|
1052
1129
|
* @param ownerId id of the assembly node to remove the node from
|
|
1053
1130
|
* @example // tbd
|
|
1054
|
-
* @image // tbd
|
|
1055
|
-
*/
|
|
1056
|
-
removeNode: (referenceId: VID, ownerId: VID) => Promise<void>;
|
|
1057
|
-
/**
|
|
1058
|
-
* Removes multiple nodes from an assembly node at once
|
|
1059
|
-
* @param nodes array of node parameter objects. See also removeNode().
|
|
1060
|
-
* @example // tbd
|
|
1061
|
-
* @image // tbd
|
|
1062
1131
|
*/
|
|
1063
1132
|
removeNodes: (...nodes: {
|
|
1064
1133
|
referenceId: VID;
|
|
@@ -1071,7 +1140,6 @@ export declare type ApiHistory = {
|
|
|
1071
1140
|
* @param ownerId id of the owner (parent) of node we want to transform
|
|
1072
1141
|
* @param transformation array of three vectors [origin, xAxis, yAxis]
|
|
1073
1142
|
* @example // tbd
|
|
1074
|
-
* @image // tbd
|
|
1075
1143
|
*/
|
|
1076
1144
|
transformNode: (referenceId: VID, ownerId: VID, transformation: Transform) => Promise<void>;
|
|
1077
1145
|
/**
|
|
@@ -1082,15 +1150,15 @@ export declare type ApiHistory = {
|
|
|
1082
1150
|
* @param inverted flag if direction is inverted or not
|
|
1083
1151
|
* @param distance distance of translation
|
|
1084
1152
|
* @example // tbd
|
|
1085
|
-
* @image // tbd
|
|
1086
1153
|
*/
|
|
1087
1154
|
translate: (partId: VID, featureIds: VID[], references: VID[], inverted: 0 | 1, distance: number | string) => ID;
|
|
1088
1155
|
/**
|
|
1156
|
+
* @deprecated use translate() instead, updateTranslate() will be removed in a future release.
|
|
1157
|
+
*
|
|
1089
1158
|
* Updates a already created translation. To update value will be distance of translation
|
|
1090
1159
|
* @param translationId id of the translation (feature id) which will be updated
|
|
1091
1160
|
* @param distance new value for distance
|
|
1092
1161
|
* @example // tbd
|
|
1093
|
-
* @image // tbd
|
|
1094
1162
|
*/
|
|
1095
1163
|
updateTranslate: (translationId: VID, distance: number) => Promise<void>;
|
|
1096
1164
|
/**
|
|
@@ -1107,43 +1175,39 @@ export declare type ApiHistory = {
|
|
|
1107
1175
|
* api.fillet(part, edges, 2)
|
|
1108
1176
|
* const geoms = await api.createBufferGeometry(part)
|
|
1109
1177
|
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
1110
|
-
* @image // tbd
|
|
1111
1178
|
*/
|
|
1112
1179
|
pick: (partId: VID, type: 'vertex' | 'edge' | 'face', points: PointMemValue[]) => IDs;
|
|
1113
1180
|
/**
|
|
1114
|
-
* Updates
|
|
1181
|
+
* Updates multiple expressions in different parts at once
|
|
1182
|
+
*
|
|
1183
|
+
* @param expressions array of expression objects containing the part id and the expression to set
|
|
1115
1184
|
* @param partId id of part to update expression
|
|
1116
1185
|
* @param members array of members to update which contain a name and a value. Value can be an expression, e.g. '2 * laenge'
|
|
1117
|
-
* @example
|
|
1118
|
-
* // Sets expression height to value = 30
|
|
1119
|
-
* const part = api.createPart('Part')
|
|
1120
|
-
* api.createExpressions(part, { name: 'width', value: 20 }, { name: 'height', value: 40 })
|
|
1121
|
-
* api.setExpressions(part, { name: 'height', value: 30 })
|
|
1122
|
-
* await api.box(part, [], 'ExpressionSet.width', 20, 'ExpressionSet.height')
|
|
1123
|
-
* const geoms = await api.createBufferGeometry(part)
|
|
1124
|
-
* return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
|
|
1125
|
-
* @image // tbd
|
|
1126
|
-
* @returns true, if updating expressions was successfull
|
|
1127
|
-
*/
|
|
1128
|
-
setExpressions: (partId: VID, ...members: {
|
|
1129
|
-
name: string;
|
|
1130
|
-
value: number | string;
|
|
1131
|
-
}[]) => Promise<boolean>;
|
|
1132
|
-
/**
|
|
1133
|
-
* Updates multiple expression sets in different parts at once
|
|
1134
|
-
*
|
|
1135
|
-
* @param exprSets array of expression objects containing the part id and the expression to set
|
|
1136
1186
|
* @example // tbd
|
|
1137
|
-
* @
|
|
1138
|
-
* @returns true, if updating expressions in all expression sets was successfull
|
|
1187
|
+
* @returns true, if updating expressions in all parts was successfull
|
|
1139
1188
|
*/
|
|
1140
|
-
|
|
1189
|
+
setExpressions: (...expressions: {
|
|
1141
1190
|
partId: number;
|
|
1142
1191
|
members: {
|
|
1143
1192
|
name: string;
|
|
1144
1193
|
value: number | string;
|
|
1145
1194
|
}[];
|
|
1146
1195
|
}[]) => Promise<boolean>;
|
|
1196
|
+
/**
|
|
1197
|
+
* Mirrors the entities of a feature at the position of the plane reference
|
|
1198
|
+
* @param partId id of the part where the mirror will be created
|
|
1199
|
+
* @param entities id of the feature/operation we want to use entities from
|
|
1200
|
+
* @param references id of the references which will be used to mirror (e.g. Workplane)
|
|
1201
|
+
*/
|
|
1202
|
+
mirror: (partId: VID, entities: VID[], references: VID[]) => Promise<ObjectID | null>;
|
|
1203
|
+
/**
|
|
1204
|
+
* Removes the given operations or the operations which are added after 'toOperation' in history, depending
|
|
1205
|
+
* on whether operations or toOperation parameter is given.
|
|
1206
|
+
* @param operations ids of all to remove operations. First element in the array will be removed first.
|
|
1207
|
+
* This means operations which depend on eacht other, need to be removed from newest to oldest.
|
|
1208
|
+
* @param toOperation all operations, from rollback bar until the id of this operation, will be deleted
|
|
1209
|
+
*/
|
|
1210
|
+
removeOperations: (operations: VID[], toOperation: VID) => Promise<void>;
|
|
1147
1211
|
};
|
|
1148
1212
|
export default class CAD {
|
|
1149
1213
|
private drawingId;
|
|
@@ -1162,6 +1226,12 @@ declare type Point = {
|
|
|
1162
1226
|
y: number;
|
|
1163
1227
|
z: number;
|
|
1164
1228
|
};
|
|
1229
|
+
declare type MateParam = {
|
|
1230
|
+
matePath: VID[];
|
|
1231
|
+
wcsId: VID;
|
|
1232
|
+
flip: FlipType;
|
|
1233
|
+
reoriented: ReorientedType;
|
|
1234
|
+
};
|
|
1165
1235
|
export declare type Transform = [Point, Point, Point];
|
|
1166
1236
|
export declare type DimensionType = {
|
|
1167
1237
|
productId: VID;
|
|
@@ -1186,34 +1256,59 @@ export declare type ViewOptionsType = {
|
|
|
1186
1256
|
};
|
|
1187
1257
|
export declare type FastenedOriginConstraintType = {
|
|
1188
1258
|
constrId: VID;
|
|
1189
|
-
mate1:
|
|
1190
|
-
matePath: VID[];
|
|
1191
|
-
wcsId: VID;
|
|
1192
|
-
flip: number;
|
|
1193
|
-
reoriented: number;
|
|
1194
|
-
};
|
|
1259
|
+
mate1: MateParam;
|
|
1195
1260
|
xOffset: number | string;
|
|
1196
1261
|
yOffset: number | string;
|
|
1197
1262
|
zOffset: number | string;
|
|
1198
1263
|
};
|
|
1199
1264
|
export declare type FastenedConstraintType = {
|
|
1200
1265
|
constrId: VID;
|
|
1201
|
-
mate1:
|
|
1202
|
-
|
|
1203
|
-
wcsId: VID;
|
|
1204
|
-
flip: number;
|
|
1205
|
-
reoriented: number;
|
|
1206
|
-
};
|
|
1207
|
-
mate2: {
|
|
1208
|
-
matePath: VID[];
|
|
1209
|
-
wcsId: VID;
|
|
1210
|
-
flip: number;
|
|
1211
|
-
reoriented: number;
|
|
1212
|
-
};
|
|
1266
|
+
mate1: MateParam;
|
|
1267
|
+
mate2: MateParam;
|
|
1213
1268
|
xOffset: number | string;
|
|
1214
1269
|
yOffset: number | string;
|
|
1215
1270
|
zOffset: number | string;
|
|
1216
1271
|
};
|
|
1272
|
+
export declare type RevoluteConstraintType = {
|
|
1273
|
+
constrId: VID;
|
|
1274
|
+
mate1: MateParam;
|
|
1275
|
+
mate2: MateParam;
|
|
1276
|
+
zOffset: number | string;
|
|
1277
|
+
zRotationLimits: LimitsParam;
|
|
1278
|
+
};
|
|
1279
|
+
export declare type SliderConstraintType = {
|
|
1280
|
+
constrId: VID;
|
|
1281
|
+
mate1: MateParam;
|
|
1282
|
+
mate2: MateParam;
|
|
1283
|
+
xOffset: number | string;
|
|
1284
|
+
yOffset: number | string;
|
|
1285
|
+
zOffsetLimits: LimitsParam;
|
|
1286
|
+
};
|
|
1287
|
+
export declare type PlanarConstraintType = {
|
|
1288
|
+
constrId: VID;
|
|
1289
|
+
mate1: MateParam;
|
|
1290
|
+
mate2: MateParam;
|
|
1291
|
+
zOffset: number | string;
|
|
1292
|
+
xOffsetLimits: LimitsParam;
|
|
1293
|
+
yOffsetLimits: LimitsParam;
|
|
1294
|
+
zRotationLimits: LimitsParam;
|
|
1295
|
+
};
|
|
1296
|
+
export declare type ParallelConstraintType = {
|
|
1297
|
+
constrId: VID;
|
|
1298
|
+
mate1: MateParam;
|
|
1299
|
+
mate2: MateParam;
|
|
1300
|
+
xOffsetLimits: LimitsParam;
|
|
1301
|
+
yOffsetLimits: LimitsParam;
|
|
1302
|
+
zOffsetLimits: LimitsParam;
|
|
1303
|
+
zRotationLimits: LimitsParam;
|
|
1304
|
+
};
|
|
1305
|
+
export declare type CylindricalConstraintType = {
|
|
1306
|
+
constrId: VID;
|
|
1307
|
+
mate1: MateParam;
|
|
1308
|
+
mate2: MateParam;
|
|
1309
|
+
zOffsetLimits: LimitsParam;
|
|
1310
|
+
zRotationLimits: LimitsParam;
|
|
1311
|
+
};
|
|
1217
1312
|
/**
|
|
1218
1313
|
* Information about constraint.
|
|
1219
1314
|
* [
|