@buerli.io/core 0.13.1-beta.3 → 0.13.1-beta.5.apiversion

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.
Files changed (36) hide show
  1. package/build/cjs/geometry/ThreeGeometryCreator.js +28 -28
  2. package/build/cjs/graphic/filters.js +11 -11
  3. package/build/cjs/index.js +1 -0
  4. package/build/cjs/re-export.js +29 -0
  5. package/build/cjs/store/states/selection.js +6 -6
  6. package/build/cjs/types/index.js +17 -3
  7. package/build/cjs/utils/Measure.js +56 -56
  8. package/build/esm/geometry/ThreeGeometryCreator.js +1 -1
  9. package/build/esm/graphic/filters.js +1 -1
  10. package/build/esm/index.js +1 -0
  11. package/build/esm/re-export.js +23 -0
  12. package/build/esm/store/states/selection.js +6 -6
  13. package/build/esm/store/states/structure.js +1 -1
  14. package/build/esm/types/index.js +15 -3
  15. package/build/esm/utils/Measure.js +1 -1
  16. package/build/types/geometry/ThreeGeometryCreator.d.ts +12 -12
  17. package/build/types/graphic/filters.d.ts +1 -1
  18. package/build/types/index.d.ts +1 -0
  19. package/build/types/re-export.d.ts +70 -0
  20. package/build/types/store/states/geometry.d.ts +1 -2
  21. package/build/types/store/states/graphic.d.ts +1 -2
  22. package/build/types/store/states/plugin.d.ts +1 -1
  23. package/build/types/store/states/selection.d.ts +13 -6
  24. package/build/types/store/states/structure.d.ts +1 -1
  25. package/build/types/types/InteractionInfo.d.ts +1 -2
  26. package/build/types/types/index.d.ts +6 -3
  27. package/package.json +4 -3
  28. package/build/cjs/types/IGraphicPackage.js +0 -46
  29. package/build/cjs/types/IStructurePatch.js +0 -2
  30. package/build/cjs/types/IStructureTree.js +0 -28
  31. package/build/esm/types/IGraphicPackage.js +0 -43
  32. package/build/esm/types/IStructurePatch.js +0 -1
  33. package/build/esm/types/IStructureTree.js +0 -24
  34. package/build/types/types/IGraphicPackage.d.ts +0 -160
  35. package/build/types/types/IStructurePatch.d.ts +0 -6
  36. package/build/types/types/IStructureTree.d.ts +0 -80
@@ -25,18 +25,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.isEqualGeometry = exports.EMPTY_CONTAINER_GEOMETRY = exports.ThreeGeometryCreator = void 0;
27
27
  const THREE = __importStar(require("three"));
