From 6fcadc83ac0002946a28bac30c9b8af4dc89988d Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Sat, 4 Apr 2026 06:41:58 -0400 Subject: [PATCH 1/3] Fix missing `p_start` update in `_line_filled_curve_interactions` hinge handler The midpoint-checking loop in the `line_hinge` branch never advanced `p_start`, so every midpoint was computed from the original line start instead of between consecutive intersection points. This caused sub-segments outside a curve to go undetected, making predicates like `within` return incorrect results for polygons sharing collinear edges with a notch. Fixes #396 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/methods/geom_relations/geom_geom_processors.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/methods/geom_relations/geom_geom_processors.jl b/src/methods/geom_relations/geom_geom_processors.jl index 0049f993d1..602c2588f3 100644 --- a/src/methods/geom_relations/geom_geom_processors.jl +++ b/src/methods/geom_relations/geom_geom_processors.jl @@ -627,6 +627,7 @@ function _line_filled_curve_interactions( elseif mid_val == point_out out_curve = true end + p_start = p_end end # already checked segment against whole filled curve l_start = l_end From 92a8d435720de13cb67c477c87f4d4fd1dbd55bd Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Sat, 4 Apr 2026 06:43:57 -0400 Subject: [PATCH 2/3] Add regression test for `within` with collinear notch polygon (#396) Co-Authored-By: Claude Opus 4.6 (1M context) --- test/methods/geom_relations.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/methods/geom_relations.jl b/test/methods/geom_relations.jl index 4e3cb46222..42528eb508 100644 --- a/test/methods/geom_relations.jl +++ b/test/methods/geom_relations.jl @@ -57,6 +57,9 @@ p10 = LG.Polygon([ [[0.15, 0.55], [0.15, 0.95], [0.55, 0.95], [0.55, 0.55], [0.15, 0.55]] ]) p11 = LG.Polygon(r3) +# Polygon with interior notch sharing collinear edges with a rectangle (issue #396) +p12 = LG.Polygon([[[0.0, 0.0], [0.0, 4.0], [8.0, 4.0], [8.0, 0.0], [0.0, 0.0]]]) +p13 = LG.Polygon([[[0.0, 0.0], [0.0, 2.0], [7.0, 1.0], [7.0, 3.0], [0.0, 3.0], [0.0, 4.0], [8.0, 4.0], [8.0, 0.0], [0.0, 0.0]]]) mpt1 = LG.MultiPoint([pt1, pt2]) mpt2 = LG.MultiPoint([pt2, pt3]) @@ -157,6 +160,8 @@ test_pairs = [ (p6, p1, "p6", "p1", "Polygon inside of other polygon's hole"), (p7, p1, "p7", "p1", "Polygons overlap"), (p10, p1, "p10", "p1", "Polygon's with nested holes"), + (p12, p13, "p12", "p13", "Rectangle with polygon with collinear notch (#396)"), + (p13, p12, "p13", "p12", "Polygon with collinear notch inside rectangle (#396)"), # Multigeometries (mpt1, mpt1, "mpt1", "mpt1", "Same set of points for multipoints"), (mpt1, mpt2, "mpt1", "mpt2", "Some point matches, others are different"), From 0f3f28bc78ae62b8481ad057b76d5246538f5d51 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Sat, 4 Apr 2026 08:48:25 -0400 Subject: [PATCH 3/3] Bump version from 0.1.38 to 0.1.39 Co-Authored-By: Claude Opus 4.6 (1M context) --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 28b58d3517..70a473743a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GeometryOps" uuid = "3251bfac-6a57-4b6d-aa61-ac1fef2975ab" authors = ["Anshul Singhvi ", "Rafael Schouten ", "Skylar Gering ", "and contributors"] -version = "0.1.38" +version = "0.1.39" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"