/
MassProperties.ts
74 lines (68 loc) · 2.89 KB
/
MassProperties.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Geometry
*/
import { BentleyStatus, CompressedId64Set, Id64Array, Id64String } from "@itwin/core-bentley";
import { XYZProps } from "@itwin/core-geometry";
/** Specify whether to accumulate volumes, areas, or lengths for the supplied elements.
* @public
* @extensions
*/
export enum MassPropertiesOperation {
/** Return lengths for open paths and planar regions. */
AccumulateLengths = 0,
/** Return areas and perimeters for solid and surface geometry. */
AccumulateAreas = 1,
/** Return volumes and areas for solid geometry. */
AccumulateVolumes = 2,
}
/** Information required to request mass properties for elements from the front end to the back end.
* @public
* @extensions
*/
export interface MassPropertiesRequestProps {
operation: MassPropertiesOperation;
candidates?: Id64Array;
}
/** Information required to request mass properties for each element separately from the front end to the back end.
* @public
*/
export interface MassPropertiesPerCandidateRequestProps {
operations: MassPropertiesOperation[];
candidates: CompressedId64Set;
}
/** Information returned from the back end to the front end holding the result of the mass properties calculation.
* @public
* @extensions
*/
export interface MassPropertiesResponseProps {
/** Success if requested [[MassPropertiesOperation]] could be evaluated for the specified elements */
status: BentleyStatus;
/** Volume of solids when [[MassPropertiesOperation.AccumulateVolumes]] requested */
volume?: number;
/** Surface area of solids and surfaces when [[MassPropertiesOperation.AccumulateVolumes]] or [[MassPropertiesOperation.AccumulateAreas]] requested */
area?: number;
/** Perimeter of surfaces and planar regions when [[MassPropertiesOperation.AccumulateAreas]] requested */
perimeter?: number;
/** Length of curves or perimeter of planar regions when [[MassPropertiesOperation.AccumulateAreas]] or [[MassPropertiesOperation.AccumulateLength]] requested */
length?: number;
/** Centroid of geometry */
centroid?: XYZProps;
/** Product of inertia with respect to xy plane */
ixy?: number;
/** Product of inertia with respect to xz plane */
ixz?: number;
/** Product of inertia with respect to yz plane */
iyz?: number;
/** Moments of inertia */
moments?: XYZProps;
}
/** Information returned from the back end to the front end holding the result of the mass properties calculation for a single candidate.
* @public
*/
export interface MassPropertiesPerCandidateResponseProps extends MassPropertiesResponseProps {
candidate: Id64String;
}