Minor changes.

Some minor changes in the documentation.
This commit is contained in:
Dmitry Anisimov 2014-02-21 14:44:35 +01:00
parent 168def688e
commit 3b4b854fdd
3 changed files with 32 additions and 29 deletions

View File

@ -7,7 +7,7 @@ namespace CGAL {
\anchor chapterGeneralizedBarycentricCoordinates
\cgalAutoToc
\authors Dmitry Anisimov, David Bommes, Kai Hormann, and Pierre Alliez.
\authors Dmitry Anisimov, David Bommes, Kai Hormann, and Pierre Alliez
\section gbc_introduction Introduction
@ -31,7 +31,7 @@ The main entry point to the component is the class with a name of the required c
\subsection gbc_int_hierarchy Hierarchy of the classes
This package consists of three main and thirteen derived classes. The main classes are
This package consists of three main and eight derived classes. The main classes are
- `Barycentric_coordinates::Segment_coordinates_2`,
- `Barycentric_coordinates::Triangle_coordinates_2`, and
@ -60,7 +60,7 @@ Since all the closed-form generalized barycentric coordinates are normalized wei
- `Barycentric_coordinates::Barycentric_coordinates_base_2::compute_weights()`.
Note that `Segment_coordinates_2` and `Triangle_coordinates_2` classes do not have this function.
Note that `CGAL::Barycentric_coordinates::Segment_coordinates_2` and `CGAL::Barycentric_coordinates::Triangle_coordinates_2` classes do not have this function.
\subsection gbc_int_compute_bases Computation of the basis functions
@ -68,7 +68,7 @@ In order to compute basis functions you have to use
- `Barycentric_coordinates::Barycentric_coordinates_base_2::compute()`.
The naive call of this function with a provided query point as an input computes the barycentric coordinates of a chosen type at the query point with respect to all the vertices of the polygon. During the running time of the function some interior tests are performed in order to make the computation as much as possible precise. However, if the user knows in advance the exact query point's location, meaning, he can distinguish between a strictly interior point, a point on the edge, a point at the vertex, or a strictly exterior point, he can use this information as an additional parameter to the function to accelerate the computation. This parameter is called `query_point_location`, and it is of the type `Barycentric_coordinates::Query_point_location`, which can be one of the following constants
A naive call of this function with a provided query point as an input computes barycentric coordinates of a chosen type at the query point with respect to all the vertices of the polygon. During the running time of the function some interior tests are performed in order to make the computation as much as possible precise. However, if the user knows in advance the exact query point's location, meaning, he can distinguish between a strictly interior point, a point on the edge, a point at the vertex, or a strictly exterior point, he can use this information as an additional parameter to the function to accelerate the computation. This parameter is called `query_point_location`, and it is of the type `Barycentric_coordinates::Query_point_location`, which can be one of the following constants
- `Barycentric_coordinates::UNSPECIFIED_LOCATION` - the default constant;
- `Barycentric_coordinates::AT_VERTEX` - if a query point is at one of the polygon's vertices;
@ -90,17 +90,17 @@ Note, that function `compute()` from `Segment_coordinates_2` and `Triangle_coord
\subsection gbc_int_output Output
Output of the computation is a set of coordinate values at the current query point with respect to all the vertices of the polygon, and it can be stored in an arbitrary container providing an appropriate output iterator. More information about output can be found in the \ref gbc_implementation section.
Output of the computation is a set of coordinate values at the current query point with respect to all the vertices of the polygon, and it can be stored in an arbitrary container providing an appropriate output iterator. We also return pointer to the last stored element and status of the computation (boolian true or false). More information about output can be found in the \ref gbc_implementation section.
\subsection gbc_int_advance Other functions
Some additional functions are implemented to give the user more information about coordinates
Some additional functions are implemented in order to give the user more information about coordinates
- `Barycentric_coordinates::Segment_coordinates_2::print_info()` - returns some information about current segment and Segment coordinates' behaviour;
- `Barycentric_coordinates::Triangle_coordinates_2::print_info()` - returns some information about current triangle and Triangle coordinates' behaviour;
- `Barycentric_coordinates::Barycentric_coordinates_base_2::print_info()` - returns some information about current polygon and coordinates' behaviour for this type of polygons.
`Seg_coordinates_2` and `Tri_coordinates_2` classes also provide the following static functions
`CGAL::Barycentric_coordinates::Seg_coordinates_2` and `CGAL::Barycentric_coordinates::Tri_coordinates_2` classes also provide the following static functions
- `Barycentric_coordinates::Seg_coordinates_2::Compute()` - this function takes a segment and a query point and returns a `CGAL::Point_2` type of coordinates;
- `Barycentric_coordinates::Tri_coordinates_2::Compute()` - this function takes a triangle and a query point and returns a `CGAL::Point_3` type of coordinates.
@ -123,7 +123,7 @@ Example's point pattern.
\cgalExample{Barycentric_coordinates_2/Discrete_harmonic_coordinates_example.cpp}
\subsection mv_example Mean Value coordinates example
This is an example that shows how to compute Mean Value coordinates for a set of <kbd style="color:#00CC00">green points</kbd> in the star-shaped polygon. We note that this type of coordinates is well-defined for such a concave polygon while Wachspress and Discrete Harmonic coordinates are not. However, it may give negative values for all the points outside <kbd style="color:#CC0000">the kernel</kbd>. We use inexact kernel, <a href="http://en.cppreference.com/w/cpp/container/deque">`std::deque`</a> container, and <a href="http://en.cppreference.com/w/cpp/iterator/front_insert_iterator">std::front_insert_iterator</a> to compute and store the resulting coordinate values.
This is an example that shows how to compute Mean Value coordinates for a set of <kbd style="color:#00CC00">green points</kbd> in the star-shaped polygon. We note that this type of coordinates is well-defined for such a concave polygon while Wachspress and Discrete Harmonic coordinates are not. However, it may give negative values for all the points outside <kbd style="color:#CC0000">the kernel</kbd>. We use inexact data type, <a href="http://en.cppreference.com/w/cpp/container/deque">`std::deque`</a> container, and <a href="http://en.cppreference.com/w/cpp/iterator/front_insert_iterator">std::front_insert_iterator</a> to compute and store the resulting coordinate values.
\anchor mv_coord_example
\cgalFigureBegin{mv__example,mean_value_coordinates_example.png}
@ -184,7 +184,7 @@ To compute Wachspress weights we follow \cite cgal:bc:fhk-gcbcocp-06 and use the
with \f$i = 1\dots n\f$ where \f$n\f$ - is number of polygon's vertices. In order to compute coordinates, we normalize these weights as follows
<center>\f$b_i = \frac{w_i}{W}\f$ with \f$W = \sum_{j=1}^n w_j.\f$</center>
<center>\f$b_i = \frac{w_i}{W^{wp}}\f$ with \f$W^{wp} = \sum_{j=1}^n w_j.\f$</center>
This formula becomes unstable when approaching to the boundary of the polygon (\f$\approx 1.0e-10\f$ and closer). To fix the problem we modify weights \f$w_i\f$ as it is shown below
@ -192,10 +192,10 @@ This formula becomes unstable when approaching to the boundary of the polygon (\
This gives us the precise algorithm to compute Wachspress coordinates but with \f$O(n^2)\f$ performance only. The fast \f$O(n)\f$ algorithm uses the standard weights \f$w_i\f$.
It is known that for strictly convex polygons the denominator's zero set of the Wachspress coordinates (\f$W = 0~\f$) is a curve, which (in many cases) lies quite far away from the polygon. Speaking precisely, it goes through the intersection points of the continuations of the polygon's edges. Therefore, computation of Wachspress coordinates outside the polygon is possible only at points that do not belong to this curve.
It is known that for strictly convex polygons the denominator's zero set of the Wachspress coordinates (\f$W^{wp} = 0~\f$) is a curve, which (in many cases) lies quite far away from the polygon. Speaking precisely, it goes through the intersection points of the continuations of the polygon's edges. Therefore, computation of Wachspress coordinates outside the polygon is possible only at points that do not belong to this curve.
\cgalFigureBegin{zero__set,zero_set.png}
<em style="color:#800000">Zero set</em> of the Wachspress coordinates' denominator \f$W\f$ for the non-regular hexagon.
<em style="color:#800000">Zero set</em> of the Wachspress coordinates' denominator \f$W^{wp}\f$ for the non-regular hexagon.
\cgalFigureEnd
\b Warning: We do not recommend to use Wachspress coordinates with exterior points!
@ -214,7 +214,7 @@ To compute Discrete Harmonic weights we follow \cite cgal:bc:fhk-gcbcocp-06 and
with \f$i = 1\dots n\f$ where \f$n\f$ - is number of polygon's vertices. In order to compute coordinates, we normalize these weights as follows
<center>\f$b_i = \frac{w_i}{W}\f$ with \f$W = \sum_{j=1}^n w_j.\f$</center>
<center>\f$b_i = \frac{w_i}{W^{dh}}\f$ with \f$W^{dh} = \sum_{j=1}^n w_j.\f$</center>
This formula becomes unstable when approaching to the boundary of the polygon (\f$\approx 1.0e-10\f$ and closer). To fix the problem, similarly to the previous subsection, we modify weights \f$w_i\f$ as it is shown below
@ -222,7 +222,7 @@ This formula becomes unstable when approaching to the boundary of the polygon (\
This gives us the precise algorithm to compute Discrete Harmonic coordinates but with \f$O(n^2)\f$ performance only. The fast \f$O(n)\f$ algorithm uses the standard weights \f$w_i\f$.
\b Warning: As for Wachspress coordinates, we do not recommend to use Discrete Harmonic coordinates with exterior points because the curve \f$W = 0\f$ may have several components, and one of them always goes through the polygon's vertices. However, if you are sure that your point does not belong to this curve, you can use them as in \ref dh_example.
\b Warning: As for Wachspress coordinates, we do not recommend to use Discrete Harmonic coordinates with exterior points because the curve \f$W^{dh} = 0\f$ may have several components, and one of them always goes through the polygon's vertices. However, if you are sure that your point does not belong to this curve, you can use them as in \ref dh_example.
\subsection gbc_deg_mean_value_coordinates Mean Value coordinates
@ -232,11 +232,11 @@ Unlike all the previous coordinates, Mean Value functions cannot be computed exa
Notations for Mean Value coordinates.
\cgalFigureEnd
For these coordinate functions we also have two algorithms: one is precise and one is fast. The first one works everywhere in the plane, and the resulting precision of computation depends only on the chosen data type. However, its limit is standard double type which is used internally to compute the square root. The algorithm is based on the following formula from \cite cgal:bc:f-wmvc-14
For these coordinate functions we also have two algorithms: one is precise and one is fast. The first one works everywhere in the plane, and the resulting precision of computation depends only on the chosen data type. However, its limit is standard double type which is used internally to compute the square root. This algorithm is based on the following weight formula from \cite cgal:bc:f-wmvc-14
<center>\f$w_i = \sigma_i\bar{w}_i\f$ with \f$\bar{w}_i = (r_{i-1}r_{i+1}-d_{i-1}d_{i+1})^{1/2}\prod_{j\not= i-1,i}(r_jr_{j+1} + d_jd_{j+1})^{1/2}\f$ where \f$r_i = \|d_i\|.\f$</center>
Since \f$\bar{w}_i\f$ is always positive, we have to append to it the proper sign \f$\sigma_i\f$ of the signed Mean Value weight function, which can be found fast and efficiently. After normalization of these weights we obtain \f$0(n^2)\f$ precise algorithm. The fast \f$O(n)\f$ algorithm uses the pseudo code from <a href="http://www.inf.usi.ch/hormann/nsfworkshop/presentations/Hormann.pdf">here</a>. To compute weights \f$w_i\f$ without normalization we use formulas from the same pseudo code. Note, that they are getting unstable if a query point is \f$1.0e-10\f$ away or closer to the polygon's boundary similarly to Wachspress and Discrete Harmonic coordinates.
Since \f$\bar{w}_i\f$ is always positive, we have to append to it the proper sign \f$\sigma_i\f$ of the signed Mean Value weight function, which can be found fast and efficiently. After normalization of these weights we obtain \f$0(n^2)\f$ precise algorithm. The fast \f$O(n)\f$ algorithm uses the pseudo code from <a href="http://www.inf.usi.ch/hormann/nsfworkshop/presentations/Hormann.pdf">here</a>. To compute weights \f$w_i\f$ without normalization we use formulas from the same pseudo code. Note, that they are getting unstable if a query point is \f$\approx 1.0e-10\f$ away or closer to the polygon's boundary similarly to Wachspress and Discrete Harmonic coordinates.
\section Performances
@ -246,7 +246,7 @@ The structure of the speed test that we run for all the functions consists of co
\cgalExample{Barycentric_coordinates_2/Triangle_coordinates_speed_test.cpp}
The time to compute coordinates depends on many factors such that memory allocation, input kernel, output container, number of points, and so on. In our tests we have tried to use the most standard C++ and CGAL features with minimum memory allocation. Therefore, the final time presented is average time that you can get without deep optimization but still with efficient memory allocation. It also means that it may vary depending on the usage.
The time to compute coordinates depends on many factors such that memory allocation, input kernel, output container, number of points, and so on. In our tests we have tried to use the most standard C++ and CGAL features with minimum memory allocation. Therefore, the final time presented is average time that you can get without deep optimization but still with efficient memory allocation. It also means that it may vary depending on the usage of the package.
The machine that has been used in all the tests is MacBook Pro 2011 with 2 GHz Intel Core i7 processor and 2 cores, 8 GB 1333 MHz DDR3 memory, and AMD Radeon HD 6490M 256 MB graphics card. The installed operating system is OS X 10.9 Maverick. In order to compile the speed test suit we used Clang 5.0 64bit compiler. The resulting time can be found in the table below.
@ -408,15 +408,15 @@ The machine that has been used in all the tests is MacBook Pro 2011 with 2 GHz I
\section gbc_implementation Implementation details
\subsection gbc_impl_design Design
The generic design of the package was developed in 2013 by Dmitry Anisimov and David Bommes with many useful comments of Kai Hormann and Pierre Alliez. The package consists of \ref gbc_interface "7 headers, 16 classes, 3 enumerations, and one namespace". The input data structures are `CGAL::Polygon_2`, `CGAL::Triangle_2`, and `CGAL::Segment_2`. Appropriate iterators are used to provide an efficient access to the chosen data structures and send these data to one of the generic algorithms to compute coordinates. Once instantiated for a polygon (triangle, segment), the coordinate function can be computed multiple times for different query points with respect to all the vertices of the provided polygon (triangle, segment). All the classes are fully templated and have simple and similar design. For example, if the function to compute coordinates within one class is named `compute()`, it has the same name within all other classes. Yet, the number of functions can differ from one class to another.
The generic design of the package was developed in 2013 by Dmitry Anisimov and David Bommes with many useful comments of Kai Hormann and Pierre Alliez. The package consists of \ref gbc_interface "7 headers, 11 classes, 3 enumerations, and one namespace". The input data structures are `CGAL::Polygon_2`, `CGAL::Triangle_2`, and `CGAL::Segment_2`. Appropriate iterators are used to provide an efficient access to the chosen data structures and send these data to one of the generic algorithms to compute coordinates. Once instantiated for a polygon (triangle, segment), the coordinate function can be computed multiple times for different query points with respect to all the vertices of the provided polygon (triangle, segment). All the classes are fully templated and have simple and similar design. For example, if the function to compute coordinates within one class is named `compute()`, it has the same name within all other classes. Yet, the number of functions can differ from one class to another.
Implemented algorithms to compute coordinates do not depend on a particular kernel, and all the coordinate functions can be computed exactly if an exact kernel is used apart the Mean Value coordinates. The latter coordinates, unfortunately, involve the square root operation, which results in a slightly worse precision with exact data types due to temporal converting into a floating point type. The computed coordinates can be stored in an arbitrary container if an appropriate <a href="http://en.cppreference.com/w/cpp/concept/Iterator">output iterator</a> has been provided.
Implemented algorithms to compute coordinates do not depend on a particular kernel, and all the coordinate functions can be computed exactly, if an exact kernel is used, apart Mean Value coordinates. The latter coordinates, unfortunately, involve the square root operation, which results in a slightly worse precision with exact data types due to temporal converting into a floating point type. The computed coordinates can be stored in an arbitrary container if an appropriate <a href="http://en.cppreference.com/w/cpp/concept/Iterator">output iterator</a> has been provided.
It is worth noting that `CGAL::Barycentric_coordinates::Segment_coordinates_2` are used to compute generalized barycentric coordinates along the polygon's boundary. Hence, one might use a trick for Segment coordinates from \ref gbc_degeneracies section if he/she is convinced that a point must lie exactly on the polygon's boundary but due to some numerical instabilities it is not there.
\subsection gbc_impl_extendability Extendability
We have implemented this package in a way that later on, if needed, other 2-dimensional generalized types of barycentric coordinates can be easily added as subclasses to our base class `CGAL::Barycentric_coordinates::Barycentric_coordinates_base_2`. To do so, you have to simply inherit your class from our base class and overload six virtual functions: `weights()`, `coordinates_on_bounded_side_precise()`, `coordinates_on_bounded_side_fast()`, `coordinates_on_unbounded_side_precise()`, `coordinates_on_unbounded_side_fast()`, and `print_coordinates_info()`. If you want to add a class for generalized barycentric coordinates in a higher dimension d > 2, you can overload our two-dimensional base class with a type of the required d-polytope and inherit from it your d-dimensional coordinates.
We have implemented this package in a way that later on, if needed, other 2-dimensional generalized types of barycentric coordinates can be easily added as subclasses to our base class `CGAL::Barycentric_coordinates::Barycentric_coordinates_base_2`. To do so, Jenny has to simply inherit her class from our base class and overload six virtual functions: `weights()`, `coordinates_on_bounded_side_precise()`, `coordinates_on_bounded_side_fast()`, `coordinates_on_unbounded_side_precise()`, `coordinates_on_unbounded_side_fast()`, and `print_coordinates_info()`. If she wants to add a class for generalized barycentric coordinates in a higher dimension d > 2, she can overload our two-dimensional base class with a type of the required d-polytope and inherit from it her d-dimensional coordinate class.
\subsection gbc_impl_algorithms Algorithms
The algorithms to compute coordinates are mainly inspired by the papers \cite cgal:bc:fhk-gcbcocp-06, \cite cgal:bc:f-wmvc-14, and \cite cgal:bc:hf-mvcapp-06 but do not follow exactly the pseudo-codes given there. Many new features are added in order to be more efficient, faster, and handle special cases described in the \ref gbc_degeneracies section.
@ -504,13 +504,13 @@ In 1827 famous German mathematician and theoretical astronomer <a href="http://e
Triangle barycentric coordinates have many important properties including \em constant and <em>linear precision</em>, <em>Lagrange property</em>, and <em>positivity inside a triangle</em>. These properties make these coordinates a unique tool in many scientific fields. If we restrict Triangle coordinates to one of its edges and supporting its line, we get barycentric coordinates with respect to a segment. We call these coordinates \ref gbc_deg_segment_coordinates "Segment coordinates" and compute them in a way explained in the previous sections.
Let us show a couple of plots with coordinates described above. To plot Segment coordinates we take a line \f$y = 0.4\f$ and define \ref seg_coord_example "a segment" \f$[v_0, v_1]\f$ on this line. Then we sample this segment and compute Segment coordinates for all the sample points. If we plot the Segment coordinate function at all the defined points with respect to \f$v_1\f$, we get the blue line depicted in the figure below. It grows from zero at \f$v_0\f$ to one at \f$v_1\f$.
Let us show a couple of plots with coordinates described above. To plot Segment coordinates we take a line \f$y = 0.4\f$ and define \ref fig__seg__example "a segment" \f$[v_0, v_1]\f$ on this line. Then we sample this segment and compute Segment coordinates for all the sample points. If we plot the Segment coordinate function at all the defined points with respect to \f$v_1\f$, we get the blue line depicted in the figure below. It grows from zero at \f$v_0\f$ to one at \f$v_1\f$.
\cgalFigureBegin{seg__coord__interp,seg__coord__interp.png}
<kbd style="color:blue">Segment coordinates</kbd> for all the <kbd style="color:#800000">segment points</kbd> with respect to \f$v_1 = (2.0,\ 0.4)\f$.
\cgalFigureEnd
If we want to plot Triangle coordinates, we follow a quite similar approach. We take \ref tri_coord_example "a triangle" \f$[v_0, v_1, v_2]\f$ in the plane and sample its interior and boundary with a number of points. Once we have this sampling, we plot Triangle coordinate function at all the defined sample points with respect to the third vertex of the triangle. The same way we can plot it for the first and second vertices. The plotted function appear to be a linear function (shown in the figure below) which grows from zero along the first edge \f$[v_0, v_1]\f$ to one at the chosen vertex \f$v_2\f$.
If we want to plot Triangle coordinates, we follow a quite similar approach. We take \ref fig__tri__example "a triangle" \f$[v_0, v_1, v_2]\f$ in the plane and sample its interior and boundary with a number of points. Once we have this sampling, we plot Triangle coordinate function at all the defined sample points with respect to the third vertex of the triangle. The same way we can plot it for the first and second vertices. The plotted function appear to be a linear function (shown in the figure below) which grows from zero along the first edge \f$[v_0, v_1]\f$ to one at the chosen vertex \f$v_2\f$.
\cgalFigureBegin{tri__coord__interp,tri__coord__interp.png}
Triangle coordinates with respect to \f$v_2 = (1.0,\ 2.0)\f$. The colour bar indicates the range of values for the chosen coordinate function.
@ -518,26 +518,26 @@ Triangle coordinates with respect to \f$v_2 = (1.0,\ 2.0)\f$. The colour bar ind
Since many applications require more difficult planar geometric shapes, to work with, than segment and triangle, it seems to us natural an investigation of a generalized version of Triangle coordinates with respect to an arbitrary polygon. The first attempt was taken in 1975 by E. L. Wachspress \cite cgal:bc:w-rfeb-75 and the resulting generalized barycentric coordinates have been called Wachspress coordinates \cite cgal:bc:mlbd-gbcip-02. These coordinates are defined for an arbitrary <em>strictly convex</em> polygon and have all the properties of Triangle coordinates \cite cgal:bc:fhk-gcbcocp-06. Unfortunately, they are not defined for weakly convex and concave polygons and break down in this setting.
Analogously to the previous cases we want to plot the Wachspress coordinate function and see how it looks like. Let us choose a \ref wp_example "unit square" \f$[v_0, \dots, v_3]\f$ as our strictly convex polygon, sample its interior and boundary as before, and plot the coordinate function with respect to its third vertex at all the defined sample points. We see that what we get is a smooth function which is linear along the boundary and grows from zero to one, as the colour bar indicates.
Analogously to the previous cases we want to plot the Wachspress coordinate function and see how it looks like. Let us choose a \ref fig__dh__example "unit square" \f$[v_0, \dots, v_3]\f$ as our strictly convex polygon, sample its interior and boundary as before, and plot the coordinate function with respect to its third vertex at all the defined sample points. We see that what we get is a smooth function which is linear along edges and grows from zero to one, as the colour bar indicates.
\anchor wp_plot
\cgalFigureBegin{wp__coord__interp,wp__coord__interp.png}
Wachspress coordinates with respect to \f$v_2 = (1.0,\ 1.0)\f$. The colour bar indicates the range of values for the chosen coordinate function.
\cgalFigureEnd
Another type of generalized barycentric coordinates proposed by Pinkall and Polthier in 1993 \cite cgal:pp-cdmsc-93 and by Eck et al. in 1995 \cite cgal:bc:eddhls-maam-95 in the context of a \ref chapsurface_mesh_parameterization "triangle mesh parameterization" is called Discrete Harmonic coordinates. These coordinates are defined, similar to the Wachspress approach, for an arbitrary <em>strictly convex</em> polygon and inherit all the properties of Triangle coordinates <em>apart the positivity inside a polygon</em> because they can be negative in some regions of some irregular polygons. Another interesting property of these coordinate functions is that they coincide with Wachspress coordinates for any polygon whose vertices lie on a circle.
Another type of generalized barycentric coordinates proposed by Pinkall and Polthier in 1993 \cite cgal:pp-cdmsc-93 and by Eck et al. in 1995 \cite cgal:bc:eddhls-maam-95 in the context of a \ref chapsurface_mesh_parameterization "triangle mesh parameterization" is called Discrete Harmonic coordinates. These coordinates are defined, similarly to the Wachspress approach, for an arbitrary <em>strictly convex</em> polygon and inherit all the properties of Triangle coordinates <em>apart the positivity inside a polygon</em> because they can be negative in some regions of some irregular polygons. Another interesting property of these coordinate functions is that they coincide with Wachspress coordinates for any polygon whose vertices lie on a circle.
To plot Discrete Harmonic coordinates we take \ref dh_coord_example "the unit square" \f$[v_0, \dots, v_3]\f$ used with Wachspress coordinates and plot the function with respect to the same vertex \f$v_2\f$. Since a unit square is a regular polygon that is its vertices lie on a circle, we get the plot identical to the \ref wp_plot "Wachspress one".
To plot Discrete Harmonic coordinates we take \ref fig__dh__example "the unit square" \f$[v_0, \dots, v_3]\f$ used with Wachspress coordinates and plot the function with respect to the same vertex \f$v_2\f$. Since a unit square is a regular polygon that is its vertices lie on a circle, we get the plot identical to the \ref wp_plot "Wachspress one".
The last type of generalized barycentric coordinates, we want to discuss, is Mean Value coordinates \cite cgal:f-mvc-03 proposed by M. Floater in 2003. Based on the <a href="http://en.wikipedia.org/wiki/Mean_value_theorem" target=blanc>Mean Value theorem</a> these coordinates, unlike Wachspress and Discrete Harmonic ones, are defined for an arbitrary <em>simple polygon</em>, inherit all the properties of Triangle coordinates for any convex polygon, and <em>lack the only positivity property for some concave ones</em>. It is proven by Hormann and Floater that these coordinates are positive only inside the kernel of a star-shaped polygon \cite cgal:bc:hf-mvcapp-06. The same as for Discrete Harmonic coordinates, Mean Value weights are often used in the context of a \ref chapsurface_mesh_parameterization "triangle mesh parameterization."
The last type of generalized barycentric coordinates, we want to discuss, is Mean Value coordinates \cite cgal:f-mvc-03 proposed by M. Floater in 2003. Based on the <a href="http://en.wikipedia.org/wiki/Mean_value_theorem" target=blanc>Mean Value theorem</a> these coordinates, unlike Wachspress and Discrete Harmonic ones, are defined for an arbitrary <em>simple polygon</em>, inherit all the properties of Triangle coordinates for any convex polygon, and <em>lack the only positivity property for some concave ones</em>. It is proven by Hormann and Floater that these coordinates are positive only inside the kernel of a star-shaped polygon \cite cgal:bc:hf-mvcapp-06. The same as for Discrete Harmonic weights, Mean Value weights are often used in the context of a \ref chapsurface_mesh_parameterization "triangle mesh parameterization."
In order to show the particular behaviour of Mean Value coordinates with an application to concave polygons, we take \ref mv_coord_example "a star-shaped polygon" with ten vertices \f$[v_0, \dots, v_9]\f$, sample its interior and boundary, and plot the coordinate function with respect to the eighth vertex \f$v_7\f$. As the colour bar indicates, the obtained function grows from a slightly negative value to one at the chosen vertex. It is also smooth and linear along edges.
In order to show the particular behaviour of Mean Value coordinates with an application to concave polygons, we take \ref fig__mv__example "a star-shaped polygon" with ten vertices \f$[v_0, \dots, v_9]\f$, sample its interior and boundary, and plot the coordinate function with respect to the eighth vertex \f$v_7\f$. As the colour bar indicates, the obtained function grows from a slightly negative value to one at the chosen vertex. It is also smooth and linear along edges.
\cgalFigureBegin{mv__coord__interp,mv__coord__interp.png}
Mean Value coordinates with respect to \f$v_7\f$. The colour bar indicates the range of values for the chosen coordinate function.
\cgalFigureEnd
\b Family: All the coordinates discussed in this section and implemented in the package come from one and the same family of generalized barycentric coordinates named <em>3-Point Family of Coordinates</em> \cite cgal:bc:fhk-gcbcocp-06.
<b>Interesting fact</b>: All the coordinates discussed in this section and implemented in the package come from one and the same family of generalized barycentric coordinates named <em>3-Point Family of Coordinates</em> \cite cgal:bc:fhk-gcbcocp-06.
\section gbc_acknowledgments Acknowledgments
The authors wish to thank <a href="http://www.inf.usi.ch/phd/schneider/">Teseo Schneider</a> and <a href="http://search.usi.ch/people/5ae37d3d990b431a02b95b0b606da2e6/Schaerfig-Randolf">Randolf Schaerfig</a> for helpful comments and discussions.

View File

@ -4,4 +4,5 @@ Kernel_23
Interpolation
Convex_hull_2
Random_numbers
Algebraic_foundations
Surface_mesh_parameterization

View File

@ -1,3 +1,5 @@
1. To make the code parallel. Get iteration number from the thread. Add parallel class to each type of the coordinate functions. Use begin() + offset. Resize vector. Parallel class takes as parameters list of points and polygon. Use random access iterator.
1. To make the code parallel. Get iteration number from the thread. Add parallel class to each type of the coordinate functions. Use begin() + offset. Resize vector. Parallel class takes as parameters list of points and polygon. Use random access iterator. - Done but we have problems with it.
2. Ask developer list about template + virtual problem.
2. Ask developer list about template + virtual problem.
3. Add hard tests with epsilon distance away from the polygons boundary, which we have discussed during our first group meeting, to current test suit.