DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::ImplicitPolynomial3Shape< TSpace > Class Template Reference

Aim: model of CEuclideanOrientedShape concepts to create a shape from a polynomial. More...

#include <DGtal/shapes/implicit/ImplicitPolynomial3Shape.h>

Public Types

typedef ImplicitPolynomial3Shape< TSpace > Self
 
typedef TSpace Space
 
typedef Space::RealPoint RealPoint
 
typedef Space::RealVector RealVector
 
typedef RealPoint::Coordinate Ring
 
typedef Space::Integer Integer
 
typedef MPolynomial< 3, RingPolynomial3
 
typedef Ring Value
 

Public Member Functions

 BOOST_STATIC_ASSERT ((Space::dimension==3))
 
 ImplicitPolynomial3Shape (const Polynomial3 &poly)
 
ImplicitPolynomial3Shapeoperator= (const ImplicitPolynomial3Shape &other)
 
 ~ImplicitPolynomial3Shape ()
 
void init (const Polynomial3 &poly)
 
double operator() (const RealPoint &aPoint) const
 
bool isInside (const RealPoint &aPoint) const
 
Orientation orientation (const RealPoint &aPoint) const
 
RealVector gradient (const RealPoint &aPoint) const
 
double meanCurvature (const RealPoint &aPoint) const
 
double gaussianCurvature (const RealPoint &aPoint) const
 
void principalCurvatures (const RealPoint &aPoint, double &k1, double &k2) const
 
void principalDirections (const RealPoint &aPoint, RealVector &d1, RealVector &d2) const
 
RealPoint nearestPoint (const RealPoint &aPoint, const double accuracy=0.0001, const int maxIter=20, const double gamma=0.5) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 ImplicitPolynomial3Shape ()
 

Private Attributes

Polynomial3 myPolynomial
 The 3-polynomial defining the implicit shape.
 
Polynomial3 myFx
 
Polynomial3 myFy
 
Polynomial3 myFz
 
Polynomial3 myFxx
 
Polynomial3 myFxy
 
Polynomial3 myFxz
 
Polynomial3 myFyx
 
Polynomial3 myFyy
 
Polynomial3 myFyz
 
Polynomial3 myFzx
 
Polynomial3 myFzy
 
Polynomial3 myFzz
 
Polynomial3 myUpPolynome
 
Polynomial3 myLowPolynome
 

Detailed Description

template<typename TSpace>
class DGtal::ImplicitPolynomial3Shape< TSpace >

Aim: model of CEuclideanOrientedShape concepts to create a shape from a polynomial.

Description of template class 'ImplicitPolynomial3Shape'

Model of CImplicitFunction

Template Parameters
TSpacethe Digital space definition.
Examples
topology/trackImplicitPolynomialSurfaceToOFF.cpp.

Definition at line 67 of file ImplicitPolynomial3Shape.h.

Member Typedef Documentation

◆ Integer

template<typename TSpace >
typedef Space::Integer DGtal::ImplicitPolynomial3Shape< TSpace >::Integer

Definition at line 76 of file ImplicitPolynomial3Shape.h.

◆ Polynomial3

template<typename TSpace >
typedef MPolynomial< 3, Ring > DGtal::ImplicitPolynomial3Shape< TSpace >::Polynomial3

Definition at line 77 of file ImplicitPolynomial3Shape.h.

◆ RealPoint

template<typename TSpace >
typedef Space::RealPoint DGtal::ImplicitPolynomial3Shape< TSpace >::RealPoint

Definition at line 73 of file ImplicitPolynomial3Shape.h.

◆ RealVector

template<typename TSpace >
typedef Space::RealVector DGtal::ImplicitPolynomial3Shape< TSpace >::RealVector

Definition at line 74 of file ImplicitPolynomial3Shape.h.

◆ Ring

template<typename TSpace >
typedef RealPoint::Coordinate DGtal::ImplicitPolynomial3Shape< TSpace >::Ring

Definition at line 75 of file ImplicitPolynomial3Shape.h.

◆ Self

template<typename TSpace >
typedef ImplicitPolynomial3Shape<TSpace> DGtal::ImplicitPolynomial3Shape< TSpace >::Self

