DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes
DGtal::NormalCycleComputer< TRealPoint, TRealVector > Struct Template Reference

Aim: Utility class to compute curvatures measures induced by (1) the normal cycle induced by a SurfaceMesh, (2) the standard Lipschitz-Killing invariant forms of area and curvatures. More...

#include <DGtal/geometry/meshes/NormalCycleComputer.h>

Public Types

typedef TRealPoint RealPoint
 
typedef TRealVector RealVector
 
typedef NormalCycleComputer< RealPoint, RealVectorSelf
 
typedef DGtal::SurfaceMesh< RealPoint, RealVectorSurfaceMesh
 
typedef RealVector::Component Scalar
 
typedef SimpleMatrix< Scalar, dimension, dimensionRealTensor
 
typedef NormalCycleFormula< RealPoint, RealVectorFormula
 
typedef SurfaceMeshMeasure< RealPoint, RealVector, ScalarScalarMeasure
 
typedef SurfaceMeshMeasure< RealPoint, RealVector, RealTensorTensorMeasure
 
typedef std::vector< ScalarScalars
 
typedef std::vector< RealPointRealPoints
 
typedef std::vector< RealVectorRealVectors
 
typedef std::vector< RealTensorRealTensors
 
typedef SurfaceMesh::Size Size
 
typedef SurfaceMesh::Index Index
 
typedef SurfaceMesh::Vertex Vertex
 
typedef SurfaceMesh::Face Face
 

Public Member Functions

 BOOST_STATIC_ASSERT ((dimension==3))
 
 NormalCycleComputer (ConstAlias< SurfaceMesh > aMesh)
 
ScalarMeasure computeMu0 () const
 
ScalarMeasure computeMu1 () const
 
ScalarMeasure computeMu2 () const
 
TensorMeasure computeMuXY () const
 
TensorMeasure computeMuXYs () const
 

Static Public Member Functions

Formulas for estimating curvatures from measures
static Scalar meanCurvature (Scalar mu0, Scalar mu1)
 
static Scalar GaussianCurvature (Scalar mu0, Scalar mu2)
 
static std::tuple< Scalar, Scalar, RealVector, RealVectorprincipalCurvatures (Scalar mu0, RealTensor muXY, const RealVector &N)
 

Static Public Attributes

static const Dimension dimension = RealPoint::dimension
 

Protected Attributes

const SurfaceMeshmyMesh
 A reference to the mesh over which computations are done. More...
 

Detailed Description

template<typename TRealPoint, typename TRealVector>
struct DGtal::NormalCycleComputer< TRealPoint, TRealVector >

Aim: Utility class to compute curvatures measures induced by (1) the normal cycle induced by a SurfaceMesh, (2) the standard Lipschitz-Killing invariant forms of area and curvatures.

Description of template class 'NormalCycleComputer'

Warning
Most curvature measures induces by the normal cycle have meaning only for surfaces with planar faces.
Template Parameters
TRealPointan arbitrary model of RealPoint.
TRealVectoran arbitrary model of RealVector.
Examples
geometry/meshes/curvature-measures-nc-3d.cpp, and geometry/meshes/curvature-measures-nc-XY-3d.cpp.

Definition at line 67 of file NormalCycleComputer.h.

Member Typedef Documentation

◆ Face

template<typename TRealPoint , typename TRealVector >
typedef SurfaceMesh::Face DGtal::NormalCycleComputer< TRealPoint, TRealVector >::Face

Definition at line 87 of file NormalCycleComputer.h.

◆ Formula

template<typename TRealPoint , typename TRealVector >
typedef NormalCycleFormula< RealPoint, RealVector > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::Formula

Definition at line 77 of file NormalCycleComputer.h.

◆ Index

template<typename TRealPoint , typename TRealVector >
typedef SurfaceMesh::Index DGtal::NormalCycleComputer< TRealPoint, TRealVector >::Index

Definition at line 85 of file NormalCycleComputer.h.

◆ RealPoint

template<typename TRealPoint , typename TRealVector >
typedef TRealPoint DGtal::NormalCycleComputer< TRealPoint, TRealVector >::RealPoint

Definition at line 69 of file NormalCycleComputer.h.

◆ RealPoints

template<typename TRealPoint , typename TRealVector >
typedef std::vector< RealPoint > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::RealPoints

