#include <CGAL/Simple_cartesian.h>
#include <CGAL/Barycentric_coordinates_2/Delaunay_domain_2.h>
#include <CGAL/Barycentric_coordinates_2/Harmonic_coordinates_2.h>
using Point_range = std::vector<Point_2>;
using Domain =
using Harmonic_coordinates_2 =
int main() {
const std::vector<Point_2> polygon = {
};
std::list<Point_2> seeds;
seeds.push_back(
Point_2(0.1, 0.1));
const double max_edge_length = 0.01;
Domain domain(polygon);
domain.create(max_edge_length, seeds);
Harmonic_coordinates_2 harmonic_coordinates_2(polygon, domain);
harmonic_coordinates_2.compute();
std::vector<double> coordinates;
coordinates.reserve(polygon.size());
std::cout.precision(1);
std::cout << std::endl << "harmonic coordinates (computed): " << std::endl << std::endl;
for (std::size_t k = 0; k < 20; ++k) {
coordinates.clear();
harmonic_coordinates_2(k, std::back_inserter(coordinates));
for (std::size_t i = 0; i < coordinates.size() - 1; ++i) {
std::cout << coordinates[i] << ", ";
}
std::cout << coordinates[coordinates.size() - 1] << std::endl;
}
std::cout << std::endl << "harmonic coordinates (evaluated): " << std::endl << std::endl;
std::vector<Point_2> barycenters;
domain.barycenters(std::back_inserter(barycenters));
for (std::size_t k = 0; k < 20; ++k) {
coordinates.clear();
harmonic_coordinates_2(barycenters[k], std::back_inserter(coordinates));
for (std::size_t i = 0; i < coordinates.size() - 1; ++i) {
std::cout << coordinates[i] << ", ";
}
std::cout << coordinates[coordinates.size() - 1] << std::endl;
}
std::cout << std::endl;
return EXIT_SUCCESS;
}
2D Delaunay domain restricted to a simple polygon.
Definition: Delaunay_domain_2.h:60
2D harmonic coordinates.
Definition: Harmonic_coordinates_2.h:74