Definition at line 71 of file ImplicitPolynomial3Shape.h.

◆ Space

template<typename TSpace >
typedef TSpace DGtal::ImplicitPolynomial3Shape< TSpace >::Space

Definition at line 72 of file ImplicitPolynomial3Shape.h.

◆ Value

template<typename TSpace >
typedef Ring DGtal::ImplicitPolynomial3Shape< TSpace >::Value

Definition at line 78 of file ImplicitPolynomial3Shape.h.

Constructor & Destructor Documentation

◆ ImplicitPolynomial3Shape() [1/2]

template<typename TSpace >
DGtal::ImplicitPolynomial3Shape< TSpace >::ImplicitPolynomial3Shape ( const Polynomial3 & poly)

Constructor from an arbitrary polynomial.

Parameters
polyany multivariate polynomial (the number of variables is the dimension of the space)

◆ ~ImplicitPolynomial3Shape()

template<typename TSpace >
DGtal::ImplicitPolynomial3Shape< TSpace >::~ImplicitPolynomial3Shape ( )

Destructor.

◆ ImplicitPolynomial3Shape() [2/2]

template<typename TSpace >
DGtal::ImplicitPolynomial3Shape< TSpace >::ImplicitPolynomial3Shape ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

Member Function Documentation

◆ BOOST_STATIC_ASSERT()

template<typename TSpace >
DGtal::ImplicitPolynomial3Shape< TSpace >::BOOST_STATIC_ASSERT ( (Space::dimension==3) )

◆ gaussianCurvature()

template<typename TSpace >
double DGtal::ImplicitPolynomial3Shape< TSpace >::gaussianCurvature ( const RealPoint & aPoint) const
inline

Gaussian curvature estimation at aPoint

Precondition
aPoint must be close to the surface.

Uses the formula \( G = -det(M) / \|\nabla f\|^4 \), where \( M := \left[ \begin{array}{cccc} f_{xx}& f_{xy} & f_{xz} & f_x \\ f_{xy}& f_{yy} & f_{yz} & f_y \\ f_{xz}& f_{yz} & f_{zz} & f_z \\ f_x& f_y & f_z & 0 \end{array} \right] \).

Parameters
aPointany point in the Euclidean space.
Returns
the gaussian curvature value of the polynomial at aPoint.

◆ gradient()

template<typename TSpace >
RealVector DGtal::ImplicitPolynomial3Shape< TSpace >::gradient ( const RealPoint & aPoint) const
inline
Parameters
aPointany point in the Euclidean space.
Returns
the gradient vector of the polynomial at aPoint.

◆ init()

template<typename TSpace >
void DGtal::ImplicitPolynomial3Shape< TSpace >::init ( const Polynomial3 & poly)

Initialize from an arbitrary polynomial.

Parameters
polyany multivariate polynomial (the number of variables is the dimension of the space)

◆ isInside()

template<typename TSpace >
bool DGtal::ImplicitPolynomial3Shape< TSpace >::isInside ( const RealPoint & aPoint) const
Parameters
aPointany point in the Euclidean space.
Returns
'true' if the polynomial value is < 0.

◆ isValid()

template<typename TSpace >
bool DGtal::ImplicitPolynomial3Shape< TSpace >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ meanCurvature()

template<typename TSpace >
double DGtal::ImplicitPolynomial3Shape< TSpace >::meanCurvature ( const RealPoint & aPoint) const
inline

