Search code examples
cgal

Is polygon operation in CGAL working with polygon that has duplicated edge?


I have a polygon as such:

enter image description here

{0}, {1}, {2}, {3},... denote the sequence of the points on the polygon.

I wonder whether CGAL polygon boolean set-operations work with polygon as such?

From the user manual, the input polygon must be simple or relatively simple in order for the CGAL polygon boolean set-operations to work:

A relatively simple polygon allows vertices with a degree >2, but all of its edges are disjoint in their interior. Furthermore, it must be an orientable polygon. Namely when it is inserted into an arrangement and its outer boundary is traversed, the same face is adjacent to all of the halfedges (no crossing over any curve during the traversal). Note that while polygon C has the same curves as polygon B, traversal of the curves leads to crossing over a previously traversed curve, and is therefore neither simple nor relatively simple.

Not sure what it really means, but my guess is that the polygon is still ( at least) relatively simple, and hence the CGAL polygon boolean operation still works... am I right?


Solution

  • If you look at the condition for a valid polygon in the user manual, you'll see that the input polygon must be simple. Yours is not since you have a duplicated edge.