CGAL 5.1 - 3D Generalized Barycentric Coordinates
|
#include <CGAL/Barycentric_coordinates_3/Discrete_harmonic_coordinates_3.h>
3D discrete harmonic coordinates.
This class implements 3D discrete harmonic coordinates [3], which can be computed at any point inside a convex polyhedron with triangular faces.
Discrete harmonic coordinates are well-defined in the closure of a convex polyhedron with triangular faces but they are not necessarily positive. The coordinates are computed analytically.
TriangleMesh | must be a model of the concept FaceListGraph . |
GeomTraits | a model of BarycentricTraits_3 |
VertexToPointMap | a property map with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and Point_3 as value type. The default is property_map_selector<TriangleMesh, CGAL::vertex_point_t> . |
Types | |
typedef GeomTraits::FT | FT |
Number type. | |
typedef GeomTraits::Point_3 | Point_3 |
Point type. | |
typedef GeomTraits::Vector_3 | Vector_3 |
Vector type. | |
Initialization | |
Discrete_harmonic_coordinates_3 (const TriangleMesh &triangle_mesh, const Computation_policy_3 policy, const VertexToPointMap vertex_to_point_map, const GeomTraits traits=GeomTraits()) | |
initializes all internal data structures. More... | |
Access | |
template<typename OutIterator > | |
OutIterator | operator() (const Point_3 &query, OutIterator c_begin) |
computes 3D discrete harmonic coordinates. More... | |
CGAL::Barycentric_coordinates::Discrete_harmonic_coordinates_3< TriangleMesh, GeomTraits, VertexToPointMap >::Discrete_harmonic_coordinates_3 | ( | const TriangleMesh & | triangle_mesh, |
const Computation_policy_3 | policy, | ||
const VertexToPointMap | vertex_to_point_map, | ||
const GeomTraits | traits = GeomTraits() |
||
) |
initializes all internal data structures.
This class implements the behavior of discrete harmonic coordinates for 3D query points.
triangle_mesh | an instance of TriangleMesh , which must be a convex simplicial polyhedron |
policy | one of the CGAL::Barycentric_coordinates::Computation_policy_3 ; the default is Computation_policy_3::FAST_WITH_EDGE_CASES |
traits | a traits class with geometric objects, predicates, and constructions; the default initialization is provided |
vertex_to_point_map | an instance of VertexToPointMap that maps a vertex from triangle_mesh to Point_3 ; the default initialization is provided |
OutIterator CGAL::Barycentric_coordinates::Discrete_harmonic_coordinates_3< TriangleMesh, GeomTraits, VertexToPointMap >::operator() | ( | const Point_3 & | query, |
OutIterator | c_begin | ||
) |
computes 3D discrete harmonic coordinates.
This function fills c_begin
with 3D discrete harmonic coordinates computed at the query
point with respect to the vertices of the input polyhedron.
The number of returned coordinates equals to the number of vertices.
After the coordinates \(b_i\) with \(i = 1\dots n\) are computed, where \(n\) is the number of vertices, the query point \(q\) can be obtained as \(q = \sum_{i = 1}^{n}b_ip_i\), where \(p_i\) are the polyhedron vertices.
OutIterator | a model of OutputIterator that accepts values of type FT |
query | a query point |
c_begin | the beginning of the destination range with the computed coordinates |