A convex combination of Wachspress and any other 2D closed-form barycentric coordinates Ver. 1.0.0
This set of C++ classes provides you with an implementation of a convex combination of Wachspress and any other 2D closed-form barycentric coordinates as discussed in Chapter 4 of the dissertation: D. Anisimov. Analysis and new constructions of generalized barycentric coordinates in 2D. To appear, 2017. The implementation is based on the corresponding pseudocode from Appendix A of this dissertation.
NOTE: This code has been tested only on Mac OS!
Run the code
In order to run the code, do the following:
- Install macports
- Open terminal and type the following:
sudo port install cmake
cmake -DCMAKE_BUILD_TYPE=Debug ..
For the release version use instead:
cmake -DCMAKE_BUILD_TYPE=Release ..
// Polygon. std::vector<VertexR2> poly(8); poly = VertexR2(0.0 , 0.0 ); poly = VertexR2(0.34, 0.32); poly = VertexR2(0.68, 0.08); poly = VertexR2(1.12, 0.31); poly = VertexR2(1.12, 1.11); poly = VertexR2(0.49, 1.07); poly = VertexR2(0.72, 0.49); poly = VertexR2(0.14, 0.58); // Evaluation point. VertexR2 query(0.56, 0.555); // Storage for the computed coordinates. std::vector<double> b; // Compute coordinates. BlendedWachspressR2<MeanValueR2> wmc(poly); wmc.compute(query, b); // Output the resulting coordinates. std::cout << "\nResult: "; for (size_t i = 0; i < b.size(); ++i) std::cout << b[i] << " "; std::cout << "\n\n";
NOTE: For the complete example see main.cpp!
If you find any bugs, please report them to me, and I will try to fix them as soon as possible!