DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector > Struct Template Reference

Functor that projects a face vertex of a surface mesh onto the tangent plane given by a per-face normal vector. This functor can be used in PolygonalCalculus to correct the embedding of digital surfaces using an estimated normal vector field (see [26]). More...

#include <DGtal/dec/PolygonalCalculus.h>

Public Types

typedef SurfaceMesh< TRealPoint, TRealVector > MySurfaceMesh
 Type of SurfaceMesh.
 
typedef MySurfaceMesh::Vertex Vertex
 Vertex type.
 
typedef MySurfaceMesh::Face Face
 Face type.
 
typedef MySurfaceMesh::RealPoint Real3dPoint
 Position type.
 

Public Member Functions

 EmbedderFromNormalVectors ()=delete
 
 EmbedderFromNormalVectors (ConstAlias< std::vector< Real3dPoint > > normals, ConstAlias< MySurfaceMesh > surfmesh)
 
Real3dPoint operator() (const Face &f, const Vertex &v)
 

Data Fields

const std::vector< Real3dPoint > * myNormals
 Alias to the normal vectors.
 
const MySurfaceMeshmySurfaceMesh
 Alias to the surface mesh.
 

Detailed Description

template<typename TRealPoint, typename TRealVector>
struct DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >

Functor that projects a face vertex of a surface mesh onto the tangent plane given by a per-face normal vector. This functor can be used in PolygonalCalculus to correct the embedding of digital surfaces using an estimated normal vector field (see [26]).

Note
when used in PolygonalCalculus, all operators being invariant by translation, all tangent planes pass through the origin (0,0,0) (no offest).
Template Parameters
TRealPointa model of points \(\mathbb{R}^3\) (e.g. PointVector).
TRealVectora model of vectors in \(\mathbb{R}^3\) (e.g. PointVector).

Definition at line 61 of file PolygonalCalculus.h.

Member Typedef Documentation

◆ Face

template<typename TRealPoint , typename TRealVector >
typedef MySurfaceMesh::Face DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::Face

Face type.

Definition at line 68 of file PolygonalCalculus.h.

◆ MySurfaceMesh

template<typename TRealPoint , typename TRealVector >
typedef SurfaceMesh<TRealPoint, TRealVector> DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::MySurfaceMesh

Type of SurfaceMesh.

Definition at line 64 of file PolygonalCalculus.h.

◆ Real3dPoint

template<typename TRealPoint , typename TRealVector >
typedef MySurfaceMesh::RealPoint DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::Real3dPoint

Position type.

Definition at line 70 of file PolygonalCalculus.h.

◆ Vertex

template<typename TRealPoint , typename TRealVector >
typedef MySurfaceMesh::Vertex DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::Vertex

Vertex type.

Definition at line 66 of file PolygonalCalculus.h.

Constructor & Destructor Documentation

◆ EmbedderFromNormalVectors() [1/2]

template<typename TRealPoint , typename TRealVector >
DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::EmbedderFromNormalVectors ( )
delete

◆ EmbedderFromNormalVectors() [2/2]

template<typename TRealPoint , typename TRealVector >
DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::EmbedderFromNormalVectors ( ConstAlias< std::vector< Real3dPoint > > normals,
ConstAlias< MySurfaceMesh > surfmesh )
inline

Constructor from an array of normal vectors and a surface mesh instance.

Parameters
normalsa vector of per face normal vectors (same ordering as the SurfaceMesh face indicies).
surfmeshan instance of SurfaceMesh

Definition at line 77 of file PolygonalCalculus.h.

79 {
80 myNormals = &normals;
82 }
SurfMesh surfmesh
const MySurfaceMesh * mySurfaceMesh
Alias to the surface mesh.
const std::vector< Real3dPoint > * myNormals
Alias to the normal vectors.

References DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::myNormals, DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::mySurfaceMesh, and surfmesh.

Member Function Documentation

◆ operator()()

template<typename TRealPoint , typename TRealVector >
Real3dPoint DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::operator() ( const Face & f,
const Vertex & v )
inline

Project a face vertex onto its tangent plane (given by the per-face estimated normal vector).

Parameters
fthe face that contains the vertex
vthe vertex to project

Definition at line 89 of file PolygonalCalculus.h.

90 {
91 const auto nn = (*myNormals)[f];
93 return p - nn.dot(p)*nn;
94 }
RealPoint & position(Vertex v)
MySurfaceMesh::RealPoint Real3dPoint
Position type.

References DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::mySurfaceMesh, and DGtal::SurfaceMesh< TRealPoint, TRealVector >::position().

Field Documentation

◆ myNormals

template<typename TRealPoint , typename TRealVector >
const std::vector<Real3dPoint>* DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::myNormals

◆ mySurfaceMesh

template<typename TRealPoint , typename TRealVector >
const MySurfaceMesh* DGtal::functors::EmbedderFromNormalVectors< TRealPoint, TRealVector >::mySurfaceMesh

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