bimatter-viewer-react 0.5.9 → 0.5.11

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.
package/lib/types.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { RefObject } from "react";
2
2
  import type { Camera, DirectionalLight, Group } from "three";
3
- import type { OrbitControls as OrbitControlsImpl } from "three-stdlib";
3
+ import type { CameraControls as CameraControlsImpl } from "@react-three/drei";
4
4
  export type ViewerModelGroup = Group & {
5
5
  modelID?: number;
6
6
  };
7
7
  export type ViewerModelRef = RefObject<ViewerModelGroup | null>;
8
8
  export type ViewerCameraRef = RefObject<Camera | null>;
9
- export type ViewerControlsRef = RefObject<OrbitControlsImpl | null>;
9
+ export type ViewerControlsRef = RefObject<CameraControlsImpl | null>;
10
10
  export type ViewerLightRef = RefObject<DirectionalLight | null>;
@@ -16,7 +16,7 @@ type ClippingContext = {
16
16
  viewerStore: ViewerStoreApi;
17
17
  };
18
18
  export type ViewerClippingApi = {
19
- createClippingRectangle: () => Plane[];
19
+ createClippingRectangle: (selected?: boolean) => Plane[];
20
20
  createPlane: (event?: MouseEvent | PointerEvent) => Plane | null;
21
21
  deleteAllPlanes: () => void;
22
22
  getEdgesActive: () => boolean;
@@ -63,13 +63,14 @@ export declare class ClippingUtils {
63
63
  setHelperHoverMoveEnd: () => void;
64
64
  setHelperHoverMoving: () => void;
65
65
  private getModelWorldBox;
66
+ private getSelectedWorldBox;
66
67
  setControlsEnabled(enabled: boolean): void;
67
68
  setSelectionInteractionDisabled(disabled: boolean): void;
68
69
  updateMaterials(): void;
69
70
  setActive(active: boolean): void;
70
71
  toggle(): void;
71
72
  createPlane(event?: MouseEvent | PointerEvent): Plane | null;
72
- createClippingRectangle(): Plane[];
73
+ createClippingRectangle(selected?: boolean): Plane[];
73
74
  addPlane(plane: Plane, location: Vector3, normal: Vector3): void;
74
75
  deleteAllPlanes(): void;
75
76
  setHelpersActive(active: boolean): void;
@@ -0,0 +1,50 @@
1
+ import type { BmtModelData } from "../Loaders/BmtLoader";
2
+ import { type BmtConvertedFileType, type BmtConverterOptions } from "../Loaders/BmtConverter";
3
+ import { type WorkerProgressEvent } from "./ProgressUtils";
4
+ export type BmtConverterWorkerSource = {
5
+ buffer: ArrayBuffer;
6
+ kind: "buffer";
7
+ name?: string;
8
+ } | {
9
+ file: File;
10
+ kind: "file";
11
+ name?: string;
12
+ } | {
13
+ kind: "url";
14
+ name?: string;
15
+ url: string;
16
+ };
17
+ export type BmtConverterWorkerOptions = Pick<BmtConverterOptions, "chunk" | "coordinationMatrix" | "fileName" | "fileNames" | "maxMeshBytes" | "useIfcColors" | "useIfcElementAssembly" | "useIfcSpace" | "useMinVersion" | "visibleIdsByModel" | "wasmPath">;
18
+ export type BmtConverterWorkerRequest = {
19
+ options?: BmtConverterWorkerOptions;
20
+ sources: BmtConverterWorkerSource[];
21
+ taskId: string;
22
+ type: "convert-ifc-to-bmt";
23
+ };
24
+ export type BmtConverterWorkerError = {
25
+ message: string;
26
+ stack?: string;
27
+ };
28
+ export type BmtConverterWorkerFile = {
29
+ bytes: Uint8Array;
30
+ mimeType: string;
31
+ name: string;
32
+ type: BmtConvertedFileType;
33
+ };
34
+ export type BmtConverterWorkerResult = {
35
+ files: BmtConverterWorkerFile[];
36
+ models: Record<number, BmtModelData>;
37
+ };
38
+ export type BmtConverterWorkerResponse = {
39
+ error: BmtConverterWorkerError;
40
+ taskId: string;
41
+ type: "error";
42
+ } | {
43
+ progress: WorkerProgressEvent;
44
+ taskId: string;
45
+ type: "progress";
46
+ } | {
47
+ result: BmtConverterWorkerResult;
48
+ taskId: string;
49
+ type: "complete";
50
+ };
@@ -0,0 +1,11 @@
1
+ import type { BmtConversionResult } from "../Loaders/BmtConverter";
2
+ import type { BmtConverterWorkerOptions } from "./BmtConverterWorker";
3
+ import type { WorkerProgressEvent } from "./ProgressUtils";
4
+ export type BmtConverterWorkerModelSource = ArrayBuffer | File | string;
5
+ export type BmtConverterWorkerClientOptions = BmtConverterWorkerOptions & {
6
+ onProgress?: (progress: WorkerProgressEvent) => void;
7
+ terminateOnComplete?: boolean;
8
+ worker?: Worker;
9
+ };
10
+ export declare function convertIfcFilesToBmtInWorker(sources: BmtConverterWorkerModelSource | BmtConverterWorkerModelSource[], options?: BmtConverterWorkerClientOptions): Promise<BmtConversionResult>;
11
+ export declare function createBmtConverterWorker(): Worker;
@@ -1,6 +1,9 @@
1
1
  export { createBmtWorker, loadBmtModelsInWorker } from "./BMTWorkerClient";
2
2
  export type { BmtWorkerClientOptions, BmtWorkerLoadedModels, BmtWorkerModelSource, } from "./BMTWorkerClient";
3
3
  export type { BmtWorkerError, BmtWorkerGeometryChunk, BmtWorkerLoadOptions, BmtWorkerLoadRequest, BmtWorkerResponse, BmtWorkerSource, } from "./BMTWorker";
4
+ export { convertIfcFilesToBmtInWorker, createBmtConverterWorker, } from "./BmtConverterWorkerClient";
5
+ export type { BmtConverterWorkerClientOptions, BmtConverterWorkerModelSource, } from "./BmtConverterWorkerClient";
6
+ export type { BmtConverterWorkerError, BmtConverterWorkerFile, BmtConverterWorkerOptions, BmtConverterWorkerRequest, BmtConverterWorkerResponse, BmtConverterWorkerResult, BmtConverterWorkerSource, } from "./BmtConverterWorker";
4
7
  export { createIfcWorker, loadIfcModelsInWorker } from "./IFCWorkerClient";
5
8
  export type { IfcWorkerClientOptions, IfcWorkerLoadedModels, IfcWorkerModelSource, } from "./IFCWorkerClient";
6
9
  export type { IfcWorkerError, IfcWorkerGeometryChunk, IfcWorkerLoadOptions, IfcWorkerLoadRequest, IfcWorkerResponse, IfcWorkerSource, } from "./IFCWorker";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bimatter-viewer-react",
3
- "version": "0.5.9",
3
+ "version": "0.5.11",
4
4
  "license": "PolyForm-Noncommercial-1.0.0",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",