#include "include/utils.h"
#include "include/Saver.h"
#include <CGAL/Simple_cartesian.h>
using Segments = std::vector<Segment_2>;
using Indices = std::vector<std::size_t>;
using Neighbor_query =
using Offset_regularization =
int main(int argc, char *argv[]) {
std::string path = "";
if (argc > 1) path = argv[1];
Saver<Kernel> saver;
std::vector<Segment_2> segments;
create_example_offsets(segments);
if (path != "") {
const std::string full_path = path + "regularize_100_segments_offsets_before";
saver.export_eps_segments(segments, full_path, FT(100));
}
const FT max_angle_2 = FT(1);
std::vector<Indices> pgroups;
segments, std::back_inserter(pgroups),
CGAL::parameters::maximum_angle(max_angle_2));
const FT max_offset_2 = FT(1) / FT(4);
Neighbor_query neighbor_query(segments);
Offset_regularization offset_regularization(
segments, CGAL::parameters::maximum_offset(max_offset_2));
for (const auto& pgroup : pgroups) {
neighbor_query.add_group(pgroup);
offset_regularization.add_group(pgroup);
}
segments, neighbor_query, offset_regularization);
std::cout << "* number of modified segments = " <<
offset_regularization.number_of_modified_segments() << std::endl;
if (path != "") {
const std::string full_path = path + "regularize_100_segments_offsets_after";
saver.export_eps_segments(segments, full_path, FT(100));
}
}