Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
vcg::tri::Inertia< MeshType > Class Template Reference

Methods for computing Polyhedral Mass properties (like inertia tensor, volume, etc) More...

#include <inertia.h>

List of all members.

Public Member Functions

Point3< ScalarTypeCenterOfMass ()
 Return the Center of Mass (or barycenter) of the mesh.
void CompFaceIntegrals (FaceType &f)
void compProjectionIntegrals (FaceType &f)
void Compute (MeshType &m)
 Inertia (MeshType &m)
 Basic constructor.
void InertiaTensor (Matrix33< ScalarType > &J)
void InertiaTensor (Eigen::Matrix3d &J)
void InertiaTensorEigen (Matrix33< ScalarType > &EV, Point3< ScalarType > &ev)
 Return the Inertia tensor the mesh.
ScalarType Mass ()
 Return the Volume (or mass) of the mesh.

Static Public Member Functions

static void Covariance (const MeshType &m, vcg::Point3< ScalarType > &bary, vcg::Matrix33< ScalarType > &C)

Private Types

enum  { X = 0, Y = 1, Z = 2 }
typedef MeshType::ConstFaceIterator ConstFaceIterator
typedef MeshType::CoordType CoordType
typedef MeshType::FaceContainer FaceContainer
typedef MeshType::FaceIterator FaceIterator
typedef MeshType::FacePointer FacePointer
typedef MeshType::FaceType FaceType
typedef MeshType::ScalarType ScalarType
typedef MeshType::VertexIterator VertexIterator
typedef MeshType::VertexPointer VertexPointer
typedef MeshType::VertexType VertexType

Private Member Functions

ScalarType CUBE (ScalarType &x) const
ScalarType SQR (ScalarType &x) const

Private Attributes

int A
int B
int C
double Fa
double Faa
double Faaa
double Faab
double Fb
double Fbb
double Fbbb
double Fbbc
double Fc
double Fcc
double Fcca
double Fccc
double P1
double Pa
double Paa
double Paaa
double Paab
double Pab
double Pabb
double Pb
double Pbb
double Pbbb
double T0
double T1 [3]
double T2 [3]
double TP [3]

Detailed Description

template<class MeshType>
class vcg::tri::Inertia< MeshType >

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

Definition at line 54 of file inertia.h.


Member Typedef Documentation

template<class MeshType>
typedef MeshType::ConstFaceIterator vcg::tri::Inertia< MeshType >::ConstFaceIterator [private]

Definition at line 63 of file inertia.h.

template<class MeshType>
typedef MeshType::CoordType vcg::tri::Inertia< MeshType >::CoordType [private]

Definition at line 65 of file inertia.h.

template<class MeshType>
typedef MeshType::FaceContainer vcg::tri::Inertia< MeshType >::FaceContainer [private]

Definition at line 64 of file inertia.h.

template<class MeshType>
typedef MeshType::FaceIterator vcg::tri::Inertia< MeshType >::FaceIterator [private]

Definition at line 62 of file inertia.h.

template<class MeshType>
typedef MeshType::FacePointer vcg::tri::Inertia< MeshType >::FacePointer [private]

Definition at line 61 of file inertia.h.

template<class MeshType>
typedef MeshType::FaceType vcg::tri::Inertia< MeshType >::FaceType [private]

Definition at line 60 of file inertia.h.

template<class MeshType>
typedef MeshType::ScalarType vcg::tri::Inertia< MeshType >::ScalarType [private]

Definition at line 59 of file inertia.h.

template<class MeshType>
typedef MeshType::VertexIterator vcg::tri::Inertia< MeshType >::VertexIterator [private]

Definition at line 58 of file inertia.h.

template<class MeshType>
typedef MeshType::VertexPointer vcg::tri::Inertia< MeshType >::VertexPointer [private]

Definition at line 57 of file inertia.h.

template<class MeshType>
typedef MeshType::VertexType vcg::tri::Inertia< MeshType >::VertexType [private]

Definition at line 56 of file inertia.h.


Member Enumeration Documentation

template<class MeshType>
anonymous enum [private]
Enumerator:
X 
Y 
Z 

