DGtal  1.3.beta
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector > Struct Template Reference

Aim: Utility class to compute curvature measures induced by (1) a corrected normal current defined by a surface mesh with prescribed normals and (2) the standard Lipschitz-Killing invariant forms of area and curvatures. More...

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

Public Types

typedef TRealPoint RealPoint
 
typedef TRealVector RealVector
 
typedef CorrectedNormalCurrentComputer< RealPoint, RealVectorSelf
 
typedef DGtal::SurfaceMesh< RealPoint, RealVectorSurfaceMesh
 
typedef RealVector::Component Scalar
 
typedef SimpleMatrix< Scalar, dimension, dimensionRealTensor
 
typedef CorrectedNormalCurrentFormula< 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))
 
 CorrectedNormalCurrentComputer (ConstAlias< SurfaceMesh > aMesh, bool unit_u=false)
 
ScalarMeasure computeMu0 () const
 
ScalarMeasure computeMu1 () const
 
ScalarMeasure computeMu2 () const
 
TensorMeasure computeMuXY () 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 Member Functions

ScalarMeasure computeMu0ConstantU () const
 
ScalarMeasure computeMu1ConstantU () const
 
ScalarMeasure computeMu2ConstantU () const
 
TensorMeasure computeMuXYConstantU () const
 
ScalarMeasure computeMu0InterpolatedU () const
 
ScalarMeasure computeMu1InterpolatedU () const
 
ScalarMeasure computeMu2InterpolatedU () const
 
TensorMeasure computeMuXYInterpolatedU () const
 

Protected Attributes

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

Detailed Description

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

Aim: Utility class to compute curvature measures induced by (1) a corrected normal current defined by a surface mesh with prescribed normals and (2) the standard Lipschitz-Killing invariant forms of area and curvatures.

Description of template class 'CorrectedNormalCurrentComputer'

Note
By default it tries to compute interpolated corrected curvature measures, if the mesh has a normal at each vertex, otherwise it computes constant corrected curvature measures.
Template Parameters
TRealPointan arbitrary model of RealPoint.
TRealVectoran arbitrary model of RealVector.
Examples
geometry/meshes/curvature-comparator-ii-cnc-3d.cpp, geometry/meshes/curvature-measures-icnc-3d.cpp, geometry/meshes/curvature-measures-icnc-XY-3d.cpp, geometry/meshes/digpoly-curvature-measures-cnc-3d.cpp, geometry/meshes/digpoly-curvature-measures-cnc-XY-3d.cpp, geometry/meshes/obj-curvature-measures-icnc-3d.cpp, geometry/meshes/obj-curvature-measures-icnc-XY-3d.cpp, geometry/meshes/vol-curvature-measures-icnc-3d.cpp, and geometry/meshes/vol-curvature-measures-icnc-XY-3d.cpp.

Definition at line 69 of file CorrectedNormalCurrentComputer.h.

Member Typedef Documentation

◆ Face

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

Definition at line 89 of file CorrectedNormalCurrentComputer.h.

◆ Formula

template<typename TRealPoint , typename TRealVector >
typedef CorrectedNormalCurrentFormula< RealPoint, RealVector > DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::Formula

Definition at line 79 of file CorrectedNormalCurrentComputer.h.

◆ Index

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

Definition at line 87 of file CorrectedNormalCurrentComputer.h.

◆ RealPoint

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

Definition at line 71 of file CorrectedNormalCurrentComputer.h.

◆ RealPoints

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

Definition at line 83 of file CorrectedNormalCurrentComputer.h.

◆ RealTensor

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

Definition at line 78 of file CorrectedNormalCurrentComputer.h.

◆ RealTensors

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

Definition at line 85 of file CorrectedNormalCurrentComputer.h.

◆ RealVector

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

Definition at line 72 of file CorrectedNormalCurrentComputer.h.

◆ RealVectors

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

Definition at line 84 of file CorrectedNormalCurrentComputer.h.

◆ Scalar

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

Definition at line 77 of file CorrectedNormalCurrentComputer.h.

◆ ScalarMeasure

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

Definition at line 80 of file CorrectedNormalCurrentComputer.h.

◆ Scalars

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

Definition at line 82 of file CorrectedNormalCurrentComputer.h.

◆ Self

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

Definition at line 73 of file CorrectedNormalCurrentComputer.h.

◆ Size

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

Definition at line 86 of file CorrectedNormalCurrentComputer.h.

◆ SurfaceMesh

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

Definition at line 76 of file CorrectedNormalCurrentComputer.h.

◆ TensorMeasure

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

Definition at line 81 of file CorrectedNormalCurrentComputer.h.

◆ Vertex

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

Definition at line 88 of file CorrectedNormalCurrentComputer.h.

Constructor & Destructor Documentation

◆ CorrectedNormalCurrentComputer()

template<typename TRealPoint , typename TRealVector >
DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::CorrectedNormalCurrentComputer ( ConstAlias< SurfaceMesh aMesh,
bool  unit_u = false 
)

Constructor from mesh.

Parameters
aMeshany simplified mesh that is referenced in this object.
unit_uwhen set to 'true' tells the computer to normalize corrected normals in curvature formulae. For instance, for the Gaussian curvature, it induces exact Gaussian curvature computation with spherical triangles.

Member Function Documentation

◆ BOOST_STATIC_ASSERT()

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

◆ computeMu0()

template<typename TRealPoint , typename TRealVector >
ScalarMeasure DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::computeMu0 ( ) const
Returns
the \( \mu_0 \) corrected curvature measure, i.e. the area measure.

