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