diff --git a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt index db43b5dbda4..be72d546670 100755 --- a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt +++ b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt @@ -248,7 +248,7 @@ Since \f$\bar{w}_i\f$ is always positive, we have to append to it the proper sig \section Performances -Apart the most important requirement on barycentric coordinates to be as much as possible precise, it is very important for them to be as fast as possible to evaluate. These coordinate functions are used in many applications where they must be computed for millions of points and, thus, the real time usage of coordinates is crucial. When writing the code, we tried to fulfill this important requirement, and in this section we present the reader a few results about the computational time of the implemented coordinate functions. +Apart the most important requirement on barycentric coordinates to be as much as possible precise, it is very important for them to be as fast as possible to evaluate. These coordinate functions are used in many applications where they must be computed for millions of points and, thus, the real time usage of coordinates is crucial. When writing the code, we tried to fulfil this important requirement, and in this section we present the reader a few results about the computational time of the implemented coordinate functions. The structure of the speed test that we run for all the functions consists of computing coordinate (or weight) values at \f$10^6-10^9\f$ strictly interior points with respect to some polygon (triangle or segment). At each iteration of the loop we create a query point, pass it to the function, and compute all the related coordinates. We run this loop 10 times in a row, and the time presented in the Table 1 is the arithmetic mean of all the trials. A typical example of the performed test for Triangle coordinates can be found below. This example also shows how to construct your own iterator and pass it to our class. In our example we create an iterator that writes coordinate values for each new query point over coordinate values of the previous point in the fixed-size standard C++ array, so that memory is allocated only once. @@ -431,7 +431,7 @@ The machine that has been used in all the tests is MacBook Pro 2011 with 2 GHz I Table 1 -

+
\section gbc_implementation Implementation details @@ -524,7 +524,7 @@ Some statistics about current implementation of the package can be found in the Table 2 -

