Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Unexpected Polygon_2 do_intersect() Behavior?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Unexpected Polygon_2 do_intersect() Behavior?


Chronological Thread 
  • From: Christopher Mitchell <>
  • To:
  • Subject: Re: [cgal-discuss] Unexpected Polygon_2 do_intersect() Behavior?
  • Date: Sun, 11 Sep 2016 18:03:14 -0400
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:1bU7nRLFbkFs/N/SgNmcpTZWNBhigK39O0sv0rFitYgULP7xwZ3uMQTl6Ol3ixeRBMOAuqsC1bWd6vG4ESxYuNDa4ShEKMQNHzY+yuwu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9GO35F8bogtit0KjqotuIMlwO2mX2OOIqZFXu9EOK55FQ2dMjYo8KiTLx6kNSfOpXwW46bXmypD3bovmKwZh47i5LsOgg/cMTGY/zfqA/UKAKRG9+azN9t4XXskzIQgKLo3cdSW4LiQFgAg7f7Ri8UI2inDH9s79W2DObJtHxVbA5Q3yH7rtgSBLsjG9TPCQ8qzyPosphkeRWrA/39E83+JLdfIzAbKk2RajaZ95PHWc=

Thanks for the quick response. The code is sufficiently trivial (ie, a single if (CGAL::do_intersect(poly1, poly2)) { ... }) that I'm not sure it would help. I'm using a simple loop to convert a set of non-CGAL points into a Polygon_2, making sure to not duplicate the starting point, as you can see from the image attached to the first post. My polygons are CGAL::Polygon_2<CGAL_Kernel>, where CGAL_Kernel is CGAL::Exact_predicates_inexact_constructions_kernel. I hope this helps. Thanks!

On Sat, Sep 10, 2016 at 6:25 PM, Efi Fogel <> wrote:

What number type are you using?  Better yet, could you share the code?


On Sep 10, 2016 18:31, "Christopher Mitchell" <> wrote:
I'm attempting to determine if two Polygon_2s overlap in anyway, ie, share any portion of their interiors, including one being entirely contained by the other. In most cases this works, but for a few polygon pairs, do_intersect() returns false unexpectedly. I make sure (1) all polygons are simple (2) all polygons are not oriented CGAL::CLOCKWISE (I call .reverse_orientation() on the polys if they are CGAL::CLOCKWISE), and (3) that the starting vertex is not duplicated. I have attached an example of a polygon pair for which do_intersect() returns false. Thanks in advance for any insight; I'd be happy to provide additional information as necessary.




Archive powered by MHonArc 2.6.18.

Top of Page