Mean curvature estimation. This computation is based on the hessian formula of the mean curvature k=(∇F ∗ H (F ) ∗ ∇F T − |∇F |^2 *Trace(H (F ))/2|∇F |^3

Precondition
a Point must be close to the surface.
Parameters
aPointany point in the Euclidean space.
Returns
the mean curvature value of the polynomial at aPoint.

◆ nearestPoint()

template<typename TSpace >
RealPoint DGtal::ImplicitPolynomial3Shape< TSpace >::nearestPoint ( const RealPoint & aPoint,
const double accuracy = 0.0001,
const int maxIter = 20,
const double gamma = 0.5 ) const
inline

Perform a gradient descent in order to move a point aPoint closer to the implicit surface f(x)=0. More precisely, we use a sequence: x_n = x_(n-1) - gamma * f(x) * gradient(x_(n-1))/ ||gradient(x_(n-1))||^2 The descent is stopped if maxIter is reached or if | f(x_n) | < accuracy.

Parameters
aPointany point in the Euclidean space.
accuracydistance criterion to stop the descent.
maxIterfixes the maximum number of steps.
gammacoefficient associated with the gradient.
Returns
the nearest point on the surface to the one given in parameter.

◆ operator()()

template<typename TSpace >
double DGtal::ImplicitPolynomial3Shape< TSpace >::operator() ( const RealPoint & aPoint) const
Parameters
aPointany point in the Euclidean space.
Returns
the value of the polynomial at aPoint.

◆ operator=()

template<typename TSpace >
ImplicitPolynomial3Shape & DGtal::ImplicitPolynomial3Shape< TSpace >::operator= ( const ImplicitPolynomial3Shape< TSpace > & other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

◆ orientation()

template<typename TSpace >
Orientation DGtal::ImplicitPolynomial3Shape< TSpace >::orientation ( const RealPoint & aPoint) const
Parameters
aPointany point in the Euclidean space.
Returns
INSIDE if the polynomial value is < 0, OUTSIDE if > 0, ON otherwise.

◆ principalCurvatures()

template<typename TSpace >
void DGtal::ImplicitPolynomial3Shape< TSpace >::principalCurvatures ( const RealPoint & aPoint,
double & k1,
double & k2 ) const
inline

Principal curvature estimation at aPoint

Precondition
aPoint must be close to the surface.
Parameters
[in]aPointany point in the Euclidean space.
[out]k1first principal curvature
[out]k2second principal curvature

◆ principalDirections()

template<typename TSpace >
void DGtal::ImplicitPolynomial3Shape< TSpace >::principalDirections ( const RealPoint & aPoint,
RealVector & d1,
RealVector & d2 ) const
inline

Principal directions of curvature estimation at aPoint

Precondition
aPoint must be close to the surface.
Parameters
[in]aPointany point in the Euclidean space.
[out]d1first principal direction
[out]d2second principal direction
Note
Principal directions are not reliable around umbilic points, i.e. where principal curvatures are the same.

[4]

◆ selfDisplay()

template<typename TSpace >
void DGtal::ImplicitPolynomial3Shape< TSpace >::selfDisplay ( std::ostream & out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Field Documentation

◆ myFx

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFx
private

Definition at line 244 of file ImplicitPolynomial3Shape.h.

◆ myFxx

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFxx
private

Definition at line 248 of file ImplicitPolynomial3Shape.h.

◆ myFxy

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFxy
private

Definition at line 249 of file ImplicitPolynomial3Shape.h.

◆ myFxz

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFxz
private

Definition at line 250 of file ImplicitPolynomial3Shape.h.

◆ myFy

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFy
private

Definition at line 245 of file ImplicitPolynomial3Shape.h.

◆ myFyx

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFyx
private

Definition at line 252 of file ImplicitPolynomial3Shape.h.

◆ myFyy

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFyy
private

Definition at line 253 of file ImplicitPolynomial3Shape.h.

◆ myFyz

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFyz
private

Definition at line 254 of file ImplicitPolynomial3Shape.h.

◆ myFz

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFz
private

Definition at line 246 of file ImplicitPolynomial3Shape.h.

◆ myFzx

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFzx
private

Definition at line 256 of file ImplicitPolynomial3Shape.h.

◆ myFzy

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFzy
private

Definition at line 257 of file ImplicitPolynomial3Shape.h.

◆ myFzz

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFzz
private

Definition at line 258 of file ImplicitPolynomial3Shape.h.

◆ myLowPolynome

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myLowPolynome
private

Definition at line 263 of file ImplicitPolynomial3Shape.h.

◆ myPolynomial

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myPolynomial
private

The 3-polynomial defining the implicit shape.

Definition at line 241 of file ImplicitPolynomial3Shape.h.

◆ myUpPolynome

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myUpPolynome
private

Definition at line 262 of file ImplicitPolynomial3Shape.h.


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