Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

// Fix polygon orientation function to handle near-degenerate cases v… #8830

Conversation

Abhishek-Atole
Copy link

Fix polygon orientation function to handle near-degenerate cases via precondition fallback

Summary of Changes

Adds robust error handling to the orientation_2 function to handle cases where the is_simple_2 precondition check fails during polygon partitioning operations, even when the polygon passes polygon.is_simple() initially.

The issue occurs due to numerical precision problems with nearly collinear points. The solution implements a try-catch approach that first attempts the original precondition check, but gracefully falls back to the orientation_2_no_precondition version if the check fails.

This prevents the partitioning algorithms (particularly optimal_convex_partition_2) from failing with seemingly simple polygons, making CGAL more robust for real-world applications with imprecise geometry.

Release Management

@sloriot
Copy link
Member

sloriot commented Apr 7, 2025

I don't see any added value to the patch, precondition will already provide enough information without the duplicated test.

@sloriot sloriot closed this Apr 7, 2025
@MaelRL MaelRL added the Invalid label Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optimal_convex_partition_2 fails with very simple polygon
3 participants