Fix OGC extraction producing figure-8 contours at shared vertices#58
Open
bretttully wants to merge 3 commits intoiShape-Rust:mainfrom
Open
Fix OGC extraction producing figure-8 contours at shared vertices#58bretttully wants to merge 3 commits intoiShape-Rust:mainfrom
bretttully wants to merge 3 commits intoiShape-Rust:mainfrom
Conversation
Four non-overlapping boxes are unioned to form a shape with a hole. The exterior contour and hole contour should share a single point at (2,2), but the library currently merges them into one figure-8 contour that visits (2,2) twice. Tests EvenOdd, NonZero, Positive, and Negative fill rules. https://claude.ai/code/session_01UWsUQwhyBYT5ABqevBFmkR
- Switch to Overlay::with_contours_custom with IntOverlayOptions::ogc() - Add test_input_winding_order asserting all rectangles are CCW (negative area_two) - Simplify overlay helper to accept fill_rule and return results directly https://claude.ai/code/session_01UWsUQwhyBYT5ABqevBFmkR
When hull contours self-touch at pinch points (e.g. exterior and hole sharing a vertex), extract_ogc now detects and splits them inline during pass 1. Split sub-contours are classified by winding area as either new shapes or pending holes, which are joined after pass 2. - Add find_pinch_point using i_key_sort's sort_by_two_keys for O(n log n) duplicate detection on contour points - Add split_all_pinch_points to recursively decompose figure-8 contours - Add comprehensive tests (16 cases) covering 4 geometries × 4 fill rules, validated against Shapely reference output
Contributor
Author
|
Fixes #57 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
extract_ogcproduces self-touching figure-8 contours when hull contours share a vertex with a hole (e.g. pinch point at (2,2))i_key_sort::sort_by_two_keysfor O(n log n) duplicate detectionjoin_unsorted_holesafter pass 2Test plan
OverlayRule::SubjectandOverlayRule::Unioncargo fmtandcargo clippyclean