Attention when using CGAL::Exact_predicates_inexact_constructions_kernel
The CGAL::Exact_predicates_inexact_constructions_kernel
is often used as the geometric traits
for many CGAL data structures, including CGAL::Constrained_Delaunay_triangulation_2
and
CGAL::Polygon_2
. However, care must be taken when using predicates since constructions are not exact.
For example, when two intersecting polygons are embedded in a triangulation, points will be generated at the intersection(s).
If we use CGAL::bounded_side_2
to check if an intersection point is on the boundary or inside/outside
the polygons, the result may be unreliable due to the inexact construction. An intersection point
may appear to be on the boundary of both polygons, but CGAL::bounded_side_2
may indicate
that it is inside one of the polygons. This is because the intersection point is constructed inexactly, but
CGAL::bounded_side_2
performs an exact check. To address this issue,
one possible solution is to calculate the squared distance between the point and the boundary and set a precision tolerance.