CGAL 6.2 - 3D Generalized Barycentric Coordinates

Loading...
Searching...
No Matches
List of all members
CGAL::Barycentric_coordinates::Discrete_harmonic_coordinates_3< TriangleMesh, VertexPointMap, GeomTraits > Class Template Reference
3D Generalized Barycentric Coordinates Reference » Analytic Coordinates

`#include <CGAL/Barycentric_coordinates_3/Discrete_harmonic_coordinates_3.h>`

## Definition

template<typename TriangleMesh, typename VertexPointMap = typename boost::property_map<TriangleMesh, CGAL::vertex_point_t>::const_type, typename GeomTraits = typename Kernel_traits<typename boost::property_traits<VertexPointMap>::value_type>::Kernel>
class CGAL::Barycentric_coordinates::Discrete_harmonic_coordinates_3< TriangleMesh, VertexPointMap, GeomTraits >

computes 3D discrete harmonic coordinates with respect to a closed convex triangle mesh.

This class implements 3D discrete harmonic coordinates [2], 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.

Template Parameters

  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
| Discrete_harmonic_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 discrete harmonic coordinates with respect to a closed convex triangle mesh.

## Constructor & Destructor Documentation

## ◆ Discrete_harmonic_coordinates_3()

template<typename TriangleMesh , typename VertexPointMap = typename boost::property_map<TriangleMesh, CGAL::vertex_point_t>::const_type, typename GeomTraits = typename Kernel_traits<typename boost::property_traits<VertexPointMap>::value_type>::Kernel>

CGAL::Barycentric_coordinates::Discrete_harmonic_coordinates_3< TriangleMesh, VertexPointMap, GeomTraits >::Discrete_harmonic_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 discrete harmonic coordinates for 3D query points.

Parameters

  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

Precondition
  num_vertices(`tmesh`) >= 4.
  CGAL::is_triangle_mesh(`tmesh`).
  CGAL::is_closed(`tmesh`).
  CGAL::is_strongly_convex_3(`tmesh`).

## Member Function Documentation

## ◆ operator()()

template<typename TriangleMesh , typename VertexPointMap = typename boost::property_map<TriangleMesh, CGAL::vertex_point_t>::const_type, typename GeomTraits = typename Kernel_traits<typename boost::property_traits<VertexPointMap>::value_type>::Kernel>
template<typename OutputIterator >

OutputIterator CGAL::Barycentric_coordinates::Discrete_harmonic_coordinates_3< TriangleMesh, VertexPointMap, GeomTraits >::operator() | ( | const Point_3 & | query,
|  | OutputIterator | oi
| ) |  |

computes 3D discrete harmonic coordinates with respect to a closed convex triangle mesh.

This function fills `oi` 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 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.

Template Parameters

  OutputIterator | a model of `OutputIterator` that accepts values of type `FT`

Parameters

  query | a query point
  oi | the beginning of the destination range with the computed coordinates

Returns
  an output iterator to the element in the destination range, one past the last coordinate stored