bimatter-viewer-react 1.0.1 → 1.0.2
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/ViewerComponents/ViewerScene.d.ts +5 -1
- package/lib/api/ViewerApi.d.ts +8 -1
- package/lib/api/loader.d.ts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3189 -2401
- package/lib/utils/DimentionsUtils/DimentionsUtils.d.ts +5 -0
- package/lib/utils/DimentionsUtils/index.d.ts +1 -1
- package/lib/utils/GeometryUtils/ElementCreationPreview.d.ts +23 -0
- package/lib/utils/GeometryUtils/createElements.d.ts +79 -0
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ export type ViewerDimensionsApi = {
|
|
|
30
30
|
deleteAll: () => void;
|
|
31
31
|
getActive: () => boolean;
|
|
32
32
|
getDimensions: () => DimensionLine[];
|
|
33
|
+
getPointAtPointer: (event: PointerEvent, snapToNearestPoint?: boolean) => Vector3 | null;
|
|
33
34
|
getSnapDistance: () => number;
|
|
34
35
|
getUnit: () => DimensionUnit;
|
|
35
36
|
setActive: (active: boolean) => void;
|
|
@@ -40,6 +41,9 @@ export type ViewerDimensionsApi = {
|
|
|
40
41
|
setWidth: (width: number) => void;
|
|
41
42
|
toggle: () => void;
|
|
42
43
|
};
|
|
44
|
+
export type DimensionAxis = "x" | "y" | "z";
|
|
45
|
+
export declare function getAxisConstrainedPoint(start: Vector3, point: Vector3, axis: DimensionAxis): Vector3;
|
|
46
|
+
export declare function getDominantAxis(start: Vector3, point: Vector3): DimensionAxis;
|
|
43
47
|
export declare class DimensionsUtils {
|
|
44
48
|
private active;
|
|
45
49
|
private axis;
|
|
@@ -73,6 +77,7 @@ export declare class DimensionsUtils {
|
|
|
73
77
|
setContext(context: DimensionsContext): void;
|
|
74
78
|
getActive(): boolean;
|
|
75
79
|
getDimensions(): DimensionLine[];
|
|
80
|
+
getPointAtPointer(event: PointerEvent, snapToNearestPoint?: boolean): Vector3 | null;
|
|
76
81
|
getSnapDistance(): number;
|
|
77
82
|
getUnit(): DimensionUnit;
|
|
78
83
|
setActive(active: boolean): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DimensionsUtils, useDimensionsUtils, type ViewerDimensionsApi, } from "./DimentionsUtils";
|
|
1
|
+
export { DimensionsUtils, getAxisConstrainedPoint, getDominantAxis, useDimensionsUtils, type DimensionAxis, type ViewerDimensionsApi, } from "./DimentionsUtils";
|
|
2
2
|
export { DimensionLine, type DimensionUnit } from "./DimentionLine";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Scene, Vector3, type Camera } from "three";
|
|
2
|
+
import { type IfcElementType } from "./createElements";
|
|
3
|
+
export type ElementCreationPreviewState = {
|
|
4
|
+
height: number;
|
|
5
|
+
points: Vector3[];
|
|
6
|
+
type: IfcElementType;
|
|
7
|
+
width: number;
|
|
8
|
+
};
|
|
9
|
+
export declare class ElementCreationPreview {
|
|
10
|
+
private readonly cursor;
|
|
11
|
+
private readonly lineMaterial;
|
|
12
|
+
private readonly outline;
|
|
13
|
+
private readonly previewGroup;
|
|
14
|
+
private readonly root;
|
|
15
|
+
private readonly wall;
|
|
16
|
+
private readonly wallOutline;
|
|
17
|
+
constructor(scene: Scene);
|
|
18
|
+
update(point: Vector3 | null, state: ElementCreationPreviewState, camera: Camera, viewportHeight: number): void;
|
|
19
|
+
hide(): void;
|
|
20
|
+
dispose(): void;
|
|
21
|
+
private updateWall;
|
|
22
|
+
private updateSlabOutline;
|
|
23
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { BufferGeometry } from "three";
|
|
2
|
+
import type { BmtElementProps, BmtGeomData, BmtModelData, BmtModelStructure, BmtModelStructureNode } from "../../Loaders/BmtLoader";
|
|
3
|
+
export type IfcElementType = "IfcWall" | "IfcSlab";
|
|
4
|
+
export type BmtElementType = IfcElementType | "IfcElementProxy";
|
|
5
|
+
export type IfcElementQuantities = Record<string, {
|
|
6
|
+
kind: "length" | "area" | "volume";
|
|
7
|
+
value: number;
|
|
8
|
+
}>;
|
|
9
|
+
export type CreatedBmtElement = {
|
|
10
|
+
geometry: BmtGeomData;
|
|
11
|
+
props: BmtElementProps;
|
|
12
|
+
structureNode: BmtModelStructureNode;
|
|
13
|
+
};
|
|
14
|
+
export type CreateIfcElementOptions = {
|
|
15
|
+
coordinationMatrix?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
quantities?: IfcElementQuantities;
|
|
18
|
+
};
|
|
19
|
+
export declare function createIfcGuid(): string;
|
|
20
|
+
export declare function getNextElementID(models: Record<number, BmtModelData>): number;
|
|
21
|
+
export declare function createWallGeometry(start: {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
z: number;
|
|
25
|
+
}, end: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
z: number;
|
|
29
|
+
}, height: number, thickness?: number): {
|
|
30
|
+
geometry: BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>;
|
|
31
|
+
quantities: {
|
|
32
|
+
Length: {
|
|
33
|
+
kind: "length";
|
|
34
|
+
value: number;
|
|
35
|
+
};
|
|
36
|
+
Width: {
|
|
37
|
+
kind: "length";
|
|
38
|
+
value: number;
|
|
39
|
+
};
|
|
40
|
+
Height: {
|
|
41
|
+
kind: "length";
|
|
42
|
+
value: number;
|
|
43
|
+
};
|
|
44
|
+
GrossFootprintArea: {
|
|
45
|
+
kind: "area";
|
|
46
|
+
value: number;
|
|
47
|
+
};
|
|
48
|
+
NetFootprintArea: {
|
|
49
|
+
kind: "area";
|
|
50
|
+
value: number;
|
|
51
|
+
};
|
|
52
|
+
GrossSideArea: {
|
|
53
|
+
kind: "area";
|
|
54
|
+
value: number;
|
|
55
|
+
};
|
|
56
|
+
NetSideArea: {
|
|
57
|
+
kind: "area";
|
|
58
|
+
value: number;
|
|
59
|
+
};
|
|
60
|
+
GrossVolume: {
|
|
61
|
+
kind: "volume";
|
|
62
|
+
value: number;
|
|
63
|
+
};
|
|
64
|
+
NetVolume: {
|
|
65
|
+
kind: "volume";
|
|
66
|
+
value: number;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export declare function createSlabGeometry(outline: Array<{
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
z: number;
|
|
74
|
+
}>, thickness: number): {
|
|
75
|
+
geometry: BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>;
|
|
76
|
+
quantities: IfcElementQuantities;
|
|
77
|
+
};
|
|
78
|
+
export declare function createBmtElement(sourceGeometry: BufferGeometry, type: BmtElementType, elementID: number, options?: CreateIfcElementOptions): CreatedBmtElement;
|
|
79
|
+
export declare function appendElementToStructure(structure: BmtModelStructure, element: BmtModelStructureNode): BmtModelStructure;
|