Closed notgapriel closed 2 months ago
Efi (@efifogel), the bug report from @notgapriel is nicely done. Do you have a solution?
Efi (@efifogel), the bug report from @notgapriel is nicely done. Do you have a solution?
I mean: is that fixed in more recent versions of the code? Maybe in a development branch?
There is no bug. First, the input polygons are invalid, as they are clockwise oriented. Second, you should use Epeck (and not Epick). If you fix both problems the program works fine.
//) o /__ // (__ ( ( ( (/ (/-(-'(/ /
On Mon, 29 Apr 2024 at 17:37, Laurent Rineau @.***> wrote:
Efi @.*** https://github.com/efifogel), the bug report from @notgapriel https://github.com/notgapriel is nicely done. Do you have a solution?
I mean: is that fixed in more recent versions of the code? Maybe in a development branch?
— Reply to this email directly, view it on GitHub https://github.com/CGAL/cgal/issues/8172#issuecomment-2082921294, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVBNOEAJOBDJOQ7QBRYK7LY7ZLKJAVCNFSM6AAAAABG4VFZFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBSHEZDCMRZGQ . You are receiving this because you were mentioned.Message ID: @.***>
Thanks Efi. I close the bug. @notgapriel I think you can continue and discuss in the closed bug if needed.
Sure, thank you very much, @efifogel and @lrineau. I missed the mention of "valid" polygons to the regularised 2D boolean-set operations as I only looked at the "Union Functions" documentation. I will leave that link versioned in case this is of any help to any future person in my position. Confusion may arise from the expectation that boolean operations on "inverse" polytopes (in this case, clockwise polygons) will work the same as in CGAL::Polygon_mesh_processing::corefine_and_compute_boolean_operations
, where the operation is logically inverted on inverted input.
Issue Details
I have found that the
CGAL::join
mostly works but for very few specific cases that I have isolated, it does not. These do not appear to have any obvious edge-case logic in them, they are basic octagons that should be able to compute a union but do not. This is using the inexact kernel.The example given has two octagons that overlap each other. This is shown below.
Image of the two polygons in Desmos:
The resultant polygon should have 15 vertices but has 0. A reading of the docs would suggest this behaviour is unintended. Will also note that when calling
CGAL::join
many other times in one of my geometric projects prior to calling it for these two octagons, I did manage to get a 15-sidedPolygon_with_holes_2
generating but it is impossible to generate a minimum example for this as I have not found what triggers it to output something and what triggers it to output nothing. The 15-sided shape it did output had all of the right points but they were incorrectly ordered so as to make a degenerate, self-intersecting polygon.Image of the 15-sided degenerate output in Desmos:
The cause for this issue is possibly related to the strange logic for handling both aggregating and non-aggregating inputs to the
CGAL::join
function that was pointed out in #6840.Source Code
Output
Environment