bimatter-viewer-react 0.9.0 → 0.10.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.
@@ -42,6 +42,7 @@ export type ViewerStore = {
42
42
  api: ViewerApi | null;
43
43
  defaultHotkeysEnabled: boolean;
44
44
  detectedGpuInfo: unknown | null;
45
+ dimensionsActive: boolean;
45
46
  lighting: ViewerLightingSettings;
46
47
  modelNames: ViewerModelNamesStore;
47
48
  modelProps: ViewerModelPropsStore;
@@ -62,6 +63,7 @@ export type ViewerStore = {
62
63
  setApi: (api: ViewerApi | null) => void;
63
64
  setDefaultHotkeysEnabled: (enabled: boolean) => void;
64
65
  setDetectedGpuInfo: (gpuInfo: unknown | null) => void;
66
+ setDimensionsActive: (active: boolean) => void;
65
67
  setGridAxesVisibility: (gridAxesVisibility: Partial<ViewerGridAxesVisibility>) => void;
66
68
  setGridAxisVisibility: (side: ViewerGridAxisSide, visible: boolean) => void;
67
69
  setAmbientLightColor: (color: ColorRepresentation) => void;
@@ -26,6 +26,7 @@ export declare class ClippingEdges {
26
26
  private readonly intersectionSegments;
27
27
  private cameraMotionHidden;
28
28
  constructor(context: ClippingUtils, plane: Plane);
29
+ syncClippingPlanes(): void;
29
30
  create(): LineSegments<BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>[];
30
31
  syncMeshes(): void;
31
32
  dispose(): void;
@@ -7,10 +7,18 @@ type DimensionsContext = {
7
7
  camera: Camera;
8
8
  cameraUtils: CameraUtilsApi;
9
9
  controlRef: ViewerControlsRef;
10
+ disableSelectionInteraction?: boolean;
10
11
  domElement: HTMLCanvasElement;
11
12
  getExtraSnapObjects?: () => Object3D[];
12
13
  getExtraSnapPoints?: (point: Vector3, distance: number) => Vector3[];
14
+ getPrioritySnapObjects?: () => Object3D[];
13
15
  modelRef: ViewerModelRef;
16
+ onChange?: () => void;
17
+ preferExtraSnapPoints?: boolean;
18
+ previewMarkerCameraOffset?: number;
19
+ previewMarkerOffset?: Vector3;
20
+ previewMarkerScaleFactor?: number;
21
+ projectPoint?: (point: Vector3, target: Vector3) => Vector3;
14
22
  scene: Scene;
15
23
  viewerStore: ViewerStoreApi;
16
24
  viewportHeight: number;
@@ -35,6 +43,8 @@ export type ViewerDimensionsApi = {
35
43
  export declare class DimensionsUtils {
36
44
  private active;
37
45
  private axis;
46
+ private shiftAxis;
47
+ private tabAxisOverride;
38
48
  private readonly boundingMaterial;
39
49
  private context;
40
50
  private currentDimension;
@@ -44,8 +54,17 @@ export declare class DimensionsUtils {
44
54
  private endpointScale;
45
55
  private readonly lineMaterial;
46
56
  private measureInProcess;
57
+ private readonly lastPreviewPoint;
47
58
  private moveState;
59
+ private pointerDownState;
60
+ private readonly pointerNdc;
61
+ private readonly projectedPoint;
62
+ private readonly previewMarkerCameraDirection;
48
63
  private readonly previewMarker;
64
+ private readonly ray;
65
+ private readonly rayDirection;
66
+ private readonly rayPlane;
67
+ private readonly rayPoint;
49
68
  private readonly root;
50
69
  private snapDistance;
51
70
  private startPoint;
@@ -77,26 +96,46 @@ export declare class DimensionsUtils {
77
96
  private drawEnd;
78
97
  private createDimension;
79
98
  private getSnapObjects;
99
+ private getPrioritySnapObjects;
80
100
  private getModelHit;
81
101
  private getBoundingBoxes;
82
102
  private getExtraSnapPoints;
83
103
  private getClosestPoint;
104
+ private getMeasurementPoint;
105
+ private getFallbackMeasurementPoint;
84
106
  private getClosestVertex;
85
107
  private getPreviewEndPoint;
86
108
  private getNextAxis;
87
109
  private getIsMoving;
88
110
  private rescalePreviewMarker;
89
111
  private setSelectionInteractionDisabled;
90
- private onClick;
112
+ private invalidate;
113
+ private setPreviewMarkerPosition;
114
+ private projectPoint;
115
+ private placeDimensionPoint;
91
116
  private onPointerMove;
92
117
  private onPointerDown;
93
118
  private onPointerUp;
119
+ private onPointerCancel;
120
+ private onPointerLeave;
121
+ private isDimensionClick;
94
122
  private onControlsChange;
95
123
  private onKeyDown;
124
+ private getAxisFromKey;
125
+ private toggleAxisLock;
96
126
  static createEndpointGeometry(height?: number, radius?: number): ConeGeometry;
97
127
  static createPreviewGeometry(): SphereGeometry;
98
128
  }
99
- export declare function useDimensionsUtils(modelRef: ViewerModelRef, controlRef: ViewerControlsRef, cameraUtils: CameraUtilsApi, getExtraSnapObjects?: () => Object3D[], getExtraSnapPoints?: (point: Vector3, distance: number) => Vector3[]): ViewerDimensionsApi & {
129
+ export declare function useDimensionsUtils(modelRef: ViewerModelRef, controlRef: ViewerControlsRef, cameraUtils: CameraUtilsApi, getExtraSnapObjects?: () => Object3D[], getExtraSnapPoints?: (point: Vector3, distance: number) => Vector3[], options?: {
130
+ disableSelectionInteraction?: boolean;
131
+ getPrioritySnapObjects?: () => Object3D[];
132
+ onChange?: () => void;
133
+ preferExtraSnapPoints?: boolean;
134
+ previewMarkerCameraOffset?: number;
135
+ previewMarkerOffset?: Vector3;
136
+ previewMarkerScaleFactor?: number;
137
+ projectPoint?: (point: Vector3, target: Vector3) => Vector3;
138
+ }): ViewerDimensionsApi & {
100
139
  syncWithModel: () => void;
101
140
  };
102
141
  export {};
@@ -18,6 +18,7 @@ export type IfcWorkerLoadOptions = {
18
18
  chunk?: number;
19
19
  coordinationMatrix?: IfcCoordinationMatrixSource;
20
20
  maxMeshBytes?: number;
21
+ mergeVertices?: boolean;
21
22
  streamGeometryChunks?: boolean;
22
23
  useIfcColors?: boolean;
23
24
  useIfcElementAssembly?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bimatter-viewer-react",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "license": "PolyForm-Noncommercial-1.0.0",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",