33 #ifdef OGDF_INCLUDE_CGAL
45 template<
typename Kernel>
46 Polygon_t<Kernel> peturb(
const Polygon_t<Kernel>& polygon,
double eps = 1e-5) {
47 using Segment = LineSegment_t<Kernel>;
49 auto bisector = [&](
const Segment& s1,
const Segment& s2) {
50 const auto& v_in = s1.to_vector();
51 const auto& v_out = s2.to_vector();
52 auto bisected = bisect(-v_in, v_out);
53 if (geometry::right_turn(v_in, bisected)) {
60 Polygon_t<Kernel> perturbed;
61 auto itr = polygon.edges_circulator();
62 for (
unsigned int i = 0; i < polygon.size(); ++i) {
63 perturbed.push_back(polygon[i] + bisector(*(itr - 1), *itr) * eps);