Definition at line 81 of file NormalCycleComputer.h.

◆ RealTensor

template<typename TRealPoint , typename TRealVector >
typedef SimpleMatrix< Scalar, dimension, dimension > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::RealTensor

Definition at line 76 of file NormalCycleComputer.h.

◆ RealTensors

template<typename TRealPoint , typename TRealVector >
typedef std::vector< RealTensor > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::RealTensors

Definition at line 83 of file NormalCycleComputer.h.

◆ RealVector

template<typename TRealPoint , typename TRealVector >
typedef TRealVector DGtal::NormalCycleComputer< TRealPoint, TRealVector >::RealVector

Definition at line 70 of file NormalCycleComputer.h.

◆ RealVectors

template<typename TRealPoint , typename TRealVector >
typedef std::vector< RealVector > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::RealVectors

Definition at line 82 of file NormalCycleComputer.h.

◆ Scalar

template<typename TRealPoint , typename TRealVector >
typedef RealVector::Component DGtal::NormalCycleComputer< TRealPoint, TRealVector >::Scalar

Definition at line 75 of file NormalCycleComputer.h.

◆ ScalarMeasure

template<typename TRealPoint , typename TRealVector >
typedef SurfaceMeshMeasure< RealPoint, RealVector, Scalar > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::ScalarMeasure

Definition at line 78 of file NormalCycleComputer.h.

◆ Scalars

template<typename TRealPoint , typename TRealVector >
typedef std::vector< Scalar > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::Scalars

Definition at line 80 of file NormalCycleComputer.h.

◆ Self

template<typename TRealPoint , typename TRealVector >
typedef NormalCycleComputer< RealPoint, RealVector > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::Self

Definition at line 71 of file NormalCycleComputer.h.

◆ Size

template<typename TRealPoint , typename TRealVector >
typedef SurfaceMesh::Size DGtal::NormalCycleComputer< TRealPoint, TRealVector >::Size

Definition at line 84 of file NormalCycleComputer.h.

◆ SurfaceMesh

template<typename TRealPoint , typename TRealVector >
typedef DGtal::SurfaceMesh< RealPoint, RealVector > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::SurfaceMesh

Definition at line 74 of file NormalCycleComputer.h.

◆ TensorMeasure

template<typename TRealPoint , typename TRealVector >
typedef SurfaceMeshMeasure< RealPoint, RealVector, RealTensor > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::TensorMeasure

Definition at line 79 of file NormalCycleComputer.h.

◆ Vertex

template<typename TRealPoint , typename TRealVector >
typedef SurfaceMesh::Vertex DGtal::NormalCycleComputer< TRealPoint, TRealVector >::Vertex

Definition at line 86 of file NormalCycleComputer.h.

Constructor & Destructor Documentation

◆ NormalCycleComputer()

template<typename TRealPoint , typename TRealVector >
DGtal::NormalCycleComputer< TRealPoint, TRealVector >::NormalCycleComputer ( ConstAlias< SurfaceMesh aMesh)

Constructor from mesh.

Parameters
aMeshany simplified mesh that is referenced in this object.

Member Function Documentation

◆ BOOST_STATIC_ASSERT()

template<typename TRealPoint , typename TRealVector >
DGtal::NormalCycleComputer< TRealPoint, TRealVector >::BOOST_STATIC_ASSERT ( (dimension==3)  )

◆ computeMu0()

template<typename TRealPoint , typename TRealVector >
ScalarMeasure DGtal::NormalCycleComputer< TRealPoint, TRealVector >::computeMu0 ( ) const
Returns
the \( \mu_0 \) normal cycle measure, i.e. the area measure.

◆ computeMu1()

template<typename TRealPoint , typename TRealVector >
ScalarMeasure DGtal::NormalCycleComputer< TRealPoint, TRealVector >::computeMu1 ( ) const
Returns
the \( \mu_1 \) normal cycle measure, i.e. twice the mean curvature measure.

◆ computeMu2()

template<typename TRealPoint , typename TRealVector >
ScalarMeasure DGtal::NormalCycleComputer< TRealPoint, TRealVector >::computeMu2 ( ) const
Returns
the \( \mu_2 \) normal cycle measure, i.e. the Gaussian curvature measure.

◆ computeMuXY()