Definition at line 68 of file inertia.h.


Constructor & Destructor Documentation

template<class MeshType>
vcg::tri::Inertia< MeshType >::Inertia ( MeshType &  m) [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.

Definition at line 91 of file inertia.h.


Member Function Documentation

template<class MeshType>
Point3<ScalarType> vcg::tri::Inertia< MeshType >::CenterOfMass ( ) [inline]

Return the Center of Mass (or barycenter) of the mesh.

Meaningful only if the mesh is watertight.

Definition at line 244 of file inertia.h.

template<class MeshType>
void vcg::tri::Inertia< MeshType >::CompFaceIntegrals ( FaceType f) [inline]

Definition at line 151 of file inertia.h.

template<class MeshType>
void vcg::tri::Inertia< MeshType >::compProjectionIntegrals ( FaceType f) [inline]

Definition at line 94 of file inertia.h.

template<class MeshType>
void vcg::tri::Inertia< MeshType >::Compute ( MeshType &  m) [inline]

main function to be called.

It requires a watertight mesh with per face normals.

Definition at line 191 of file inertia.h.

template<class MeshType>
static void vcg::tri::Inertia< MeshType >::Covariance ( const MeshType &  m,
vcg::Point3< ScalarType > &  bary,
vcg::Matrix33< ScalarType > &  C 
) [inline, static]

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

Definition at line 318 of file inertia.h.

template<class MeshType>
ScalarType vcg::tri::Inertia< MeshType >::CUBE ( ScalarType x) const [inline, private]

Definition at line 70 of file inertia.h.

template<class MeshType>
void vcg::tri::Inertia< MeshType >::InertiaTensor ( Matrix33< ScalarType > &  J) [inline]

Definition at line 252 of file inertia.h.

template<class MeshType>
void vcg::tri::Inertia< MeshType >::InertiaTensor ( Eigen::Matrix3d &  J) [inline]

Definition at line 274 of file inertia.h.

template<class MeshType>
void vcg::tri::Inertia< MeshType >::InertiaTensorEigen ( Matrix33< ScalarType > &  EV,
Point3< ScalarType > &  ev 
) [inline]

Return the Inertia tensor the mesh.

The result is factored as eigenvalues and eigenvectors (as ROWS).

Definition at line 303 of file inertia.h.

template<class MeshType>
ScalarType vcg::tri::Inertia< MeshType >::Mass ( ) [inline]

Return the Volume (or mass) of the mesh.

Meaningful only if the mesh is watertight.

Definition at line 235 of file inertia.h.

template<class MeshType>
ScalarType vcg::tri::Inertia< MeshType >::SQR ( ScalarType x) const [inline, private]

Definition at line 69 of file inertia.h.


Member Data Documentation

template<class MeshType>
int vcg::tri::Inertia< MeshType >::A [private]

Definition at line 72 of file inertia.h.

template<class MeshType>
int vcg::tri::Inertia< MeshType >::B [private]

Definition at line 73 of file inertia.h.

template<class MeshType>
int vcg::tri::Inertia< MeshType >::C [private]

Definition at line 74 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Fa [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Faa [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Faaa [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Faab [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Fb [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Fbb [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Fbbb [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Fbbc [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Fc [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Fcc [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Fcca [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Fccc [private]

Definition at line 80 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::P1 [private]

Definition at line 77 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Pa [private]

Definition at line 77 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Paa [private]

Definition at line 77 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Paaa [private]

Definition at line 77 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Paab [private]

Definition at line 77 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Pab [private]

Definition at line 77 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Pabb [private]

Definition at line 77 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Pb [private]

Definition at line 77 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Pbb [private]

Definition at line 77 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::Pbbb [private]

Definition at line 77 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::T0 [private]

Definition at line 83 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::T1[3] [private]

Definition at line 83 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::T2[3] [private]

Definition at line 83 of file inertia.h.

template<class MeshType>
double vcg::tri::Inertia< MeshType >::TP[3] [private]

Definition at line 83 of file inertia.h.


The documentation for this class was generated from the following file:


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:42:40