◆ computeMu0ConstantU()

template<typename TRealPoint , typename TRealVector >
ScalarMeasure DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::computeMu0ConstantU ( ) const
protected
Returns
the \( \mu_0 \) corrected curvature measure, i.e. the area measure, when corrected normals are constant per face.
Precondition
! myMesh.faceNormals().empty()

◆ computeMu0InterpolatedU()

template<typename TRealPoint , typename TRealVector >
ScalarMeasure DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::computeMu0InterpolatedU ( ) const
protected
Returns
the \( \mu_0 \) corrected curvature measure, i.e. the area measure, when corrected normals are interpolated per face.
Precondition
! myMesh.vertexNormals().empty()

◆ computeMu1()

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

◆ computeMu1ConstantU()

template<typename TRealPoint , typename TRealVector >
ScalarMeasure DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::computeMu1ConstantU ( ) const
protected
Returns
the \( \mu_1 \) corrected curvature measure, i.e. twice the mean curvature measure, when corrected normals are constant per face.
Precondition
! myMesh.faceNormals().empty()

◆ computeMu1InterpolatedU()

template<typename TRealPoint , typename TRealVector >
ScalarMeasure DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::computeMu1InterpolatedU ( ) const
protected
Returns
the \( \mu_1 \) corrected curvature measure, i.e. twice the mean curvature measure, when corrected normals are interpolated per face.
Precondition
! myMesh.vertexNormals().empty()

◆ computeMu2()

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

◆ computeMu2ConstantU()

template<typename TRealPoint , typename TRealVector >
ScalarMeasure DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::computeMu2ConstantU ( ) const
protected
Returns
the \( \mu_2 \) corrected curvature measure, i.e. the Gaussian curvature measure, when corrected normals are constant per face.
Precondition
! myMesh.faceNormals().empty()

◆ computeMu2InterpolatedU()

template<typename TRealPoint , typename TRealVector >
ScalarMeasure DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::computeMu2InterpolatedU ( ) const
protected
Returns
the \( \mu_2 \) corrected curvature measure, i.e. the Gaussian curvature measure, when corrected normals are interpolated per face.
Precondition
! myMesh.vertexNormals().empty()

◆ computeMuXY()

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

◆ computeMuXYConstantU()

template<typename TRealPoint , typename TRealVector >
TensorMeasure DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::computeMuXYConstantU ( ) const
protected
Returns
the \( \mu^{X,Y} \) corrected curvature measure, i.e. the anisotropic tensor curvature measure, when corrected normals are constant per face.
Precondition
! myMesh.faceNormals().empty()

◆ computeMuXYInterpolatedU()

template<typename TRealPoint , typename TRealVector >
TensorMeasure DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::computeMuXYInterpolatedU ( ) const
protected
Returns
the \( \mu^{X,Y} \) corrected curvature measure, i.e. the anisotropic tensor curvature measure, when corrected normals are interpolated per face.
Precondition
! myMesh.vertexNormals().empty()

◆ GaussianCurvature()

template<typename TRealPoint , typename TRealVector >
static Scalar DGtal::CorrectedNormalCurrentComputer< 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 135 of file CorrectedNormalCurrentComputer.h.

136  {
137  return ( mu0 != 0.0 ) ? mu2 / mu0 : 0.0;
138  }

◆ meanCurvature()

template<typename TRealPoint , typename TRealVector >
static Scalar DGtal::CorrectedNormalCurrentComputer< 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 126 of file CorrectedNormalCurrentComputer.h.

127  {
128  return ( mu0 != 0.0 ) ? mu1 / ( 2.0 * mu0 ) : 0.0;
129  }

◆ principalCurvatures()

template<typename TRealPoint , typename TRealVector >
static std::tuple< Scalar, Scalar, RealVector, RealVector > DGtal::CorrectedNormalCurrentComputer< 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 149 of file CorrectedNormalCurrentComputer.h.

150  {
151  muXY += muXY.transpose();
152  muXY *= 0.5;
153  const double coef_N = 1000.0 * mu0;
154  // Trick to force orthogonality to normal vector.
155  // (see @cite lachaud2020interpolated, section 2)
156  for ( int j = 0; j < 3; j++ )
157  for ( int k = 0; k < 3; k++ )
158  muXY( j, k ) += coef_N * N[ j ] * N[ k ];
159  RealTensor V;
160  RealVector L;
162  return std::make_tuple( ( mu0 != 0.0 ) ? -L[ 1 ] / mu0 : 0.0,
163  ( mu0 != 0.0 ) ? -L[ 0 ] / mu0 : 0.0,
164  V.column( 1 ),
165  V.column( 0 ) );
166  }

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::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::dimension = RealPoint::dimension
static

Definition at line 74 of file CorrectedNormalCurrentComputer.h.

◆ myMesh

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

A reference to the mesh over which computations are done.

Definition at line 176 of file CorrectedNormalCurrentComputer.h.

◆ myUnitU

template<typename TRealPoint , typename TRealVector >
bool DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::myUnitU
protected

Tells if we should use a normalized unit vector or not for interpolated curvature measures.

Definition at line 179 of file CorrectedNormalCurrentComputer.h.


The documentation for this struct was generated from the following file:
DGtal::EigenDecomposition::getEigenDecomposition
static void getEigenDecomposition(const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix.
DGtal::CorrectedNormalCurrentComputer::RealTensor
SimpleMatrix< Scalar, dimension, dimension > RealTensor
Definition: CorrectedNormalCurrentComputer.h:78
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:165