$darkmode
Methods for computing Polyhedral Mass properties (like inertia tensor, volume, etc) More...
#include <inertia.h>
Public Member Functions | |
Inertia (const MeshType &m) | |
Basic constructor. More... | |
void | compProjectionIntegrals (const FaceType &f) |
void | CompFaceIntegrals (const FaceType &f, const Point3< ScalarType > &n) |
void | Compute (const MeshType &m) |
ScalarType | Mass (void) const |
Return the Volume (or mass) of the mesh. More... | |
Point3< ScalarType > | CenterOfMass (void) const |
Return the Center of Mass (or barycenter) of the mesh. More... | |
void | InertiaTensor (Matrix33< ScalarType > &J) const |
void | InertiaTensor (Eigen::Matrix3d &J) const |
void | InertiaTensorEigen (Matrix33< ScalarType > &EV, Point3< ScalarType > &ev) const |
Return the Inertia tensor the mesh. More... | |
Static Public Member Functions | |
static void | Covariance (const MeshType &m, vcg::Point3< ScalarType > &bary, vcg::Matrix33< ScalarType > &C) |
Methods for computing Polyhedral Mass properties (like inertia tensor, volume, etc)
The algorithm is based on a three step reduction of the volume integrals to successively simpler integrals. The algorithm is designed to minimize the numerical errors that can result from poorly conditioned alignment of polyhedral faces. It is also designed for efficiency. All required volume integrals of a polyhedron are computed together during a single walk over the boundary of the polyhedron; exploiting common subexpressions reduces floating point operations.
For more information, check out:
Brian Mirtich, `‘Fast and Accurate Computation of Polyhedral Mass Properties,’' journal of graphics tools, volume 1, number 2, 1996
|
inline |
Basic constructor.
When you create a Inertia object, you have to specify the mesh that it refers to. The properties are computed at that moment. Subsequent modification of the mesh does not affect these values.
|
inline |
Return the Center of Mass (or barycenter) of the mesh.
Meaningful only if the mesh is watertight.
|
inline |
main function to be called.
It requires a watertight mesh with per face normals.
|
inlinestatic |
Compute covariance matrix of a mesh, i.e. the integral int_{M} { (x-b)(x-b)^T }dx where b is the barycenter and x spans over the mesh M
|
inline |
Return the Inertia tensor the mesh.
The result is factored as eigenvalues and eigenvectors (as ROWS).
|
inline |
Return the Volume (or mass) of the mesh.
Meaningful only if the mesh is watertight.