bimatter-viewer-react 0.2.0 → 0.4.0

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 (33) hide show
  1. package/README.md +151 -1
  2. package/lib/Camera/useCameraUtils.d.ts +28 -0
  3. package/lib/Loaders/BmtConverter.d.ts +95 -0
  4. package/lib/Loaders/BmtLoader.d.ts +3 -1
  5. package/lib/Loaders/IFCLoader/IFCLoader.d.ts +4 -1
  6. package/lib/Loaders/IFCLoader/IfcGrid.d.ts +1 -1
  7. package/lib/SelectableMesh.d.ts +2 -1
  8. package/lib/Selector/SelectionBox.d.ts +3 -2
  9. package/lib/Selector/useSelector.d.ts +2 -2
  10. package/lib/api/ViewerApi.d.ts +29 -0
  11. package/lib/api/loader.d.ts +7 -1
  12. package/lib/index.d.ts +8 -5
  13. package/lib/index.js +17205 -15349
  14. package/lib/store/ViewerStore.d.ts +14 -0
  15. package/lib/utils/ClippingUtils/ClippingEdges.d.ts +23 -0
  16. package/lib/utils/ClippingUtils/ClippingUtils.d.ts +87 -0
  17. package/lib/utils/ClippingUtils/PlaneHelper.d.ts +54 -0
  18. package/lib/utils/ClippingUtils/index.d.ts +2 -0
  19. package/lib/{Colors → utils/ColorsUtils}/useElementColors.d.ts +1 -0
  20. package/lib/utils/DimentionsUtils/DimentionLine.d.ts +59 -0
  21. package/lib/utils/DimentionsUtils/DimentionsUtils.d.ts +97 -0
  22. package/lib/utils/DimentionsUtils/index.d.ts +2 -0
  23. package/lib/{GeometryUtils → utils/GeometryUtils}/useGeometryIndex.d.ts +3 -1
  24. package/lib/{GeometryUtils → utils/GeometryUtils}/useGeometryUtils.d.ts +3 -0
  25. package/lib/utils/Hotkeys/useHotkeysUtils.d.ts +1 -0
  26. package/lib/{NavigationCube → utils/NavigationCube}/NavigationCube.d.ts +1 -1
  27. package/package.json +2 -1
  28. package/lib/Hotkeys/useHotkeysUtils.d.ts +0 -2
  29. package/lib/ModelGrids copy/ModelGrids.d.ts +0 -61
  30. /package/lib/{ModelGrids → utils/ModelGrids}/ModelGrids.d.ts +0 -0
  31. /package/lib/{ModelGrids → utils/ModelGrids}/index.d.ts +0 -0
  32. /package/lib/{ModelGrids → utils/ModelGrids}/types.d.ts +0 -0
  33. /package/lib/{NavigationCube → utils/NavigationCube}/index.d.ts +0 -0
@@ -1,5 +1,7 @@
1
1
  import { type StoreApi } from "zustand/vanilla";
2
+ import type { ColorRepresentation } from "three";
2
3
  import type { BmtModelProps, BmtModelStructure } from "../Loaders/BmtLoader";
4
+ import type { ViewerApi } from "../api/ViewerApi";
3
5
  export type UserDevice = "pc" | "mobile";
4
6
  export type ViewerGridAxisSide = "bottom" | "left" | "right" | "top";