+
\section gbc_theory Theory of 2D generalized barycentric coordinates @@ -546,7 +546,7 @@ 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 strictly convex 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_coord_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 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. \anchor wp_plot \cgalFigureBegin{wp__coord__interp,wp__coord__interp.png} @@ -559,7 +559,7 @@ To plot the Discrete Harmonic coordinates we take \ref dh_coord_example "the uni 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 Mean Value theorem these coordinates, unlike Wachspress and Discrete Harmonic ones, are defined for an arbitrary simple polygon, inherit all the properties of Triangle coordinates for any convex polygon, and lack the only positivity property for some concave ones. 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." -In order to show the particular behavior 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 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. \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. diff --git a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/PackageDescription.txt b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/PackageDescription.txt index 0ed2ffb00d3..3ad847b7eae 100644 --- a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/PackageDescription.txt +++ b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/PackageDescription.txt @@ -5,7 +5,7 @@ \cgalPkgDescriptionBegin{2D Generalized Barycentric Coordinates, PkgBarycentric_coordinates_2Summary} \cgalPkgPicture{barcoord_thumb.png} \cgalPkgSummaryBegin -\cgalPkgAuthors{Anisimov Dmitry, David Bommes, Kai Hormann, and Pierre Alliez} +\cgalPkgAuthors{Dmitry Anisimov, David Bommes, Kai Hormann, and Pierre Alliez} \cgalPkgDesc{2D Generalized Barycentric Coordinates package offers three different types of closed-form generalized barycentric coordinates defined for some sets of simple polygons. In particular, it includes an implementation of Wachspress, Mean Value, and Discrete Harmonic coordinates together with special cases for triangles and segments.} \cgalPkgManuals{Chapter_2D_Generalized_Barycentric_Coordinates, PkgBarycentric_coordinates_2} \cgalPkgSummaryEnd diff --git a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_speed_test_with_many_vertices.cpp b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_speed_test_with_many_vertices.cpp index d0854b96dc8..03aadcb57fe 100644 --- a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_speed_test_with_many_vertices.cpp +++ b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_speed_test_with_many_vertices.cpp @@ -1,3 +1,4 @@ +// Author(s) : Dmitry Anisimov. // We test speed of Discrete Harmonic coordinates on a set of automatically generated // points inside a convex polygon with 16 vertices. We use inexact kernel. diff --git a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_weights_speed_test_with_many_vertices.cpp b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_weights_speed_test_with_many_vertices.cpp index 0ec5ce227a0..564463303c1 100644 --- a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_weights_speed_test_with_many_vertices.cpp +++ b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Discrete_harmonic_coordinates/DH_weights_speed_test_with_many_vertices.cpp @@ -1,3 +1,4 @@ +// Author(s) : Dmitry Anisimov. // We test speed of Discrete Harmonic weights on a set of automatically generated // points inside a convex polygon with 16 vertices. We use inexact kernel. diff --git a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_34_vertices.cpp b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_34_vertices.cpp index 1f92e6ffaff..b6513a40df2 100644 --- a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_34_vertices.cpp +++ b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_34_vertices.cpp @@ -1,3 +1,4 @@ +// Author(s) : Dmitry Anisimov. // We test speed of Mean Value coordinates on a set of automatically generated // points inside a concave polygon with 34 vertices. We use inexact kernel. diff --git a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_many_vertices.cpp b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_many_vertices.cpp index 16728e62503..0466f542181 100644 --- a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_many_vertices.cpp +++ b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_speed_test_with_many_vertices.cpp @@ -1,3 +1,4 @@ +// Author(s) : Dmitry Anisimov. // We test speed of Mean Value coordinates on a set of automatically generated // points inside a convex polygon with 16 vertices. We use inexact kernel. diff --git a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_34_vertices.cpp b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_34_vertices.cpp index 3e4c0428cc5..c04d31b0754 100644 --- a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_34_vertices.cpp +++ b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_34_vertices.cpp @@ -1,3 +1,4 @@ +// Author(s) : Dmitry Anisimov. // We test speed of Mean Value weights on a set of automatically generated // points inside a concave polygon with 34 vertices. We use inexact kernel. diff --git a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_many_vertices.cpp b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_many_vertices.cpp index 4452ca1e3a8..e52e9f70d9c 100644 --- a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_many_vertices.cpp +++ b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Mean_value_coordinates/MV_weights_speed_test_with_many_vertices.cpp @@ -1,3 +1,4 @@ +// Author(s) : Dmitry Anisimov. // We test speed of Mean Value weights on a set of automatically generated // points inside a convex polygon with 16 vertices. We use inexact kernel. diff --git a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_with_many_vertices.cpp b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_with_many_vertices.cpp index 82b15fb45a2..8410b0614a8 100644 --- a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_with_many_vertices.cpp +++ b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Wachspress_coordinates/WP_speed_test_with_many_vertices.cpp @@ -1,3 +1,4 @@ +// Author(s) : Dmitry Anisimov. // We test speed of Wachspress coordinates on a set of automatically generated // points inside a convex polygon with 16 vertices. We use inexact kernel. diff --git a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Wachspress_coordinates/WP_weights_speed_test_with_many_vertices.cpp b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Wachspress_coordinates/WP_weights_speed_test_with_many_vertices.cpp index 5d0b6a88190..bddc9ff2a68 100644 --- a/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Wachspress_coordinates/WP_weights_speed_test_with_many_vertices.cpp +++ b/Barycentric_coordinates_2/speed_test/Barycentric_coordinates_2/Wachspress_coordinates/WP_weights_speed_test_with_many_vertices.cpp @@ -1,3 +1,4 @@ +// Author(s) : Dmitry Anisimov. // We test speed of Wachspress weights on a set of automatically generated // points inside a convex polygon with 16 vertices. We use inexact kernel. diff --git a/Documentation/biblio/cgal_manual.bib b/Documentation/biblio/cgal_manual.bib index 1f8bd74aca9..c4862a939ec 100644 --- a/Documentation/biblio/cgal_manual.bib +++ b/Documentation/biblio/cgal_manual.bib @@ -2390,7 +2390,7 @@ ADDRESS = "Saarbr{\"u}cken, Germany" Year = {2006} } -@InProceedings{f-wmvc-14, +@InProceedings{cgal:bc:f-wmvc-14, author = {M. S. Floater}, title = {Wachspress and mean value coordinates}, booktitle = {Proceedings of the 14th International Conference on Approximation Theory, G. Fasshauer and L. L. Schumaker (eds.)},