@buerli.io/headless 0.7.1 → 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.
@@ -1,4 +1,8 @@
1
1
  import history from './history';
2
2
  import solid, { createPolyline } from './solid';
3
3
  export { solid, history, createPolyline };
4
+ // Re-export types form @buerli.io/classcad for easier usage
5
+ export { BooleanOperationType, ChamferType, DataType, FlipType, ReorientedType, WorkAxisType, WorkCoordSystemType, WorkPlaneType, WorkPointType, ViewType, OrientationType, ExtrusionType, SVGModusType, } from '@buerli.io/classcad';
6
+ // Re-export types form @buerli.io/core for easier usage
7
+ export { GraphicType } from '@buerli.io/core';
4
8
  //#endregion Re-export type definitions
@@ -9,13 +9,9 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
9
9
  import { ccAPI } from '@buerli.io/classcad';
10
10
  import { api, getDrawing } from '@buerli.io/core';
11
11
  import { Group, Mesh, MeshStandardMaterial, Scene, Shape } from 'three';
12
- import * as BufferGeometryUtils_ from 'three/examples/jsm/utils/BufferGeometryUtils';
12
+ import { mergeBufferGeometries } from 'three-stdlib';
13
13
  import { getDifferentColoredMeshesFromEntity } from './utils/meshes';
14
14
  const solidAPI = ccAPI.solid;
15
- let BufferGeometryUtils = BufferGeometryUtils_;
16
- if (BufferGeometryUtils.BufferGeometryUtils) {
17
- BufferGeometryUtils = BufferGeometryUtils.BufferGeometryUtils;
18
- }
19
15
  const toCCVec = (args) => ({ x: args[0], y: args[1], z: args[2] });
20
16
  const toCCNbrVec = (args) => ({ x: args[0], y: args[1], z: args[2] });
21
17
  const toArray = (v) => (Array.isArray(v) ? v : v.toArray());
@@ -236,7 +232,7 @@ export default class CAD {
236
232
  await ccAPI.baseModeler.requestVisualisationOfObject(drawingId, rSolid);
237
233
  const entity = await getEntity(drawingId, rSolid);
238
234
  if (entity != null) {
239
- return BufferGeometryUtils.mergeBufferGeometries(entity.meshes.map(m => m.geometry));
235
+ return mergeBufferGeometries(entity.meshes.map(m => m.geometry));
240
236
  }
241
237
  },
242
238
  createScene: async (solids, options) => {
@@ -283,7 +279,7 @@ export default class CAD {
283
279
  const colorMeshesMap = getDifferentColoredMeshesFromEntity(entity);
284
280
  Object.keys(colorMeshesMap).forEach(key => {
285
281
  const mesh = new Mesh();
286
- mesh.geometry = BufferGeometryUtils.mergeBufferGeometries(colorMeshesMap[key].meshes.map(m => m.geometry));
282
+ mesh.geometry = mergeBufferGeometries(colorMeshesMap[key].meshes.map(m => m.geometry));
287
283
  mesh.material = new MeshStandardMaterial({
288
284
  color: colorMeshesMap[key].color,
289
285
  transparent: colorMeshesMap[key].opacity < 1,