\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 5.0.2 - Polygon Mesh Processing

Functions to compute unit normals for individual/all vertices or faces.

Functions

template<typename PolygonMesh , typename NamedParameters >
Vector_3 CGAL::Polygon_mesh_processing::compute_face_normal (typename boost::graph_traits< PolygonMesh >::face_descriptor f, const PolygonMesh &pmesh, const NamedParameters &np)
 computes the outward unit vector normal to face f. More...
 
template<typename PolygonMesh , typename FaceNormalMap , typename NamedParameters >
void CGAL::Polygon_mesh_processing::compute_face_normals (const PolygonMesh &pmesh, FaceNormalMap fnm, const NamedParameters &np)
 computes the outward unit vector normal for all faces of the polygon mesh. More...
 
template<typename PolygonMesh , typename NamedParameters >
Vector_3 CGAL::Polygon_mesh_processing::compute_vertex_normal (typename boost::graph_traits< PolygonMesh >::vertex_descriptor v, const PolygonMesh &pmesh, const NamedParameters &np)
 computes the unit normal at vertex v as the average of the normals of incident faces. More...
 
template<typename PolygonMesh , typename VertexNormalMap , typename NamedParameters >
void CGAL::Polygon_mesh_processing::compute_vertex_normals (const PolygonMesh &pmesh, VertexNormalMap vnm, const NamedParameters &np)
 computes the outward unit vector normal for all vertices of the polygon mesh. More...
 
template<typename PolygonMesh , typename VertexNormalMap , typename FaceNormalMap , typename NamedParameters >
void CGAL::Polygon_mesh_processing::compute_normals (const PolygonMesh &pmesh, VertexNormalMap vnm, FaceNormalMap fnm, const NamedParameters &np)
 computes the outward unit vector normal for all vertices and faces of the polygon mesh. More...
 

Function Documentation

◆ compute_face_normal()

template<typename PolygonMesh , typename NamedParameters >
Vector_3 CGAL::Polygon_mesh_processing::compute_face_normal ( typename boost::graph_traits< PolygonMesh >::face_descriptor  f,
const PolygonMesh &  pmesh,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/compute_normal.h>

computes the outward unit vector normal to face f.

Template Parameters
PolygonMesha model of FaceGraph
NamedParametersa sequence of Named Parameters
Parameters
fthe face on which the normal is computed
pmeshthe polygon mesh containing f
npoptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of pmesh. If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in PolygonMesh
geom_traitsan instance of a geometric traits class, model of Kernel
Returns
the computed normal. The return type is a 3D vector type. It is either deduced from the geom_traits Named Parameters if provided, or from the geometric traits class deduced from the point property map of pmesh.
Warning
This function involves a square root computation. If Kernel::FT does not have a sqrt() operation, the square root computation will be done approximately.

◆ compute_face_normals()

template<typename PolygonMesh , typename FaceNormalMap , typename NamedParameters >
void CGAL::Polygon_mesh_processing::compute_face_normals ( const PolygonMesh &  pmesh,
FaceNormalMap  fnm,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/compute_normal.h>

computes the outward unit vector normal for all faces of the polygon mesh.

Template Parameters
PolygonMesha model of FaceGraph
FaceNormalMapa model of WritablePropertyMap with boost::graph_traits<PolygonMesh>::face_descriptor as key type and Kernel::Vector_3 as value type.
Parameters
pmeshthe polygon mesh
fnmthe property map in which the normals are written
npoptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of pmesh. If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in PolygonMesh
geom_traitsan instance of a geometric traits class, model of Kernel
Warning
This function involves a square root computation. If Kernel::FT does not have a sqrt() operation, the square root computation will be done approximately.

◆ compute_normals()

template<typename PolygonMesh , typename VertexNormalMap , typename FaceNormalMap , typename NamedParameters >
void CGAL::Polygon_mesh_processing::compute_normals ( const PolygonMesh &  pmesh,
VertexNormalMap  vnm,
FaceNormalMap  fnm,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/compute_normal.h>

computes the outward unit vector normal for all vertices and faces of the polygon mesh.

Template Parameters
PolygonMesha model of FaceListGraph
VertexNormalMapa model of WritablePropertyMap with boost::graph_traits<PolygonMesh>::vertex_descriptor as key type and Kernel::Vector_3 as value type.
FaceNormalMapa model of ReadWritePropertyMap with boost::graph_traits<PolygonMesh>::face_descriptor as key type and Kernel::Vector_3 as value type.
Parameters
pmeshthe polygon mesh
vnmthe property map in which the vertex normals are written
fnmthe property map in which the face normals are written
npoptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of pmesh. If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in PolygonMesh
geom_traitsan instance of a geometric traits class, model of Kernel
Warning
This function involves a square root computation. If Kernel::FT does not have a sqrt() operation, the square root computation will be done approximately.
Examples:
Polygon_mesh_processing/compute_normals_example.cpp, and Polygon_mesh_processing/compute_normals_example_Polyhedron.cpp.

◆ compute_vertex_normal()

template<typename PolygonMesh , typename NamedParameters >
Vector_3 CGAL::Polygon_mesh_processing::compute_vertex_normal ( typename boost::graph_traits< PolygonMesh >::vertex_descriptor  v,
const PolygonMesh &  pmesh,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/compute_normal.h>

computes the unit normal at vertex v as the average of the normals of incident faces.

Template Parameters
PolygonMesha model of FaceGraph
Parameters
vthe vertex at which the normal is computed
pmeshthe polygon mesh containing v
npoptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of pmesh. If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in PolygonMesh
geom_traitsan instance of a geometric traits class, model of Kernel
Returns
the computed normal. The return type is a 3D vector type. It is either deduced from the geom_traits Named Parameters if provided, or the geometric traits class deduced from the point property map of pmesh.
Warning
This function involves a square root computation. If Kernel::FT does not have a sqrt() operation, the square root computation will be done approximately.

◆ compute_vertex_normals()

template<typename PolygonMesh , typename VertexNormalMap , typename NamedParameters >
void CGAL::Polygon_mesh_processing::compute_vertex_normals ( const PolygonMesh &  pmesh,
VertexNormalMap  vnm,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/compute_normal.h>

computes the outward unit vector normal for all vertices of the polygon mesh.

Template Parameters
PolygonMesha model of FaceListGraph
VertexNormalMapa model of WritablePropertyMap with boost::graph_traits<PolygonMesh>::vertex_descriptor as key type and the return type of compute_vertex_normal() as value type.
Parameters
pmeshthe polygon mesh
vnmthe property map in which the normals are written
npoptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of pmesh. If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in PolygonMesh
geom_traitsan instance of a geometric traits class, model of Kernel
Warning
This function involves a square root computation. If Kernel::FT does not have a sqrt() operation, the square root computation will be done approximately.