cgal icon indicating copy to clipboard operation
cgal copied to clipboard

[Small Feature] Unregularized do_intersect(Polygon, Polygon) compatible with inexact constructions

Open sgiraudot opened this issue 5 years ago • 2 comments

Rationale

CGAL currently offers a function do_intersect() that, for simplicity, we can distinguish into 2 main variants:

  • CGAL::do_intersect() provided by the packages Intersection_2/3: works on Kernel objects (points, segments, etc.), returns true if objects intersect even at their boundaries (e.g. 2 segments sharing a common vertex) compatible with inexact constructions

  • CGAL::do_intersect() provided by Boolean_set_operations_2: works on polygon objects (Polygon_2, Polygon_with_holes_2, etc.), returns true only if objects overlap (only the "strict" intersection is tested, 2 polygons sharing only a vertex or an edge will return false), requires exact constructions

This second variants raises 2 issues: first, the behavior (open interval intersection VS closed interval interseciton) is counter-intuitive and differs from the general function. Second, requiring exact constructions for a function that is obviously a predicate is not satisfying.

After discussions with @efifogel, it is agreed that the difference of behavior is justified by the fact that the Boolean Set Operations 2 implements regularized boolean operations, which implies that only the closure of the interior of the result is considered. So this behavior should be kept.

Nevertheless, it would still make sense to add a non-regularized variant of do_intersect() for polygons that doesn't require exact constructions.

Summary of API changes

  • The current CGAL::do_intersect() variant for polygons becomes CGAL::Regularized_boolean_set_operations_2::do_intersect()
  • All other operations in this package are also placed in the namespace Regularized_boolean_set_operations_2
  • A new variant of CGAL::do_intersect() is introduced, handling non-strict intersections without requiring exact constructions
  • Boolean_set_operations_2 is renamed Regularized_boolean_set_operations_2.

License and copyright ownership

(No change)

CHANGES.md

Done

Submission

Small feature page

Status

  • [ ] Add todo in issue for 5.5 to add RW rules for the renaming of the packages (including package_overview change of shortcut) and doxygen groups (PkgBooleanSetOperations2Ref, PkgBooleanSetOperations2Concepts, PkgBooleanSetOperations2)
  • [ ] Handle backward compatibility of free functions
  • [x] Rename the package

sgiraudot avatar Dec 15 '20 10:12 sgiraudot

/build:v0

sloriot avatar Dec 03 '21 15:12 sloriot

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/5284/v0/Manual/index.html

github-actions[bot] avatar Dec 03 '21 15:12 github-actions[bot]