bimatter-viewer-react 0.6.5 → 0.6.7

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.
@@ -29,6 +29,7 @@ export declare class ClippingCaps {
29
29
  private preselection;
30
30
  private tolerance;
31
31
  constructor(context: ClippingUtils, plane: Plane);
32
+ private createCapMaterial;
32
33
  dispose(): void;
33
34
  setVisible(visible: boolean): void;
34
35
  syncMeshes(): void;
@@ -36,12 +37,14 @@ export declare class ClippingCaps {
36
37
  setPreselection(preselection: CapPreselection): void;
37
38
  updateVisualState(): void;
38
39
  update(): void;
40
+ private setupWebGpuCapMaterial;
39
41
  private setupCapMaterialShader;
40
42
  private updateColorUniform;
41
43
  private updateColorUniforms;
42
44
  private updatePreselectionUniforms;
43
45
  private updateCapMaterial;
44
46
  private createCapGeometry;
47
+ private getCapSegmentsFromEdgeSegments;
45
48
  private getCapSegments;
46
49
  private getTriangleElementID;
47
50
  private getTriangleIntersections;
@@ -1,5 +1,15 @@
1
1
  import { BufferGeometry, LineBasicMaterial, LineSegments, Plane } from "three";
2
2
  import type { ClippingUtils } from "./ClippingUtils";
3
+ export type ClippingIntersectionSegment = {
4
+ ax: number;
5
+ ay: number;
6
+ az: number;
7
+ bx: number;
8
+ by: number;
9
+ bz: number;
10
+ elementID: number;
11
+ modelID: number;
12
+ };
3
13
  export declare class ClippingEdges {
4
14
  active: boolean;
5
15
  readonly material: LineBasicMaterial;
@@ -13,11 +23,14 @@ export declare class ClippingEdges {
13
23
  private readonly tempVector1;
14
24
  private readonly tempVector2;
15
25
  private readonly tempVector3;
26
+ private readonly intersectionSegments;
16
27
  constructor(context: ClippingUtils, plane: Plane);
17
28
  create(): LineSegments<BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>[];
18
29
  syncMeshes(): void;
19
30
  dispose(): void;
20
31
  setVisible(visible: boolean): void;
21
32
  toggle(): void;
33
+ getIntersectionSegments(): ClippingIntersectionSegment[];
22
34
  update(): void;
35
+ private getTriangleElementID;
23
36
  }
@@ -4,6 +4,7 @@ import type { ViewerStoreApi } from "../../store/ViewerStore";
4
4
  import type { ViewerControlsRef, ViewerModelRef } from "../../types";
5
5
  import { ClippingCaps } from "./ClippingCaps";
6
6
  import { ClippingEdges } from "./ClippingEdges";
7
+ import type { ClippingIntersectionSegment } from "./ClippingEdges";
7
8
  import { PlaneHelper } from "./PlaneHelper";
8
9
  type ClippingContext = {
9
10
  camera: Camera;
@@ -14,6 +15,7 @@ type ClippingContext = {
14
15
  raycaster: Raycaster;
15
16
  renderer: WebGLRenderer;
16
17
  scene: Scene;
18
+ useWebGPU: boolean;
17
19
  viewerStore: ViewerStoreApi;
18
20
  };
19
21
  type ClippingPreselection = {
@@ -65,9 +67,12 @@ export declare class ClippingUtils {
65
67
  getCameraUtils(): CameraUtilsApi;
66
68
  getDomElement(): HTMLCanvasElement;
67
69
  getRaycaster(): Raycaster;
70
+ getUseWebGPU(): boolean;
68
71
  getMaxTextureAnisotropy(): number;
69
72
  getControlRef(): ViewerControlsRef;
70
73
  getMeshes(): Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, Material<import("three").MaterialEventMap> | Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>[];
74
+ getObjectModelID(object: Object3D): number;
75
+ getEdgeSegmentsForPlane(plane: Plane): readonly ClippingIntersectionSegment[] | null;
71
76
  getSelectableObjects(): Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, Material<import("three").MaterialEventMap> | Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>[];
72
77
  getSelected(): import("../..").SelectedStore;
73
78
  getPreselectionColor(): import("three").ColorRepresentation;
@@ -100,14 +105,14 @@ export declare class ClippingUtils {
100
105
  setEdgesActive(active: boolean): void;
101
106
  updateEdges(): void;
102
107
  flushEdgesUpdate(): void;
103
- updateCaps(): void;
108
+ updateCaps(except?: ClippingCaps): void;
104
109
  updateHelpers(): void;
105
110
  requestEdgesUpdate(): void;
106
111
  requestHelpersUpdate(): void;
107
112
  syncWithModel(): void;
108
113
  dispose(): void;
109
114
  }
110
- export declare function useClippingUtils(modelRef: ViewerModelRef, controlRef: ViewerControlsRef, cameraUtils: CameraUtilsApi): ViewerClippingApi & {
115
+ export declare function useClippingUtils(modelRef: ViewerModelRef, controlRef: ViewerControlsRef, cameraUtils: CameraUtilsApi, useWebGPU?: boolean): ViewerClippingApi & {
111
116
  getSelectableObjects: () => Object3D[];
112
117
  setCapsPreselection: (preselection: ClippingPreselection) => void;
113
118
  syncWithModel: () => void;
@@ -1,4 +1,4 @@
1
- import { Mesh, Object3D } from "three";
1
+ import { Box3, Mesh, Object3D } from "three";
2
2
  import type { MeshBVH } from "three-mesh-bvh";
3
3
  import type { ViewerModelRef } from "../../types";
4
4
  export type IndexArray = Uint16Array | Uint32Array;
@@ -24,6 +24,7 @@ export type ElementIndexEntry = {
24
24
  vertexRanges: IndexRange[];
25
25
  };
26
26
  export type GeometryIndex = {
27
+ elementBounds: Map<number, Map<number, Box3>>;
27
28
  elementIndex: Map<number, ElementIndexEntry[]>;
28
29
  ifcSpacesVisible: boolean;
29
30
  indexedModel: Object3D | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bimatter-viewer-react",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "license": "PolyForm-Noncommercial-1.0.0",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",