@thatopen/components 2.0.23 → 2.0.25
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/dist/core/Components/index.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +2126 -2020
- package/dist/measurement/MeasurementUtils/index.d.ts +35 -0
- package/dist/namespace.d.ts +1587 -1552
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2
3
|
import { Component, Components } from "../../core";
|
|
3
4
|
/**
|
|
4
5
|
* Represents an edge measurement result.
|
|
@@ -72,5 +73,39 @@ export declare class MeasurementUtils extends Component {
|
|
|
72
73
|
* @returns The vector with rounded components.
|
|
73
74
|
*/
|
|
74
75
|
round(vector: THREE.Vector3): void;
|
|
76
|
+
/**
|
|
77
|
+
* Calculates the volume of a set of fragments.
|
|
78
|
+
*
|
|
79
|
+
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
80
|
+
* @returns The total volume of the fragments and the bounding sphere.
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
84
|
+
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
85
|
+
*
|
|
86
|
+
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
87
|
+
* @throws Will throw an error if the fragment manager is not available.
|
|
88
|
+
*/
|
|
89
|
+
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): {
|
|
90
|
+
volume: number;
|
|
91
|
+
sphere: THREE.Sphere;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Calculates the total volume of a set of meshes.
|
|
95
|
+
*
|
|
96
|
+
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
97
|
+
* @returns The total volume of the meshes and the bounding sphere.
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
101
|
+
* and its bounding sphere.
|
|
102
|
+
*
|
|
103
|
+
*/
|
|
104
|
+
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): {
|
|
105
|
+
volume: number;
|
|
106
|
+
sphere: THREE.Sphere;
|
|
107
|
+
};
|
|
75
108
|
private getFaceData;
|
|
109
|
+
private getVolumeOfMesh;
|
|
110
|
+
private getSignedVolumeOfTriangle;
|
|
76
111
|
}
|