Functions to compute lengths of edges and borders, areas of faces and patches, as well as volumes of closed meshes.
template<typename PolygonMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::edge_length (typename boost::graph_traits< PolygonMesh >::halfedge_descriptor h, const PolygonMesh &pmesh, const NamedParameters &np)
template<typename PolygonMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::face_border_length (typename boost::graph_traits< PolygonMesh >::halfedge_descriptor h, const PolygonMesh &pmesh, const NamedParameters &np)
template<typename PolygonMesh , typename NamedParameters >
std::pair< halfedge_descriptor, FT > CGAL::Polygon_mesh_processing::longest_border (const PolygonMesh &pmesh, const NamedParameters &np)
template<typename TriangleMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::face_area (typename boost::graph_traits< TriangleMesh >::face_descriptor f, const TriangleMesh &tmesh, const NamedParameters &np)
template<typename FaceRange , typename TriangleMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::area (FaceRange face_range, const TriangleMesh &tmesh, const NamedParameters &np)
template<typename TriangleMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::area (const TriangleMesh &tmesh, const NamedParameters &np)
template<typename TriangleMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::volume (const TriangleMesh &tmesh, const NamedParameters &np)
template<typename TriangleMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::face_aspect_ratio (typename boost::graph_traits< TriangleMesh >::face_descriptor f, const TriangleMesh &tmesh, const NamedParameters &np)
template<typename TriangleMesh , typename NamedParameters >
Point_3 CGAL::Polygon_mesh_processing::centroid (const TriangleMesh &tmesh, const NamedParameters &np)
◆ area() [1/2]
template<typename TriangleMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::area
(
const TriangleMesh &
tmesh ,
const NamedParameters &
np
)
#include <CGAL/Polygon_mesh_processing/measure.h>
computes the surface area of a triangulated surface mesh.
Template Parameters
Parameters
tmesh the triangulated surface mesh
np an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
vertex_point_map
a property map associating points to the vertices of tmesh
Type: a class model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, tmesh)
geom_traits
an instance of a geometric traits class
Type: a class model of Kernel
Default: a CGAL Kernel deduced from the point type, using CGAL::Kernel_traits
Extra: The geometric traits class must be compatible with the vertex point type.
Returns the surface area of tmesh. The return type FT is a number 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 tmesh.
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.
See also face_area()
◆ area() [2/2]
template<typename FaceRange , typename TriangleMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::area
(
FaceRange
face_range ,
const TriangleMesh &
tmesh ,
const NamedParameters &
np
)
#include <CGAL/Polygon_mesh_processing/measure.h>
computes the area of a range of faces of a given triangulated surface mesh.
Template Parameters
Parameters
face_range the range of faces of which the area is computed
tmesh the triangulated surface mesh to which the faces of face_range belong
np an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
vertex_point_map
a property map associating points to the vertices of tmesh
Type: a class model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, tmesh)
geom_traits
an instance of a geometric traits class
Type: a class model of Kernel
Default: a CGAL Kernel deduced from the point type, using CGAL::Kernel_traits
Extra: The geometric traits class must be compatible with the vertex point type.
Returns sum of face areas of faces. The return type FT is a number 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 tmesh.
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.
See also face_area()
◆ centroid()
template<typename TriangleMesh , typename NamedParameters >
Point_3 CGAL::Polygon_mesh_processing::centroid
(
const TriangleMesh &
tmesh ,
const NamedParameters &
np
)
#include <CGAL/Polygon_mesh_processing/measure.h>
computes the centroid of a volume bounded by a closed triangulated surface mesh.
Template Parameters
Parameters
tmesh the closed triangulated surface mesh bounding the volume
np an optional sequence of Named Parameters among the ones listed below
Precondition tmesh is closed
Optional Named Parameters
vertex_point_map
a property map associating points to the vertices of tmesh
Type: a class model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, tmesh)
geom_traits
an instance of a geometric traits class
Type: a class model of Kernel
Default: a CGAL Kernel deduced from the point type, using CGAL::Kernel_traits
Extra: The geometric traits class must be compatible with the vertex point type.
Returns the centroid of the domain bounded by tmesh.
◆ edge_length()
template<typename PolygonMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::edge_length
(
typename boost::graph_traits< PolygonMesh >::halfedge_descriptor
h ,
const PolygonMesh &
pmesh ,
const NamedParameters &
np
)
#include <CGAL/Polygon_mesh_processing/measure.h>
computes the length of an edge of a given polygon mesh. The edge is given by one of its halfedges, or the edge itself.
Template Parameters
Parameters
h one halfedge of the edge to compute the length
pmesh the polygon mesh to which h belongs
np an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
vertex_point_map
a property map associating points to the vertices of pmesh
Type: a class model of ReadablePropertyMap with boost::graph_traits<PolygonMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, pmesh)
geom_traits
an instance of a geometric traits class
Type: a class model of Kernel
Default: a CGAL Kernel deduced from the point type, using CGAL::Kernel_traits
Extra: The geometric traits class must be compatible with the vertex point type.
Returns the length of h. The return type FT is a number 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 FT does not have a sqrt() operation, the square root computation will be done approximately.
See also face_border_length()
◆ face_area()
template<typename TriangleMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::face_area
(
typename boost::graph_traits< TriangleMesh >::face_descriptor
f ,
const TriangleMesh &
tmesh ,
const NamedParameters &
np
)
#include <CGAL/Polygon_mesh_processing/measure.h>
computes the area of a face of a given triangulated surface mesh.
Template Parameters
Parameters
f the face of which the area is computed
tmesh the triangulated surface mesh to which f belongs
np an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
vertex_point_map
a property map associating points to the vertices of tmesh
Type: a class model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, tmesh)
geom_traits
an instance of a geometric traits class
Type: a class model of Kernel
Default: a CGAL Kernel deduced from the point type, using CGAL::Kernel_traits
Extra: The geometric traits class must be compatible with the vertex point type.
Precondition f != boost::graph_traits<TriangleMesh>::null_face()
Returns the area of f. The return type FT is a number 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 tmesh.
See also area()
◆ face_aspect_ratio()
template<typename TriangleMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::face_aspect_ratio
(
typename boost::graph_traits< TriangleMesh >::face_descriptor
f ,
const TriangleMesh &
tmesh ,
const NamedParameters &
np
)
#include <CGAL/Polygon_mesh_processing/measure.h>
computes the aspect ratio of a face of a given triangulated surface mesh.
Template Parameters
Parameters
f the face of which the aspect ratio is computed
tmesh the triangulated surface mesh to which f belongs
np an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
vertex_point_map
a property map associating points to the vertices of tmesh
Type: a class model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, tmesh)
geom_traits
an instance of a geometric traits class
Type: a class model of Kernel
Default: a CGAL Kernel deduced from the point type, using CGAL::Kernel_traits
Extra: The geometric traits class must be compatible with the vertex point type.
Precondition f != boost::graph_traits<TriangleMesh>::null_face()
Returns the aspect ratio of f. The return type FT is a number 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 tmesh.
◆ face_border_length()
template<typename PolygonMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::face_border_length
(
typename boost::graph_traits< PolygonMesh >::halfedge_descriptor
h ,
const PolygonMesh &
pmesh ,
const NamedParameters &
np
)
#include <CGAL/Polygon_mesh_processing/measure.h>
computes the length of the border polyline that contains a given halfedge.
Template Parameters
Parameters
h a halfedge of the border polyline of which the length is computed
pmesh the polygon mesh to which h belongs
np an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
vertex_point_map
a property map associating points to the vertices of pmesh
Type: a class model of ReadablePropertyMap with boost::graph_traits<PolygonMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, pmesh)
geom_traits
an instance of a geometric traits class
Type: a class model of Kernel
Default: a CGAL Kernel deduced from the point type, using CGAL::Kernel_traits
Extra: The geometric traits class must be compatible with the vertex point type.
Returns the length of the sequence of border edges of face(h, pmesh). The return type FT is a number 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.
See also edge_length()
◆ longest_border()
template<typename PolygonMesh , typename NamedParameters >
std::pair<halfedge_descriptor, FT> CGAL::Polygon_mesh_processing::longest_border
(
const PolygonMesh &
pmesh ,
const NamedParameters &
np
)
#include <CGAL/Polygon_mesh_processing/measure.h>
finds the longest border of a given triangulated surface and returns a halfedge that is part of this border and the length of this border.
Template Parameters
Parameters
pmesh the polygon mesh
np an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
vertex_point_map
a property map associating points to the vertices of pmesh
Type: a class model of ReadablePropertyMap with boost::graph_traits<PolygonMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, pmesh)
geom_traits
an instance of a geometric traits class
Type: a class model of Kernel
Default: a CGAL Kernel deduced from the point type, using CGAL::Kernel_traits
Extra: The geometric traits class must be compatible with the vertex point type.
Returns a pair composed of two members:
first: a halfedge on the longest border. The return type halfedge_descriptor is a halfedge descriptor. It is deduced from the graph traits corresponding to the type PolygonMesh.
second: the length of the longest border The return type FT is a number 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
◆ volume()
template<typename TriangleMesh , typename NamedParameters >
FT CGAL::Polygon_mesh_processing::volume
(
const TriangleMesh &
tmesh ,
const NamedParameters &
np
)
#include <CGAL/Polygon_mesh_processing/measure.h>
computes the volume of the domain bounded by a closed triangulated surface mesh.
Template Parameters
Parameters
tmesh the closed triangulated surface mesh bounding the volume
np an optional sequence of Named Parameters among the ones listed below
Precondition tmesh is closed
Optional Named Parameters
vertex_point_map
a property map associating points to the vertices of tmesh
Type: a class model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, tmesh)
geom_traits
an instance of a geometric traits class
Type: a class model of Kernel
Default: a CGAL Kernel deduced from the point type, using CGAL::Kernel_traits
Extra: The geometric traits class must be compatible with the vertex point type.
Returns the volume bounded by tmesh. The return type FT is a number 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 tmesh.