5
7
  export type ViewerGridAxesVisibility = Record<ViewerGridAxisSide, boolean> & {
@@ -10,19 +12,31 @@ export interface SelectedStore {
10
12
  }
11
13
  export type ViewerModelPropsStore = Record<number, BmtModelProps>;
12
14
  export type ViewerModelStructureStore = Record<number, BmtModelStructure>;
15
+ export declare const DEFAULT_SELECTION_COLOR = "rgb(17, 148, 189)";
16
+ export declare const DEFAULT_PRESELECTION_COLOR = "rgb(104, 198, 227)";
13
17
  export type ViewerStore = {
18
+ api: ViewerApi | null;
19
+ defaultHotkeysEnabled: boolean;
14
20
  modelProps: ViewerModelPropsStore;
15
21
  modelStructure: ViewerModelStructureStore;
16
22
  gridAxesVisibility: ViewerGridAxesVisibility;
23
+ preselectionColor: ColorRepresentation;
17
24
  selected: SelectedStore;
25
+ selectionColor: ColorRepresentation;
26
+ selectionInteractionDisabled: boolean;
18
27
  showNavCube: boolean;
19
28
  showStats: boolean;
20
29
  userDevice: UserDevice;
30
+ setApi: (api: ViewerApi | null) => void;
31
+ setDefaultHotkeysEnabled: (enabled: boolean) => void;
21
32
  setGridAxesVisibility: (gridAxesVisibility: Partial<ViewerGridAxesVisibility>) => void;
22
33
  setGridAxisVisibility: (side: ViewerGridAxisSide, visible: boolean) => void;
23
34
  setShowGridAxes: (visible: boolean) => void;
24
35
  setModelProps: (modelProps: ViewerModelPropsStore) => void;
25
36
  setModelStructure: (modelStructure: ViewerModelStructureStore) => void;
37
+ setPreselectionColor: (color: ColorRepresentation) => void;
38
+ setSelectionColor: (color: ColorRepresentation) => void;
39
+ setSelectionInteractionDisabled: (disabled: boolean) => void;
26
40
  setShowNavCube: (showNavCube: boolean) => void;
27
41
  setShowStats: (showStats: boolean) => void;
28
42
  setSelection: (selected: SelectedStore) => void;
@@ -0,0 +1,23 @@
1
+ import { BufferGeometry, LineBasicMaterial, LineSegments, Plane } from "three";
2
+ import type { ClippingUtils } from "./ClippingUtils";
3
+ export declare class ClippingEdges {
4
+ active: boolean;
5
+ readonly material: LineBasicMaterial;
6
+ readonly plane: Plane;
7
+ private readonly context;
8
+ private readonly lines;
9
+ private readonly inverseMatrix;
10
+ private readonly localPlane;
11
+ private readonly tempLine;
12
+ private readonly tempVector;
13
+ private readonly tempVector1;
14
+ private readonly tempVector2;
15
+ private readonly tempVector3;
16
+ constructor(context: ClippingUtils, plane: Plane);
17
+ 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
+ syncMeshes(): void;
19
+ dispose(): void;
20
+ setVisible(visible: boolean): void;
21
+ toggle(): void;
22
+ update(): void;
23
+ }
@@ -0,0 +1,87 @@
1
+ import { Camera, Material, Mesh, Plane, Raycaster, Scene, Vector3, WebGLRenderer } from "three";
2
+ import type { CameraUtilsApi } from "../../Camera/useCameraUtils";
3
+ import type { ViewerStoreApi } from "../../store/ViewerStore";
4
+ import type { ViewerControlsRef, ViewerModelRef } from "../../types";
5
+ import { ClippingEdges } from "./ClippingEdges";
6
+ import { PlaneHelper } from "./PlaneHelper";
7
+ type ClippingContext = {
8
+ camera: Camera;
9
+ cameraUtils: CameraUtilsApi;
10
+ controlRef: ViewerControlsRef;
11
+ domElement: HTMLCanvasElement;
12
+ modelRef: ViewerModelRef;
13
+ raycaster: Raycaster;
14
+ renderer: WebGLRenderer;
15
+ scene: Scene;
16
+ viewerStore: ViewerStoreApi;
17
+ };
18
+ export type ViewerClippingApi = {
19
+ createClippingRectangle: () => Plane[];
20
+ createPlane: (event?: MouseEvent | PointerEvent) => Plane | null;
21
+ deleteAllPlanes: () => void;
22
+ getEdgesActive: () => boolean;
23
+ getHelpersActive: () => boolean;
24
+ getPlanes: () => Plane[];
25
+ getActive: () => boolean;
26
+ setActive: (active: boolean) => void;
27
+ setEdgesActive: (active: boolean) => void;
28
+ setHelpersActive: (active: boolean) => void;
29
+ toggle: () => void;
30
+ updateEdges: () => void;
31
+ updateMaterials: () => void;
32
+ };
33
+ export declare class ClippingUtils {
34
+ planes: Plane[];
35
+ edges: ClippingEdges[];
36
+ helpers: PlaneHelper[];
37
+ private active;
38
+ private context;
39
+ private edgesActive;
40
+ private helperDragActive;
41
+ private helpersActive;
42
+ private helperHoverMoveState;
43
+ private updateEdgesFrame;
44
+ private updateHelpersFrame;
45
+ constructor(context: ClippingContext);
46
+ setContext(context: ClippingContext): void;
47
+ getActive(): boolean;
48
+ getEdgesActive(): boolean;
49
+ getHelpersActive(): boolean;
50
+ getPlanes(): Plane[];
51
+ getScene(): Scene<import("three").Object3DEventMap>;
52
+ getCamera(): Camera;
53
+ getCameraUtils(): CameraUtilsApi;
54
+ getDomElement(): HTMLCanvasElement;
55
+ getRaycaster(): Raycaster;
56
+ getControlRef(): ViewerControlsRef;
57
+ getMeshes(): Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, Material<import("three").MaterialEventMap> | Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>[];
58
+ getHelperHoverIsMoving(): boolean;
59
+ getHelperDragActive(): boolean;
60
+ setHelperDragActive(active: boolean): void;
61
+ clearHelpersHover(except?: PlaneHelper): void;
62
+ setHelperHoverMoveStart: () => void;
63
+ setHelperHoverMoveEnd: () => void;
64
+ setHelperHoverMoving: () => void;
65
+ private getModelWorldBox;
66
+ setControlsEnabled(enabled: boolean): void;
67
+ setSelectionInteractionDisabled(disabled: boolean): void;
68
+ updateMaterials(): void;
69
+ setActive(active: boolean): void;
70
+ toggle(): void;
71
+ createPlane(event?: MouseEvent | PointerEvent): Plane | null;
72
+ createClippingRectangle(): Plane[];
73
+ addPlane(plane: Plane, location: Vector3, normal: Vector3): void;
74
+ deleteAllPlanes(): void;
75
+ setHelpersActive(active: boolean): void;
76
+ setEdgesActive(active: boolean): void;
77
+ updateEdges(): void;
78
+ updateHelpers(): void;
79
+ requestEdgesUpdate(): void;
80
+ requestHelpersUpdate(): void;
81
+ syncWithModel(): void;
82
+ dispose(): void;
83
+ }
84
+ export declare function useClippingUtils(modelRef: ViewerModelRef, controlRef: ViewerControlsRef, cameraUtils: CameraUtilsApi): ViewerClippingApi & {
85
+ syncWithModel: () => void;
86
+ };
87
+ export {};
@@ -0,0 +1,54 @@
1
+ import { Box3, Group, LineDashedMaterial, MeshBasicMaterial, Object3D, Plane, Vector3 } from "three";
2
+ import type { ClippingUtils } from "./ClippingUtils";
3
+ export declare function getClippingHelperBoundsOffset(box: Box3): number;
4
+ export declare class PlaneHelper extends Object3D {
5
+ readonly helper: Group<import("three").Object3DEventMap>;
6
+ readonly borderMaterial: LineDashedMaterial;
7
+ readonly material: MeshBasicMaterial;
8
+ readonly plane: Plane;
9
+ private active;
10
+ private readonly border;
11
+ private readonly context;
12
+ private readonly location;
13
+ private readonly normal;
14
+ private readonly planeMesh;
15
+ private readonly pointer;
16
+ private layout;
17
+ private dragState;
18
+ private hovered;
19
+ private listenersActive;
20
+ constructor(context: ClippingUtils, plane: Plane, location: Vector3, normal: Vector3);
21
+ setVisible(visible: boolean): void;
22
+ toggle(): void;
23
+ clearHover(): void;
24
+ dispose(): void;
25
+ private addToView;
26
+ private removeFromView;
27
+ updateClipping(): void;
28
+ private updateBorderDash;
29
+ private addEventListeners;
30
+ private removeEventListeners;
31
+ private getPointerIntersection;
32
+ private getNearestHelperIntersection;
33
+ private hasModelIntersection;
34
+ private getPointerPointOnPlane;
35
+ private onPointerDown;
36
+ private onPointerMove;
37
+ private onPointerUp;
38
+ private updateHoverState;
39
+ private setHovered;
40
+ private createPlaneMesh;
41
+ private createBorder;
42
+ private replaceGeometry;
43
+ private createFillGeometry;
44
+ private createBorderGeometry;
45
+ private getClippedPolygon;
46
+ private clipPolygonByPlane;
47
+ private getLocalPointDistanceToPlane;
48
+ private getPlaneIntersectionPoint;
49
+ private getHelperLayout;
50
+ private getPlaneBasis;
51
+ private applyPlaneOrientation;
52
+ private getModelWorldBox;
53
+ private getBoxCorners;
54
+ }
@@ -0,0 +1,2 @@
1
+ export { useClippingUtils } from "./ClippingUtils";
2
+ export type { ViewerClippingApi } from "./ClippingUtils";
@@ -1,6 +1,7 @@
1
1
  import { DataTexture, type ColorRepresentation } from "three";
2
2
  import type { GeometryIndexApi } from "../GeometryUtils/useGeometryIndex";
3
3
  export declare const MAX_ELEMENT_COLOR_PALETTE_SIZE = 256;
4
+ export declare const SELECTION_COLOR_INDEX = 1;
4
5
  export type ViewerElementColorsApi = {
5
6
  applyStoredColors: () => void;
6
7
  clearAllColors: () => void;
@@ -0,0 +1,59 @@
1
+ import { BufferGeometry, Color, ConeGeometry, Group, Line, LineDashedMaterial, Mesh, MeshBasicMaterial, Sprite, Vector3, type Camera } from "three";
2
+ export type DimensionUnit = "m" | "mm";
3
+ export type DimensionLineOptions = {
4
+ boundingMaterial: MeshBasicMaterial;
5
+ endpointGeometry: ConeGeometry;
6
+ endpointMaterial: MeshBasicMaterial;
7
+ endpointScale: Vector3;
8
+ lineMaterial: LineDashedMaterial;
9
+ root: Group;
10
+ start: Vector3;
11
+ end: Vector3;
12
+ };
13
+ export declare class DimensionLine {
14
+ static scale: number;
15
+ static scaleFactor: number;
16
+ static units: DimensionUnit;
17
+ readonly root: Group<import("three").Object3DEventMap>;
18
+ readonly start: Vector3;
19
+ readonly endpointMeshes: Mesh[];
20
+ boundingMesh: Mesh | null;
21
+ end: Vector3;
22
+ line: Line;
23
+ private readonly boundingMaterial;
24
+ private readonly endpointGeometry;
25
+ private readonly endpointMaterial;
26
+ private readonly lineGeometry;
27
+ private readonly lineMaterial;
28
+ private readonly ownerRoot;
29
+ private endpointBaseScale;
30
+ private labelHeight;
31
+ private labelSprite;
32
+ private labelText;
33
+ private labelTexture;
34
+ private labelWidth;
35
+ constructor({ boundingMaterial, endpointGeometry, endpointMaterial, endpointScale, lineMaterial, root, start, end, }: DimensionLineOptions);
36
+ get length(): number;
37
+ get center(): Vector3;
38
+ get text(): Sprite<import("three").Object3DEventMap>;
39
+ get boundingBox(): Mesh<BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap> | null;
40
+ set dimensionColor(dimensionColor: Color);
41
+ set visibility(visible: boolean);
42
+ set endpointScale(scale: Vector3);
43
+ set endPoint(point: Vector3);
44
+ createBoundingBox(): void;
45
+ removeFromScene(): void;
46
+ dispose(): void;
47
+ updateForCamera(camera: Camera, viewportHeight: number): void;
48
+ private addEndpointMeshes;
49
+ private addEndpointMesh;
50
+ private createLabelSprite;
51
+ private createBoundingBoxMesh;
52
+ private getTextContent;
53
+ private updateLabel;
54
+ private updatePositions;
55
+ private updateBoundingBox;
56
+ private rescaleMesh;
57
+ private rescaleBoundingMesh;
58
+ private rescaleLabel;
59
+ }
@@ -0,0 +1,97 @@
1
+ import { Color, ConeGeometry, SphereGeometry, type Camera, type Scene } from "three";
2
+ import type { CameraUtilsApi } from "../../Camera/useCameraUtils";
3
+ import type { ViewerStoreApi } from "../../store/ViewerStore";
4
+ import type { ViewerControlsRef, ViewerModelRef } from "../../types";
5
+ import { DimensionLine, type DimensionUnit } from "./DimentionLine";
6
+ type DimensionsContext = {
7
+ camera: Camera;
8
+ cameraUtils: CameraUtilsApi;
9
+ controlRef: ViewerControlsRef;
10
+ domElement: HTMLCanvasElement;
11
+ modelRef: ViewerModelRef;
12
+ scene: Scene;
13
+ viewerStore: ViewerStoreApi;
14
+ viewportHeight: number;
15
+ };
16
+ export type ViewerDimensionsApi = {
17
+ cancelDrawing: () => void;
18
+ changeAxes: () => void;
19
+ delete: () => void;
20
+ deleteAll: () => void;
21
+ getActive: () => boolean;
22
+ getDimensions: () => DimensionLine[];
23
+ getSnapDistance: () => number;
24
+ getUnit: () => DimensionUnit;
25
+ setActive: (active: boolean) => void;
26
+ setColor: (color: string | Color) => void;
27
+ setEndpointScaleFactor: (factor: number) => void;
28
+ setSnapDistance: (distance: number) => void;
29
+ setUnit: (unit: DimensionUnit) => void;
30
+ setWidth: (width: number) => void;
31
+ toggle: () => void;
32
+ };
33
+ export declare class DimensionsUtils {
34
+ private active;
35
+ private axis;
36
+ private readonly boundingMaterial;
37
+ private context;
38
+ private currentDimension;
39
+ private dimensions;
40
+ private readonly endpointGeometry;
41
+ private readonly endpointMaterial;
42
+ private endpointScale;
43
+ private readonly lineMaterial;
44
+ private measureInProcess;
45
+ private moveState;
46
+ private readonly previewMarker;
47
+ private readonly root;
48
+ private snapDistance;
49
+ private startPoint;
50
+ private unit;
51
+ constructor(context: DimensionsContext);
52
+ setContext(context: DimensionsContext): void;
53
+ getActive(): boolean;
54
+ getDimensions(): DimensionLine[];
55
+ getSnapDistance(): number;
56
+ getUnit(): DimensionUnit;
57
+ setActive(active: boolean): void;
58
+ toggle(): void;
59
+ setColor(color: string | Color): void;
60
+ setEndpointScaleFactor(factor: number): void;
61
+ setSnapDistance(distance: number): void;
62
+ setUnit(unit: DimensionUnit): void;
63
+ setWidth(width: number): void;
64
+ cancelDrawing(): void;
65
+ delete(): void;
66
+ deleteAll(): void;
67
+ changeAxes(): void;
68
+ updateFrame(): void;
69
+ syncWithModel(): void;
70
+ dispose(): void;
71
+ private addEventListeners;
72
+ private removeEventListeners;
73
+ private drawStart;
74
+ private drawPreview;
75
+ private drawEnd;
76
+ private createDimension;
77
+ private getModelHit;
78
+ private getBoundingBoxes;
79
+ private getClosestVertex;
80
+ private getPreviewEndPoint;
81
+ private getNextAxis;
82
+ private getIsMoving;
83
+ private rescalePreviewMarker;
84
+ private setSelectionInteractionDisabled;
85
+ private onClick;
86
+ private onPointerMove;
87
+ private onPointerDown;
88
+ private onPointerUp;
89
+ private onControlsChange;
90
+ private onKeyDown;
91
+ static createEndpointGeometry(height?: number, radius?: number): ConeGeometry;
92
+ static createPreviewGeometry(): SphereGeometry;
93
+ }
94
+ export declare function useDimensionsUtils(modelRef: ViewerModelRef, controlRef: ViewerControlsRef, cameraUtils: CameraUtilsApi): ViewerDimensionsApi & {
95
+ syncWithModel: () => void;
96
+ };
97
+ export {};
@@ -0,0 +1,2 @@
1
+ export { DimensionsUtils, useDimensionsUtils, type ViewerDimensionsApi, } from "./DimentionsUtils";
2
+ export { DimensionLine, type DimensionUnit } from "./DimentionLine";
@@ -1,6 +1,6 @@
1
1
  import { Mesh, Object3D } from "three";
2
2
  import type { MeshBVH } from "three-mesh-bvh";
3
- import type { ViewerModelRef } from "../types";
3
+ import type { ViewerModelRef } from "../../types";
4
4
  export type IndexArray = Uint16Array | Uint32Array;
5
5
  export type IndexRange = {
6
6
  count: number;
@@ -9,6 +9,7 @@ export type IndexRange = {
9
9
  export type MeshGeometryRecord = {
10
10
  hiddenIds: Set<number>;
11
11
  initialVisible: boolean;
12
+ isIfcSpace: boolean;
12
13
  mesh: Mesh;
13
14
  modelID: number;
14
15
  originalBoundsTree: MeshBVH | null;
@@ -24,6 +25,7 @@ export type ElementIndexEntry = {
24
25
  };
25
26
  export type GeometryIndex = {
26
27
  elementIndex: Map<number, ElementIndexEntry[]>;
28
+ ifcSpacesVisible: boolean;
27
29
  indexedModel: Object3D | null;
28
30
  isolatedIdsByModel: Map<number, Set<number>> | null;
29
31
  isolatedIds: Set<number> | null;
@@ -2,12 +2,15 @@ import type { GeometryIndexApi } from "./useGeometryIndex";
2
2
  export type GeometryUtilsApi = {
3
3
  buildIndex: GeometryIndexApi["buildIndex"];
4
4
  getAllIds: () => number[];
5
+ getIfcSpacesVisibility: () => boolean;
5
6
  hideByIds: (ids: number[]) => void;
6
7
  hideSelected: () => void;
7
8
  isolateByIds: (ids: number[]) => void;
8
9
  isolateSelected: () => void;
9
10
  resetIsolation: () => void;
11
+ setIfcSpacesVisibility: (visible: boolean) => void;
10
12
  showAll: () => void;
11
13
  showByIds: (ids: number[]) => void;
14
+ toggleIIfcSpacesVisibility: () => void;
12
15
  };
13
16
  export default function useGeometryUtils(geometryIndex: GeometryIndexApi): GeometryUtilsApi;
@@ -0,0 +1 @@
1
+ export default function useHotkeys(): void;
@@ -1,4 +1,4 @@
1
- import type { ViewerCameraRef, ViewerControlsRef, ViewerModelRef } from "../types";
1
+ import type { ViewerCameraRef, ViewerControlsRef, ViewerModelRef } from "../../types";
2
2
  type NavigationCubeProps = {
3
3
  active?: boolean;
4
4
  cameraRef: ViewerCameraRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bimatter-viewer-react",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "license": "PolyForm-Noncommercial-1.0.0",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -53,6 +53,7 @@
53
53
  "eslint-plugin-react-hooks": "^7.1.1",
54
54
  "eslint-plugin-react-refresh": "^0.5.2",
55
55
  "globals": "^17.5.0",
56
+ "lil-gui": "^0.21.0",
56
57
  "react": "^19.2.5",
57
58
  "react-dom": "^19.2.5",
58
59
  "three": "^0.184.0",
@@ -1,2 +0,0 @@
1
- import type { GeometryUtilsApi } from "../GeometryUtils/useGeometryUtils";
2
- export default function useHotkeys(geometryUtils: GeometryUtilsApi): void;
@@ -1,61 +0,0 @@
1
- import { Color, Group, LineBasicMaterial, Texture, Vector3, type Matrix4 } from "three";
2
- import { CSS2DObject } from "three/examples/jsm/renderers/CSS2DRenderer.js";
3
- import type { GridData } from "../Loaders/IFCLoader/IfcGrid";
4
- import type { ModelGridAxis, ModelGridPoint } from "../ModelGrids";
5
- type LegacyViewerContext = {
6
- boundingBox: {
7
- min: Vector3;
8
- };
9
- context: {
10
- container: {
11
- style: {
12
- background: string;
13
- };
14
- };
15
- context: {
16
- scene: {
17
- threeScene: {
18
- add: (object: Group) => void;
19
- background: Color | Texture | null;
20
- };
21
- };
22
- };
23
- loaders: {
24
- coordinationMatrix?: Matrix4 | null;
25
- };
26
- };
27
- };
28
- type LegacyGridAxisType = "u" | "v";
29
- type RgbColor = {
30
- b: number;
31
- g: number;
32
- r: number;
33
- };
34
- export declare class ModelGrids {
35
- topTags: CSS2DObject[];
36
- botTags: CSS2DObject[];
37
- leftTags: CSS2DObject[];
38
- rightTags: CSS2DObject[];
39
- _active: boolean;
40
- grids: GridData[];
41
- color: string;
42
- material: LineBasicMaterial;
43
- mesh: Group;
44
- readonly context: LegacyViewerContext;
45
- constructor(context: LegacyViewerContext, grids: {
46
- [key: string]: GridData;
47
- });
48
- init(): Promise<void>;
49
- addGrid(gridGroup: Group, data: ModelGridAxis, locCoordinates: ModelGridPoint, type: LegacyGridAxisType, lowY: Vector3): void;
50
- viewTop(bool: boolean): void;
51
- viewBot(bool: boolean): void;
52
- viewLeft(bool: boolean): void;
53
- viewRight(bool: boolean): void;
54
- get active(): boolean;
55
- set active(active: boolean);
56
- hexToRgb(hex: string): RgbColor;
57
- hex2hsl(hex: string): number[];
58
- rgb2hsl(r: number, g: number, b: number): number[];
59
- changeColor(color: Color | string): "#000000" | "#FFFFFF";
60
- }
61
- export {};
File without changes
File without changes