@buerli.io/headless 0.13.1-beta.8.apiversion → 0.13.1-beta.9

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.
@@ -2122,6 +2122,14 @@ class History {
2122
2122
  const success = await featureAPI.updateExpressions(expressionsToSet);
2123
2123
  return success;
2124
2124
  },
2125
+ renameExpressions: (partId, members) => {
2126
+ return this.resolve(async ([rPartId]) => {
2127
+ const success = featureAPI.updateExpressions([
2128
+ { productId: rPartId, toAddMembers: [], toModifyMembers: [], toRenameMembers: members, toDeleteList: [] },
2129
+ ]);
2130
+ return success;
2131
+ }, partId);
2132
+ },
2125
2133
  deleteExpressions: (partId, members) => {
2126
2134
  return this.resolve(async ([rPartId]) => {
2127
2135
  const success = featureAPI.updateExpressions([
@@ -2119,6 +2119,14 @@ export class History {
2119
2119
  const success = await featureAPI.updateExpressions(expressionsToSet);
2120
2120
  return success;
2121
2121
  },
2122
+ renameExpressions: (partId, members) => {
2123
+ return this.resolve(async ([rPartId]) => {
2124
+ const success = featureAPI.updateExpressions([
2125
+ { productId: rPartId, toAddMembers: [], toModifyMembers: [], toRenameMembers: members, toDeleteList: [] },
2126
+ ]);
2127
+ return success;
2128
+ }, partId);
2129
+ },
2122
2130
  deleteExpressions: (partId, members) => {
2123
2131
  return this.resolve(async ([rPartId]) => {
2124
2132
  const success = featureAPI.updateExpressions([
@@ -2,6 +2,8 @@ import { BooleanOperationType, ChamferType, FlipType, ReorientedType, WorkAxisTy
2
2
  import { DrawingID, InteractionInfo, GeometryElement, DrawingState, BuerliState } from '@buerli.io/core';
3
3
  import { BufferGeometry, Material, Object3D, Scene } from 'three';
4
4
  /**
5
+ * @deprecated replaced by @see BuerliCadFacade in buerli.io/classcad
6
+ *
5
7
  * History based modeling is similar to solid modeling, but it is non-destructive and
6
8
  * parametric. You can move back and forth in the modeling history and create feature
7
9
  * expressions which you can alter at a later time, prompting your model to re-calculate.
@@ -1515,6 +1517,24 @@ export declare type ApiHistory = {
1515
1517
  value: number | string;
1516
1518
  }[];
1517
1519
  }[]) => Promise<boolean>;
1520
+ /**
1521
+ * Renames existing expressions.
1522
+ * @param partId id or identifier of part to rename expressions from
1523
+ * @param members name of members to rename
1524
+ * @example
1525
+ * // Renames an expression from part's expression set
1526
+ * const part = api.createPart('Part')
1527
+ * api.createExpressions(part, { name: 'width', value: 20 }, { name: 'h', value: 40 })
1528
+ * api.renameExpressions(part, [{ name: 'h', newName: 'height'}])
1529
+ * await api.box(part, [], 20, 20, 'ExpressionSet.height')
1530
+ * const geoms = await api.createBufferGeometry(part)
1531
+ * return geoms.map(geom => new THREE.Mesh(geom, new THREE.MeshStandardMaterial()))
1532
+ * @return true or false, depending on whether renaming the expressions was successful or not
1533
+ */
1534
+ renameExpressions: (partId: VID | ObjectIdent, members: {
1535
+ name: string;
1536
+ newName: string;
1537
+ }[]) => Promise<boolean>;
1518
1538
  /**
1519
1539
  * Creates a mirror operation.
1520
1540
  * Mirrors the entities of an operation at the position of the plane reference
@@ -2,6 +2,8 @@ import { ObjectID } from '@buerli.io/classcad';
2
2
  import { BuerliState, DrawingID, DrawingState } from '@buerli.io/core';
3
3
  import { BufferGeometry, Scene, Vector3 } from 'three';
4
4
  /**
5
+ * @deprecated replaced by @see BuerliCadFacade in buerli.io/classcad
6
+ *
5
7
  * A simple and intuitive javascript based api that incorporates solid operations like
6
8
  * shapes, booleans (unions, subtracts, intersections), extrusions, revolves, blends,
7
9
  * chamfers, slices, arrays, patterns, offsets, etc. The api is compatible with THREEJS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerli.io/headless",
3
- "version": "0.13.1-beta.8.apiversion",
3
+ "version": "0.13.1-beta.9",
4
4
  "description": "A non-manifold CAD workflow for the web",
5
5
  "author": "AWV Informatik AG <info@awv-informatik.ch>",
6
6
  "license": "ISC",
@@ -32,7 +32,7 @@
32
32
  "three-stdlib": ">=2.11.0"
33
33
  },
34
34
  "dependencies": {
35
- "@buerli.io/classcad": "0.13.1-beta.8.apiversion",
35
+ "@buerli.io/classcad": "0.13.1-beta.9",
36
36
  "flat-promise": "^1.0.3"
37
37
  }
38
38
  }