Skip to content

Conversation

@atta-ullah01
Copy link
Contributor

@atta-ullah01 atta-ullah01 commented Jan 8, 2026

Summary of Changes

This PR replaces the inefficient implementation of is_polygon_simple in MVC_post_processor_3.h (which checked every pair of edges for intersection) with the efficient sweep-line algorithm provided by CGAL::is_simple_2.

This change improves the complexity of the simplicity check from $O(N^2)$ to $O(N \log N)$ and resolves the @fixme annotation previously present in the code.

Release Management

  • Affected package(s): Surface_mesh_parameterization
  • Issue(s) solved (if any): Resolves an internal fixme
  • Feature/Small Feature (if any): Optimization
  • Link to compiled documentation (obligatory for small feature):
  • License and copyright ownership: I confirm that I have the right to contribute these changes.

@atta-ullah01 atta-ullah01 force-pushed the fix/mvc-is-simple-sweep-line branch from 76b6be6 to 2e6fdc6 Compare January 8, 2026 01:41
@afabri
Copy link
Member

afabri commented Jan 8, 2026

This creates a dependency on the Polygon package.
We have to check that the sweep line version is certified for a kernel without exact constructions. Well, the quadratic one, also does not give any guarantee if the predicates are not exact.

@afabri
Copy link
Member

afabri commented Jan 8, 2026

Can you please add Polygon to the file dependencies

@afabri
Copy link
Member

afabri commented Jan 8, 2026

This creates a dependency on the Polygon package. We have to check that the sweep line version is certified for a kernel without exact constructions. Well, the quadratic one, also does not give any guarantee if the predicates are not exact.

The dependency is on a LGPLed package, which is fine.
No constructions are made.

Replace naive O(N^2) loop in is_polygon_simple with CGAL::is_simple_2 for improved performance and robustness.

Affected package(s): Surface_mesh_parameterization
@atta-ullah01 atta-ullah01 force-pushed the fix/mvc-is-simple-sweep-line branch from 2e6fdc6 to 91530ad Compare January 8, 2026 15:11
@atta-ullah01
Copy link
Contributor Author

Can you please add Polygon to the file dependencies

Done. I have added Polygon to the dependencies file.

@sloriot
Copy link
Member

sloriot commented Jan 14, 2026

Successfully tested in CGAL-6.2-Ic-82

@sloriot sloriot merged commit e707f95 into CGAL:main Jan 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants