SmApiBrepComputeMassProperties#
Defined in SM_API/inc/SmApiQueries.h
- SmApiStatus SmApiBrepComputeMassProperties(
- const SmBrep *pBrep,
- double dRelativeAccuracy,
- double dDensity,
- const SmPoint3d &crOrigin,
- double &rdArea,
- double &rdVolume,
- double &rdMass,
- SmPoint3d &rCentroid,
- SmVector3d &rMomentsOfInertia,
- SmVector3d &rProductsOfInertia,
- Parameters:
pBrep – [in ]: Brep to query (closed manifold solid; read-only)
dRelativeAccuracy –
[in ]: Relative accuracy, clamped to [1e-4, 1e-1]; non-finite is
rejected with SM_ERR_INVALID_INPUT
dDensity –
[in ]: Uniform mass density (mass = density * volume); must be a
valid double >= SM_EFF_ZERO (1e-12), else
SM_ERR_INVALID_INPUTcrOrigin –
[in ]: Origin the moments/products are taken about (axes parallel
to world axes); pass the centroid for centroidal inertia.
Must be finite, else SM_ERR_INVALID_INPUTrdArea – [out]: Total surface area
rdVolume – [out]: Enclosed volume
rdMass – [out]: Mass = dDensity * volume
rCentroid –
[out]: Mass centroid (centre of gravity) in world coordinates;
independent of crOrigin
rMomentsOfInertia –
[out]: Mass moments of inertia (Ixx, Iyy, Izz) about axes through
crOrigin parallel to the world axes
rProductsOfInertia –
[out]: Mass products of inertia about crOrigin as raw positive
integrals (Iyz, Izx, Ixy); tensor off-diagonals are negatives