|
CGAL 6.2 - 3D Generalized Barycentric Coordinates
|
#include <CGAL/Barycentric_coordinates_3/Wachspress_coordinates_3.h>
computes 3D Wachspress coordinates with respect to a closed convex triangle mesh.
This class implements 3D Wachspress coordinates ( [1], [2] ), which can be computed at any point inside a convex polyhedron with triangular faces.
Wachspress coordinates are well-defined and non-negative in the closure of a convex polyhedron with triangular faces. The coordinates are computed analytically.
| TriangleMesh | must be a model of the concept FaceListGraph. |
| VertexPointMap | a property map with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and GeomTraits::Point_3 as value type. |
| GeomTraits | a model of BarycentricTraits_3. |
Types | |
| using | FT = typename GeomTraits::FT |
| Number type. | |
| using | Point_3 = typename GeomTraits::Point_3 |
| Point type. | |
| using | Vector_3 = typename GeomTraits::Vector_3 |
| Vector type. | |
Initialization | |
| Wachspress_coordinates_3 (const TriangleMesh &tmesh, const Computation_policy_3 policy, const VertexPointMap vertex_point_map, const GeomTraits traits=GeomTraits()) | |
| initializes all internal data structures. | |
Access | |
| template<typename OutputIterator > | |
| OutputIterator | operator() (const Point_3 &query, OutputIterator oi) |
| computes 3D Wachspress coordinates with respect to a closed convex triangle mesh. | |
| CGAL::Barycentric_coordinates::Wachspress_coordinates_3< TriangleMesh, VertexPointMap, GeomTraits >::Wachspress_coordinates_3 | ( | const TriangleMesh & | tmesh, |
| const Computation_policy_3 | policy, | ||
| const VertexPointMap | vertex_point_map, | ||
| const GeomTraits | traits = GeomTraits() |
||
| ) |
initializes all internal data structures.
This class implements the behavior of Wachspress coordinates for 3D query points.
| tmesh | an instance of TriangleMesh |
| 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_point_map | an instance of VertexPointMap that maps a vertex from tmesh to Point_3; the default initialization is provided |
tmesh) >= 4. tmesh). tmesh). tmesh). | OutputIterator CGAL::Barycentric_coordinates::Wachspress_coordinates_3< TriangleMesh, VertexPointMap, GeomTraits >::operator() | ( | const Point_3 & | query, |
| OutputIterator | oi | ||
| ) |
computes 3D Wachspress coordinates with respect to a closed convex triangle mesh.
This function fills oi with 3D Wachspress coordinates computed at the query point with respect to the vertices of the input polyhedron.
The number of returned coordinates equals the number of vertices of tmesh.
After the coordinates \(b_i\) with \(i = 0\dots n-1\) are computed, where \(n\) is the number of vertices, the query point \(q\) can be obtained as \(q = \sum_{i = 0}^{n-1}b_ip_i\), where \(p_i\) are the polyhedron vertices.
| OutputIterator | a model of OutputIterator that accepts values of type FT |
| query | a query point |
| oi | the beginning of the destination range with the computed coordinates |