28
- const types_1 = require("./../types");
28
+ const re_export_1 = require("../re-export");
29
29
  const convertType = (contType) => {
30
- let type = types_1.GraphicType.NONE;
30
+ let type = re_export_1.GraphicType.NONE;
31
31
  switch (contType) {
32
- case types_1.ContainerType.BREP:
33
- type = types_1.GraphicType.BREP;
32
+ case re_export_1.ContainerType.BREP:
33
+ type = re_export_1.GraphicType.BREP;
34
34
  break;
35
- case types_1.ContainerType.CURVEARRAY:
36
- type = types_1.GraphicType.CURVEARRAY;
35
+ case re_export_1.ContainerType.CURVEARRAY:
36
+ type = re_export_1.GraphicType.CURVEARRAY;
37
37
  break;
38
- case types_1.ContainerType.POLYBREP:
39
- type = types_1.GraphicType.POLYBREP;
38
+ case re_export_1.ContainerType.POLYBREP:
39
+ type = re_export_1.GraphicType.POLYBREP;
40
40
  break;
41
41
  }
42
42
  return type;
@@ -126,16 +126,16 @@ class ThreeGeometryCreator {
126
126
  createSurface(mesh, container, color) {
127
127
  let meshGeom = this.createMesh(mesh, container, color);
128
128
  switch (meshGeom.type) {
129
- case types_1.GraphicType.PLANE:
129
+ case re_export_1.GraphicType.PLANE:
130
130
  meshGeom = this.createPlane(mesh, meshGeom);
131
131
  break;
132
- case types_1.GraphicType.CYLINDER:
132
+ case re_export_1.GraphicType.CYLINDER:
133
133
  meshGeom = this.createCylinder(mesh, meshGeom);
134
134
  break;
135
- case types_1.GraphicType.CONE:
135
+ case re_export_1.GraphicType.CONE:
136
136
  meshGeom = this.createCone(mesh, meshGeom);
137
137
  break;
138
- case types_1.GraphicType.SPHERE:
138
+ case re_export_1.GraphicType.SPHERE:
139
139
  meshGeom = this.createSphere(mesh, meshGeom);
140
140
  break;
141
141
  }
@@ -157,36 +157,36 @@ class ThreeGeometryCreator {
157
157
  loops }, this.getMetadata(mesh, container, color));
158
158
  }
159
159
  createPlane(mesh, meshGeom) {
160
- const type = types_1.GraphicType.PLANE;
160
+ const type = re_export_1.GraphicType.PLANE;
161
161
  const { normal: n, pointOnPlane: p } = mesh.properties.surface;
162
162
  const pointOnPlane = new THREE.Vector3(p[0], p[1], p[2]);
163
163
  const normal = new THREE.Vector3(n[0], n[1], n[2]).normalize();
164
164
  return Object.assign(Object.assign({}, meshGeom), { type, pointOnPlane, normal });
165
165
  }
166
166
  createCylinder(mesh, meshGeom) {
167
- const type = types_1.GraphicType.CYLINDER;
167
+ const type = re_export_1.GraphicType.CYLINDER;
168
168
  const { origin: o, axis: a, height, radius } = mesh.properties.surface;
169
169
  const origin = new THREE.Vector3(o[0], o[1], o[2]);
170
170
  const axis = new THREE.Vector3(a[0], a[1], a[2]).normalize();
171
171
  return Object.assign(Object.assign({}, meshGeom), { type, origin, axis, height, radius });
172
172
  }
173
173
  createCone(mesh, meshGeom) {
174
- const type = types_1.GraphicType.CONE;
174
+ const type = re_export_1.GraphicType.CONE;
175
175
  const { origin: o, axis: a, height, radiusBottom, radiusTop } = mesh.properties.surface;
176
176
  const origin = new THREE.Vector3(o[0], o[1], o[2]);
177
177
  const axis = new THREE.Vector3(a[0], a[1], a[2]).normalize();
178
178
  return Object.assign(Object.assign({}, meshGeom), { type, origin, axis, height, radiusBottom, radiusTop });
179
179
  }
180
180
  createSphere(mesh, meshGeom) {
181
- const type = types_1.GraphicType.SPHERE;
181
+ const type = re_export_1.GraphicType.SPHERE;
182
182
  const { radius } = mesh.properties.surface;
183
183
  return Object.assign(Object.assign({}, meshGeom), { type, radius });
184
184
  }
185
185
  createLine(line, container, points, color) {
186
186
  const graphicId = line.id;
187
- let type = types_1.GraphicType.LINE;
188
- if (container.type === types_1.ContainerType.CURVEARRAY) {
189
- type = types_1.GraphicType.CURVELINE;
187
+ let type = re_export_1.GraphicType.LINE;
188
+ if (container.type === re_export_1.ContainerType.CURVEARRAY) {
189
+ type = re_export_1.GraphicType.CURVELINE;
190
190
  }
191
191
  const pts = line.points;
192
192
  const [startId, endId] = line.pointIds;
@@ -201,9 +201,9 @@ class ThreeGeometryCreator {
201
201
  createEdge(edge, container, points, color) {
202
202
  const threePts = [];
203
203
  const graphicId = edge.id;
204
- let type = types_1.GraphicType.NURBSCURVE;
205
- if (container.type === types_1.ContainerType.CURVEARRAY) {
206
- type = types_1.GraphicType.CURVESPLINE;
204
+ let type = re_export_1.GraphicType.NURBSCURVE;
205
+ if (container.type === re_export_1.ContainerType.CURVEARRAY) {
206
+ type = re_export_1.GraphicType.CURVESPLINE;
207
207
  }
208
208
  const pts = edge.points;
209
209
  for (let i = 0, length = pts.length / 3; i < length; i++) {
@@ -230,9 +230,9 @@ class ThreeGeometryCreator {
230
230
  }
231
231
  createArc(arc, container, points, color) {
232
232
  const graphicId = arc.id;
233
- let type = arc.isCircle ? types_1.GraphicType.CIRCLE : types_1.GraphicType.ARC;
234
- if (container.type === types_1.ContainerType.CURVEARRAY) {
235
- type = arc.isCircle ? types_1.GraphicType.CURVECIRCLE : types_1.GraphicType.CURVEARC;
233
+ let type = arc.isCircle ? re_export_1.GraphicType.CIRCLE : re_export_1.GraphicType.ARC;
234
+ if (container.type === re_export_1.ContainerType.CURVEARRAY) {
235
+ type = arc.isCircle ? re_export_1.GraphicType.CURVECIRCLE : re_export_1.GraphicType.CURVEARC;
236
236
  }
237
237
  // take half of coordHeightTolerance used for faces, as classcad does it in the tessellation process
238
238
  const coordHeight = this.coordHeightTolerance / 2;
@@ -278,7 +278,7 @@ class ThreeGeometryCreator {
278
278
  }
279
279
  createPoint(container, key, graphicId, position, ownerId, type) {
280
280
  return Object.assign(Object.assign({ key,
281
- graphicId, type: (container.type === types_1.ContainerType.CURVEARRAY ? types_1.GraphicType.CURVEPOINT : types_1.GraphicType.POINT) }, this.getMetadata(null, container)), { position: position.clone(), geometry: position.clone(), owners: [{ ownerId, type }] });
281
+ graphicId, type: (container.type === re_export_1.ContainerType.CURVEARRAY ? re_export_1.GraphicType.CURVEPOINT : re_export_1.GraphicType.POINT) }, this.getMetadata(null, container)), { position: position.clone(), geometry: position.clone(), owners: [{ ownerId, type }] });
282
282
  }
283
283
  insertPoint(container, key, graphicId, position, ownerId, type, points) {
284
284
  const existingPoint = points[key];
@@ -297,7 +297,7 @@ exports.ThreeGeometryCreator = ThreeGeometryCreator;
297
297
  const EMPTY_CONTAINER_GEOMETRY = () => {
298
298
  return {
299
299
  graphicId: Number.NaN,
300
- type: types_1.GraphicType.NONE,
300
+ type: re_export_1.GraphicType.NONE,
301
301
  map: {},
302
302
  meshes: [],
303
303
  lines: [],
@@ -305,7 +305,7 @@ const EMPTY_CONTAINER_GEOMETRY = () => {
305
305
  arcs: [],
306
306
  points: [],
307
307
  box: { min: new THREE.Vector3(), max: new THREE.Vector3() },
308
- container: { id: Number.NaN, ownerId: Number.NaN, type: types_1.GraphicType.NONE },
308
+ container: { id: Number.NaN, ownerId: Number.NaN, type: re_export_1.GraphicType.NONE },
309
309
  color: new THREE.Color(),
310
310
  opacity: 1.0,
311
311
  layer: null,
@@ -1,25 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.solidFilter = exports.loopFilter = exports.planeFilter = exports.meshFilter = exports.pointFilter = exports.arcCircleFilter = exports.circleFilter = exports.arcFilter = exports.edgeFilter = exports.lineFilter = void 0;
4
+ const re_export_1 = require("../re-export");
4
5
  const selection_1 = require("../store/states/selection");
5
- const IGraphicPackage_1 = require("../types/IGraphicPackage");
6
- const lineFilter = (scope, data) => scope === selection_1.BuerliScope && data === IGraphicPackage_1.GraphicType.LINE;
6
+ const lineFilter = (scope, data) => scope === selection_1.BuerliScope && data === re_export_1.GraphicType.LINE;
7
7
  exports.lineFilter = lineFilter;
8
- const edgeFilter = (scope, data) => scope === selection_1.BuerliScope && IGraphicPackage_1.EdgeTypes.includes(data);
8
+ const edgeFilter = (scope, data) => scope === selection_1.BuerliScope && re_export_1.EdgeTypes.includes(data);
9
9
  exports.edgeFilter = edgeFilter;
10
- const arcFilter = (scope, data) => scope === selection_1.BuerliScope && data === IGraphicPackage_1.GraphicType.ARC;
10
+ const arcFilter = (scope, data) => scope === selection_1.BuerliScope && data === re_export_1.GraphicType.ARC;
11
11
  exports.arcFilter = arcFilter;
12
- const circleFilter = (scope, data) => scope === selection_1.BuerliScope && data === IGraphicPackage_1.GraphicType.CIRCLE;
12
+ const circleFilter = (scope, data) => scope === selection_1.BuerliScope && data === re_export_1.GraphicType.CIRCLE;
13
13
  exports.circleFilter = circleFilter;
14
- const arcCircleFilter = (scope, data) => scope === selection_1.BuerliScope && (data === IGraphicPackage_1.GraphicType.ARC || data === IGraphicPackage_1.GraphicType.CIRCLE);
14
+ const arcCircleFilter = (scope, data) => scope === selection_1.BuerliScope && (data === re_export_1.GraphicType.ARC || data === re_export_1.GraphicType.CIRCLE);
15
15
  exports.arcCircleFilter = arcCircleFilter;
16
- const pointFilter = (scope, data) => scope === selection_1.BuerliScope && data === IGraphicPackage_1.GraphicType.POINT;
16
+ const pointFilter = (scope, data) => scope === selection_1.BuerliScope && data === re_export_1.GraphicType.POINT;
17
17
  exports.pointFilter = pointFilter;
18
- const meshFilter = (scope, data) => scope === selection_1.BuerliScope && IGraphicPackage_1.MeshTypes.includes(data);
18
+ const meshFilter = (scope, data) => scope === selection_1.BuerliScope && re_export_1.MeshTypes.includes(data);
19
19
  exports.meshFilter = meshFilter;
20
- const planeFilter = (scope, data) => scope === selection_1.BuerliScope && data === IGraphicPackage_1.GraphicType.PLANE;
20
+ const planeFilter = (scope, data) => scope === selection_1.BuerliScope && data === re_export_1.GraphicType.PLANE;
21
21
  exports.planeFilter = planeFilter;
22
- const loopFilter = (scope, data) => scope === selection_1.BuerliScope && data === IGraphicPackage_1.GraphicType.LOOP;
22
+ const loopFilter = (scope, data) => scope === selection_1.BuerliScope && data === re_export_1.GraphicType.LOOP;
23
23
  exports.loopFilter = loopFilter;
24
- const solidFilter = (scope, data) => scope === selection_1.BuerliScope && data === IGraphicPackage_1.GraphicType.BREP;
24
+ const solidFilter = (scope, data) => scope === selection_1.BuerliScope && data === re_export_1.GraphicType.BREP;
25
25
  exports.solidFilter = solidFilter;
@@ -22,4 +22,5 @@ __exportStar(require("./utils/Measure"), exports);
22
22
  __exportStar(require("./utils/Timing"), exports);
23
23
  __exportStar(require("./store/subscribtion/subscribeToDrawing"), exports);
24
24
  __exportStar(require("./graphic/filters"), exports);
25
+ __exportStar(require("./re-export"), exports);
25
26
  //#endregion Re-export type definitions
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PointTypes = exports.MeshTypes = exports.MemberType = exports.GraphicType = exports.EntityTypes = exports.EdgeTypes = exports.CurveTypes = exports.ContainerType = exports.classMap = exports.CCClasses = exports.WorkPointType = exports.WorkPlaneType = exports.WorkCoordSystemType = exports.WorkAxisType = exports.ViewType = exports.SVGModusType = exports.ReorientedType = exports.OrientationType = exports.NOID = exports.FlipType = exports.ExtrusionType = exports.DataType = exports.ChamferType = exports.BooleanOperationType = void 0;
4
+ const api_js_1 = require("@classcad/api-js");
5
+ Object.defineProperty(exports, "classMap", { enumerable: true, get: function () { return api_js_1.ScgClassInheritance; } });
6
+ Object.defineProperty(exports, "CCClasses", { enumerable: true, get: function () { return api_js_1.ScgClassType; } });
7
+ Object.defineProperty(exports, "ContainerType", { enumerable: true, get: function () { return api_js_1.ScgContainerType; } });
8
+ Object.defineProperty(exports, "CurveTypes", { enumerable: true, get: function () { return api_js_1.ScgCurveTypes; } });
9
+ Object.defineProperty(exports, "EdgeTypes", { enumerable: true, get: function () { return api_js_1.ScgEdgeTypes; } });
10
+ Object.defineProperty(exports, "EntityTypes", { enumerable: true, get: function () { return api_js_1.ScgEntityTypes; } });
11
+ Object.defineProperty(exports, "GraphicType", { enumerable: true, get: function () { return api_js_1.ScgGraphicType; } });
12
+ Object.defineProperty(exports, "MemberType", { enumerable: true, get: function () { return api_js_1.ScgMemberType; } });
13
+ Object.defineProperty(exports, "MeshTypes", { enumerable: true, get: function () { return api_js_1.ScgMeshTypes; } });
14
+ Object.defineProperty(exports, "PointTypes", { enumerable: true, get: function () { return api_js_1.ScgPointTypes; } });
15
+ var api_js_2 = require("@classcad/api-js");
16
+ Object.defineProperty(exports, "BooleanOperationType", { enumerable: true, get: function () { return api_js_2.BooleanOperationType; } });
17
+ Object.defineProperty(exports, "ChamferType", { enumerable: true, get: function () { return api_js_2.ChamferType; } });
18
+ Object.defineProperty(exports, "DataType", { enumerable: true, get: function () { return api_js_2.DataType; } });
19
+ Object.defineProperty(exports, "ExtrusionType", { enumerable: true, get: function () { return api_js_2.ExtrusionType; } });
20
+ Object.defineProperty(exports, "FlipType", { enumerable: true, get: function () { return api_js_2.FlipType; } });
21
+ Object.defineProperty(exports, "NOID", { enumerable: true, get: function () { return api_js_2.NOID; } });
22
+ Object.defineProperty(exports, "OrientationType", { enumerable: true, get: function () { return api_js_2.OrientationType; } });
23
+ Object.defineProperty(exports, "ReorientedType", { enumerable: true, get: function () { return api_js_2.ReorientedType; } });
24
+ Object.defineProperty(exports, "SVGModusType", { enumerable: true, get: function () { return api_js_2.SVGModusType; } });
25
+ Object.defineProperty(exports, "ViewType", { enumerable: true, get: function () { return api_js_2.ViewType; } });
26
+ Object.defineProperty(exports, "WorkAxisType", { enumerable: true, get: function () { return api_js_2.WorkAxisType; } });
27
+ Object.defineProperty(exports, "WorkCoordSystemType", { enumerable: true, get: function () { return api_js_2.WorkCoordSystemType; } });
28
+ Object.defineProperty(exports, "WorkPlaneType", { enumerable: true, get: function () { return api_js_2.WorkPlaneType; } });
29
+ Object.defineProperty(exports, "WorkPointType", { enumerable: true, get: function () { return api_js_2.WorkPointType; } });
@@ -12,7 +12,7 @@ const selectionData = () => ({
12
12
  });
13
13
  exports.selectionData = selectionData;
14
14
  const selectionApi = (set, get, buerliApi) => ({
15
- unselectAll(selectorId) {
15
+ unselectAll(selectorId, options) {
16
16
  const { selection, id: drawingId } = get();
17
17
  const selId = (selectorId || selection.active);
18
18
  if (selId) {
@@ -23,7 +23,7 @@ const selectionApi = (set, get, buerliApi) => ({
23
23
  }
24
24
  (0, selection_1.unsubscribeItems)(buerliApi, drawingId, selId, unselItems);
25
25
  if (selector.customUnSelect) {
26
- selector.customUnSelect(selId, [], unselItems);
26
+ selector.customUnSelect(selId, [], unselItems, options);
27
27
  }
28
28
  else {
29
29
  set(state => {
@@ -35,7 +35,7 @@ const selectionApi = (set, get, buerliApi) => ({
35
35
  }
36
36
  }
37
37
  },
38
- unselect(items, selectorId) {
38
+ unselect(items, selectorId, options) {
39
39
  const { selection, id: drawingId } = get();
40
40
  const selId = (selectorId || selection.active);
41
41
  if (selId) {
@@ -49,7 +49,7 @@ const selectionApi = (set, get, buerliApi) => ({
49
49
  const diff = selector.items.filter(item1 => {
50
50
  return newItems.find(item2 => item2.id === item1.id) === undefined;
51
51
  });
52
- selector.customUnSelect(selId, newItems, diff);
52
+ selector.customUnSelect(selId, newItems, diff, options);
53
53
  }
54
54
  else {
55
55
  set(state => {
@@ -61,7 +61,7 @@ const selectionApi = (set, get, buerliApi) => ({
61
61
  this.setHovered(null, selId);
62
62
  }
63
63
  },
64
- select(items, selectorId) {
64
+ select(items, selectorId, options) {
65
65
  const { selection, api, id: drawingId } = get();
66
66
  const selId = (selectorId || selection.active);
67
67
  if (selId) {
@@ -99,7 +99,7 @@ const selectionApi = (set, get, buerliApi) => ({
99
99
  const diff = result.filter(item1 => {
100
100
  return selector.items.find(item2 => item2.id === item1.id) === undefined;
101
101
  });
102
- selector.customSelect(selId, result, diff);
102
+ selector.customSelect(selId, result, diff, options);
103
103
  }
104
104
  else {
105
105
  // subscribe items which will be selected
@@ -14,7 +14,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./IGraphicPackage"), exports);
17
+ exports.DEFAULT_STRUCTURE_TREE = void 0;
18
+ const re_export_1 = require("../re-export");
18
19
  __exportStar(require("./InteractionInfo"), exports);
19
- __exportStar(require("./IStructurePatch"), exports);
20
- __exportStar(require("./IStructureTree"), exports);
20
+ /**
21
+ * Defines the default structure tree.
22
+ * Should be used to initialize a new structure tree.
23
+ */
24
+ const DEFAULT_STRUCTURE_TREE = () => {
25
+ return {
26
+ tree: {},
27
+ root: re_export_1.NOID,
28
+ currentProduct: re_export_1.NOID,
29
+ currentNode: re_export_1.NOID,
30
+ currentInstance: re_export_1.NOID,
31
+ testRoot: re_export_1.NOID,
32
+ };
33
+ };
34
+ exports.DEFAULT_STRUCTURE_TREE = DEFAULT_STRUCTURE_TREE;
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.Measure = exports.MeasureResultType = void 0;
27
27
  /* eslint-disable max-lines */
28
28
  const THREE = __importStar(require("three"));
29
+ const re_export_1 = require("../re-export");
29
30
  const store_1 = require("./../store");
30
- const types_1 = require("./../types");
31
31
  var MeasureResultType;
32
32
  (function (MeasureResultType) {
33
33
  MeasureResultType["NONE"] = "none";
@@ -47,37 +47,37 @@ exports.Measure = {
47
47
  const matrix3 = new THREE.Matrix3().setFromMatrix4(matrix);
48
48
  const newItem = Object.assign({}, item);
49
49
  switch (newItem.type) {
50
- case types_1.GraphicType.POINT:
51
- case types_1.GraphicType.CURVEPOINT:
50
+ case re_export_1.GraphicType.POINT:
51
+ case re_export_1.GraphicType.CURVEPOINT:
52
52
  const point = newItem;
53
53
  point.position = point.position.clone().applyMatrix4(matrix);
54
54
  break;
55
- case types_1.GraphicType.LINE:
56
- case types_1.GraphicType.CURVELINE:
55
+ case re_export_1.GraphicType.LINE:
56
+ case re_export_1.GraphicType.CURVELINE:
57
57
  const line = newItem;
58
58
  line.start = line.start.clone().applyMatrix4(matrix);
59
59
  line.end = line.end.clone().applyMatrix4(matrix);
60
60
  break;
61
- case types_1.GraphicType.PLANE:
61
+ case re_export_1.GraphicType.PLANE:
62
62
  const plane = newItem;
63
63
  plane.normal = plane.normal.clone().applyMatrix3(matrix3);
64
64
  plane.normal.normalize();
65
65
  plane.pointOnPlane = plane.pointOnPlane.clone().applyMatrix4(matrix);
66
66
  break;
67
- case types_1.GraphicType.CYLINDER:
67
+ case re_export_1.GraphicType.CYLINDER:
68
68
  const cylinder = newItem;
69
69
  cylinder.axis = cylinder.axis.clone().applyMatrix3(matrix3);
70
70
  cylinder.axis.normalize();
71
71
  cylinder.origin = cylinder.origin.clone().applyMatrix4(matrix);
72
72
  break;
73
- case types_1.GraphicType.CONE:
73
+ case re_export_1.GraphicType.CONE:
74
74
  const cone = newItem;
75
75
  cone.axis = cone.axis.clone().applyMatrix3(matrix3);
76
76
  cone.axis.normalize();
77
77
  cone.origin = cone.origin.clone().applyMatrix4(matrix);
78
78
  break;
79
- case types_1.GraphicType.ARC:
80
- case types_1.GraphicType.CURVEARC:
79
+ case re_export_1.GraphicType.ARC:
80
+ case re_export_1.GraphicType.CURVEARC:
81
81
  const arc = newItem;
82
82
  arc.normal = arc.normal.clone().applyMatrix3(matrix3);
83
83
  arc.normal.normalize();
@@ -85,8 +85,8 @@ exports.Measure = {
85
85
  arc.start = arc.start.clone().applyMatrix4(matrix);
86
86
  arc.end = arc.end.clone().applyMatrix4(matrix);
87
87
  break;
88
- case types_1.GraphicType.CIRCLE:
89
- case types_1.GraphicType.CURVECIRCLE:
88
+ case re_export_1.GraphicType.CIRCLE:
89
+ case re_export_1.GraphicType.CURVECIRCLE:
90
90
  const circle = newItem;
91
91
  circle.normal = circle.normal.clone().applyMatrix3(matrix3);
92
92
  circle.normal.normalize();
@@ -113,8 +113,8 @@ exports.Measure = {
113
113
  };
114
114
  for (const element of transformed) {
115
115
  switch (element.type) {
116
- case types_1.GraphicType.POINT:
117
- case types_1.GraphicType.CURVEPOINT:
116
+ case re_export_1.GraphicType.POINT:
117
+ case re_export_1.GraphicType.CURVEPOINT:
118
118
  const point = element;
119
119
  results.push({
120
120
  description: 'Position',
@@ -122,8 +122,8 @@ exports.Measure = {
122
122
  measureData: { value: point.position.clone() },
123
123
  });
124
124
  break;
125
- case types_1.GraphicType.LINE:
126
- case types_1.GraphicType.CURVELINE:
125
+ case re_export_1.GraphicType.LINE:
126
+ case re_export_1.GraphicType.CURVELINE:
127
127
  const line = element;
128
128
  const absoluteDistance = line.start.distanceTo(line.end);
129
129
  results.push({
@@ -132,8 +132,8 @@ exports.Measure = {
132
132
  measureData: { value: absoluteDistance, start: line.start.clone(), end: line.end.clone() },
133
133
  });
134
134
  break;
135
- case types_1.GraphicType.NURBSCURVE:
136
- case types_1.GraphicType.CURVESPLINE:
135
+ case re_export_1.GraphicType.NURBSCURVE:
136
+ case re_export_1.GraphicType.CURVESPLINE:
137
137
  const edge = element;
138
138
  results.push({
139
139
  description: 'Edge start',
@@ -146,8 +146,8 @@ exports.Measure = {
146
146
  measureData: { value: edge.end.clone() },
147
147
  });
148
148
  break;
149
- case types_1.GraphicType.ARC:
150
- case types_1.GraphicType.CURVEARC:
149
+ case re_export_1.GraphicType.ARC:
150
+ case re_export_1.GraphicType.CURVEARC:
151
151
  const arc = element;
152
152
  const arcNEnd = arc.center.clone().addScaledVector(arc.normal.clone().normalize(), 40);
153
153
  const pointOnArc = getPointOnCircumference(arc.center, arc.normal, arc.radius);
@@ -177,8 +177,8 @@ exports.Measure = {
177
177
  measureData: { value: arc.radius, start: arc.center.clone(), end: pointOnArc },
178
178
  });
179
179
  break;
180
- case types_1.GraphicType.CIRCLE:
181
- case types_1.GraphicType.CURVECIRCLE:
180
+ case re_export_1.GraphicType.CIRCLE:
181
+ case re_export_1.GraphicType.CURVECIRCLE:
182
182
  const circle = element;
183
183
  const circleNEnd = circle.center.clone().addScaledVector(circle.normal.clone().normalize(), 40);
184
184
  const pointOnCircle = getPointOnCircumference(circle.center, circle.normal, circle.radius);
@@ -203,7 +203,7 @@ exports.Measure = {
203
203
  measureData: { value: circle.start.clone() },
204
204
  });
205
205
  break;
206
- case types_1.GraphicType.PLANE:
206
+ case re_export_1.GraphicType.PLANE:
207
207
  const plane = element;
208
208
  const planeNEnd = plane.pointOnPlane.clone().addScaledVector(plane.normal.clone().normalize(), 40);
209
209
  results.push({
@@ -212,7 +212,7 @@ exports.Measure = {
212
212
  measureData: { value: plane.normal, start: plane.pointOnPlane.clone(), end: planeNEnd },
213
213
  });
214
214
  break;
215
- case types_1.GraphicType.CYLINDER:
215
+ case re_export_1.GraphicType.CYLINDER:
216
216
  const cylinder = element;
217
217
  const cylAxisNormalized = cylinder.axis.clone().normalize();
218
218
  const cylNEnd = cylinder.origin.clone().addScaledVector(cylAxisNormalized, cylinder.height + 40);
@@ -242,7 +242,7 @@ exports.Measure = {
242
242
  measureData: { value: cylinder.height, start: cylHStart, end: cylHEnd },
243
243
  });
244
244
  break;
245
- case types_1.GraphicType.CONE:
245
+ case re_export_1.GraphicType.CONE:
246
246
  const cone = element;
247
247
  const isExpanding = cone.radiusBottom < cone.radiusTop;
248
248
  const R = Math.max(cone.radiusBottom, cone.radiusTop);
@@ -286,7 +286,7 @@ exports.Measure = {
286
286
  measureData: { value: cone.height, start: coneHStart, end: coneHEnd },
287
287
  });
288
288
  break;
289
- case types_1.GraphicType.SPHERE:
289
+ case re_export_1.GraphicType.SPHERE:
290
290
  const sphere = element;
291
291
  results.push({
292
292
  description: 'Sphere radius',
@@ -294,7 +294,7 @@ exports.Measure = {
294
294
  measureData: { value: sphere.radius },
295
295
  });
296
296
  break;
297
- case types_1.GraphicType.NURBSSURFACE:
297
+ case re_export_1.GraphicType.NURBSSURFACE:
298
298
  results.push({ description: 'NURBS Surface', type: MeasureResultType.NONE });
299
299
  break;
300
300
  default:
@@ -310,22 +310,22 @@ exports.Measure = {
310
310
  const second = transformed[1];
311
311
  let results = [];
312
312
  switch (first.type) {
313
- case types_1.GraphicType.POINT:
314
- case types_1.GraphicType.CURVEPOINT:
313
+ case re_export_1.GraphicType.POINT:
314
+ case re_export_1.GraphicType.CURVEPOINT:
315
315
  switch (second.type) {
316
- case types_1.GraphicType.POINT:
317
- case types_1.GraphicType.CURVEPOINT:
316
+ case re_export_1.GraphicType.POINT:
317
+ case re_export_1.GraphicType.CURVEPOINT:
318
318
  results = exports.Measure.calculatePointPoint(first.position, second.position);
319
319
  break;
320
- case types_1.GraphicType.LINE:
321
- case types_1.GraphicType.CURVELINE:
320
+ case re_export_1.GraphicType.LINE:
321
+ case re_export_1.GraphicType.CURVELINE:
322
322
  results = exports.Measure.calculatePointLine(first, second);
323
323
  break;
324
- case types_1.GraphicType.PLANE:
324
+ case re_export_1.GraphicType.PLANE:
325
325
  results = exports.Measure.calculatePointPlane(first, second);
326
326
  break;
327
- case types_1.GraphicType.ARC:
328
- case types_1.GraphicType.CIRCLE:
327
+ case re_export_1.GraphicType.ARC:
328
+ case re_export_1.GraphicType.CIRCLE:
329
329
  results = exports.Measure.calculatePointPoint(first.position.clone(), second.center.clone());
330
330
  break;
331
331
  default:
@@ -333,18 +333,18 @@ exports.Measure = {
333
333
  break;
334
334
  }
335
335
  break;
336
- case types_1.GraphicType.LINE:
337
- case types_1.GraphicType.CURVELINE:
336
+ case re_export_1.GraphicType.LINE:
337
+ case re_export_1.GraphicType.CURVELINE:
338
338
  switch (second.type) {
339
- case types_1.GraphicType.POINT:
340
- case types_1.GraphicType.CURVEPOINT:
339
+ case re_export_1.GraphicType.POINT:
340
+ case re_export_1.GraphicType.CURVEPOINT:
341
341
  results = exports.Measure.calculatePointLine(second, first);
342
342
  break;
343
- case types_1.GraphicType.LINE:
344
- case types_1.GraphicType.CURVELINE:
343
+ case re_export_1.GraphicType.LINE:
344
+ case re_export_1.GraphicType.CURVELINE:
345
345
  results = exports.Measure.calculateLineLine(first, second);
346
346
  break;
347
- case types_1.GraphicType.PLANE:
347
+ case re_export_1.GraphicType.PLANE:
348
348
  results = exports.Measure.calculateLinePlane(first, second);
349
349
  break;
350
350
  default:
@@ -352,14 +352,14 @@ exports.Measure = {
352
352
  break;
353
353
  }
354
354
  break;
355
- case types_1.GraphicType.CIRCLE:
356
- case types_1.GraphicType.ARC:
355
+ case re_export_1.GraphicType.CIRCLE:
356
+ case re_export_1.GraphicType.ARC:
357
357
  switch (second.type) {
358
- case types_1.GraphicType.ARC:
359
- case types_1.GraphicType.CIRCLE:
358
+ case re_export_1.GraphicType.ARC:
359
+ case re_export_1.GraphicType.CIRCLE:
360
360
  results = exports.Measure.calculatePointPoint(first.center, second.center);
361
361
  break;
362
- case types_1.GraphicType.POINT:
362
+ case re_export_1.GraphicType.POINT:
363
363
  results = exports.Measure.calculatePointPoint(first.center, second.position);
364
364
  break;
365
365
  default:
@@ -367,21 +367,21 @@ exports.Measure = {
367
367
  break;
368
368
  }
369
369
  break;
370
- case types_1.GraphicType.PLANE:
370
+ case re_export_1.GraphicType.PLANE:
371
371
  switch (second.type) {
372
- case types_1.GraphicType.POINT:
373
- case types_1.GraphicType.CURVEPOINT:
372
+ case re_export_1.GraphicType.POINT:
373
+ case re_export_1.GraphicType.CURVEPOINT:
374
374
  results = exports.Measure.calculatePointPlane(second, first);
375
375
  break;
376
- case types_1.GraphicType.LINE:
377
- case types_1.GraphicType.CURVELINE:
376
+ case re_export_1.GraphicType.LINE:
377
+ case re_export_1.GraphicType.CURVELINE:
378
378
  results = exports.Measure.calculateLinePlane(second, first);
379
379
  break;
380
- case types_1.GraphicType.ARC:
381
- case types_1.GraphicType.CURVEARC:
380
+ case re_export_1.GraphicType.ARC:
381
+ case re_export_1.GraphicType.CURVEARC:
382
382
  results = exports.Measure.calculateArcPlane(second, first);
383
383
  break;
384
- case types_1.GraphicType.PLANE:
384
+ case re_export_1.GraphicType.PLANE:
385
385
  results = exports.Measure.calculatePlanePlane(first, second);
386
386
  break;
387
387
  default:
@@ -1,5 +1,5 @@
1
1
  import * as THREE from 'three';
2
- import { ContainerType, GraphicType, } from './../types';
2
+ import { ContainerType, GraphicType, } from '../re-export';
3
3
  const convertType = (contType) => {
4
4
  let type = GraphicType.NONE;
5
5
  switch (contType) {
@@ -1,5 +1,5 @@
1
+ import { EdgeTypes, GraphicType as GT, MeshTypes } from '../re-export';
1
2
  import { BuerliScope } from '../store/states/selection';
2
- import { EdgeTypes, GraphicType as GT, MeshTypes } from '../types/IGraphicPackage';
3
3
  export const lineFilter = (scope, data) => scope === BuerliScope && data === GT.LINE;
4
4
  export const edgeFilter = (scope, data) => scope === BuerliScope && EdgeTypes.includes(data);
5
5
  export const arcFilter = (scope, data) => scope === BuerliScope && data === GT.ARC;
@@ -6,4 +6,5 @@ export * from './utils/Measure';
6
6
  export * from './utils/Timing';
7
7
  export * from './store/subscribtion/subscribeToDrawing';
8
8
  export * from './graphic/filters';
9
+ export * from './re-export';
9
10
  //#endregion Re-export type definitions
@@ -0,0 +1,23 @@
1
+ import { ScgClassInheritance, ScgClassType, ScgContainerType, ScgCurveTypes, ScgEdgeTypes, ScgEntityTypes, ScgGraphicType, ScgMemberType, ScgMeshTypes, ScgPointTypes, } from '@classcad/api-js';
2
+ export { BooleanOperationType, ChamferType, DataType, ExtrusionType, FlipType, NOID, OrientationType, ReorientedType, SVGModusType, ViewType, WorkAxisType, WorkCoordSystemType, WorkPlaneType, WorkPointType, } from '@classcad/api-js';
3
+ export {
4
+ /** @deprecated */
5
+ ScgClassType as CCClasses,
6
+ /** @deprecated */
7
+ ScgClassInheritance as classMap,
8
+ /** @deprecated */
9
+ ScgContainerType as ContainerType,
10
+ /** @deprecated */
11
+ ScgCurveTypes as CurveTypes,
12
+ /** @deprecated */
13
+ ScgEdgeTypes as EdgeTypes,
14
+ /** @deprecated */
15
+ ScgEntityTypes as EntityTypes,
16
+ /** @deprecated */
17
+ ScgGraphicType as GraphicType,
18
+ /** @deprecated */
19
+ ScgMemberType as MemberType,
20
+ /** @deprecated */
21
+ ScgMeshTypes as MeshTypes,
22
+ /** @deprecated */
23
+ ScgPointTypes as PointTypes, };