#include "include/utils.h"
#include "include/Saver.h"
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
using FT = typename Kernel::FT;
using Contour = std::vector<Point_2>;
using Contour_directions =
int main(int argc, char *argv[]) {
std::string path = "data/contour.polylines";
if (argc > 1) path = argv[1];
Saver<Kernel> saver;
const FT max_offset_2 = FT(2);
std::vector<Point_2> contour;
initialize_contour(path, contour);
if (argc > 2) {
const std::string full_path = std::string(argv[2]) + "regularize_open_contour_before";
saver.export_eps_open_contour(contour, full_path, FT(8));
}
const bool is_closed = false;
Contour_directions directions(contour, is_closed);
std::vector<Point_2> regularized;
contour, directions, std::back_inserter(regularized),
CGAL::parameters::maximum_offset(max_offset_2));
std::cout << "* number of directions = " <<
directions.number_of_directions() << std::endl;
if (argc > 2) {
const std::string full_path = std::string(argv[2]) + "regularize_open_contour_after";
saver.export_eps_open_contour(regularized, full_path, FT(8));
}
}
Estimates the longest principal direction of the contour.
Definition: Longest_direction_2.h:51
OutIterator regularize_open_contour(const InputRange &input_range, const ContDirections &directions, OutIterator contour, const NamedParameters &np=parameters::default_values())
regularizes open contours.
Definition: regularize_contours.h:242
This header includes all classes for regularizing contours.