template<typename TRealPoint , typename TRealVector >
TensorMeasure DGtal::NormalCycleComputer< TRealPoint, TRealVector >::computeMuXY ( ) const
Returns
the \( \mu^{X,Y} \) normal cycle measure, i.e. the anisotropic tensor curvature measure.

◆ computeMuXYs()

template<typename TRealPoint , typename TRealVector >
TensorMeasure DGtal::NormalCycleComputer< TRealPoint, TRealVector >::computeMuXYs ( ) const
Returns
the \( \tilde{\mu}^{X,Y} \) normal cycle measure, i.e. the anisotropic tensor curvature measure with swapped eigenvectors.

◆ GaussianCurvature()

template<typename TRealPoint , typename TRealVector >
static Scalar DGtal::NormalCycleComputer< TRealPoint, TRealVector >::GaussianCurvature ( Scalar  mu0,
Scalar  mu2 
)
inlinestatic
Parameters
mu0the mu0 measure (i.e. area) of some set
mu2the mu2 measure (i.e. the Gaussian curvature measue) of the same set
Returns
the estimated Gaussian curvature on this set.

Definition at line 127 of file NormalCycleComputer.h.

128 {
129 return ( mu0 != 0.0 ) ? mu2 / mu0 : 0.0;
130 }

◆ meanCurvature()

template<typename TRealPoint , typename TRealVector >
static Scalar DGtal::NormalCycleComputer< TRealPoint, TRealVector >::meanCurvature ( Scalar  mu0,
Scalar  mu1 
)
inlinestatic
Parameters
mu0the mu0 measure (i.e. area) of some set
mu1the mu1 measure (i.e. twice the mean curvature measue) of the same set
Returns
the estimated mean curvature on this set.

Definition at line 118 of file NormalCycleComputer.h.

119 {
120 return ( mu0 != 0.0 ) ? mu1 / ( 2.0 * mu0 ) : 0.0;
121 }

◆ principalCurvatures()

template<typename TRealPoint , typename TRealVector >
static std::tuple< Scalar, Scalar, RealVector, RealVector > DGtal::NormalCycleComputer< TRealPoint, TRealVector >::principalCurvatures ( Scalar  mu0,
RealTensor  muXY,
const RealVector N 
)
inlinestatic
Parameters
mu0the mu0 measure (i.e. area) of some set
muXYthe anisotropic muXY measure (i.e. the second fundamental form measue) of the same set
Nthe normal vector at the location of the set
Returns
a tuple (K1,K2,D1,D2) where K1 and K2 are two principal curvatures (K1<=K2) and D1 and D2 are their associated principal directions.

Definition at line 141 of file NormalCycleComputer.h.

142 {
143 muXY += muXY.transpose();
144 muXY *= 0.5;
145 const double coef_N = 1000.0 * mu0;
146 // Trick to force orthogonality to normal vector.
147 for ( int j = 0; j < 3; j++ )
148 for ( int k = 0; k < 3; k++ )
149 muXY( j, k ) += coef_N * N[ j ] * N[ k ];
150 RealTensor V;
151 RealVector L;
153 return std::make_tuple( ( mu0 != 0.0 ) ? -L[ 1 ] / mu0 : 0.0,
154 ( mu0 != 0.0 ) ? -L[ 0 ] / mu0 : 0.0,
155 V.column( 1 ),
156 V.column( 0 ) );
157 }
static void getEigenDecomposition(const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix.
SimpleMatrix< Scalar, dimension, dimension > RealTensor

References DGtal::SimpleMatrix< TComponent, TM, TN >::column(), DGtal::EigenDecomposition< TN, TComponent, TMatrix >::getEigenDecomposition(), and DGtal::SimpleMatrix< TComponent, TM, TN >::transpose().

Field Documentation

◆ dimension

template<typename TRealPoint , typename TRealVector >
const Dimension DGtal::NormalCycleComputer< TRealPoint, TRealVector >::dimension = RealPoint::dimension
static

Definition at line 72 of file NormalCycleComputer.h.

◆ myMesh

template<typename TRealPoint , typename TRealVector >
const SurfaceMesh& DGtal::NormalCycleComputer< TRealPoint, TRealVector >::myMesh
protected

A reference to the mesh over which computations are done.

Definition at line 164 of file NormalCycleComputer.h.


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