Skip to content

Fix boolean-disjoint missing overlapping collinear lines#3097

Merged
mfedderly merged 2 commits into
Turfjs:masterfrom
cycsmail:boolean-disjoint-overlap
Jul 21, 2026
Merged

Fix boolean-disjoint missing overlapping collinear lines#3097
mfedderly merged 2 commits into
Turfjs:masterfrom
cycsmail:boolean-disjoint-overlap

Conversation

@cycsmail

@cycsmail cycsmail commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

boolean-disjoint leans on lineIntersect to decide whether two lines touch, but lineIntersect only returns points where segments actually cross, so two collinear lines lying on top of each other come back as disjoint when they aren't.

I added a check for whether a vertex of either line falls on the other line. That covers the overlap case, since an overlapping interval always has an endpoint that is a vertex of one of the lines, and it leaves genuinely parallel, non-touching lines disjoint as before.

Added a regression fixture under test/false for two overlapping collinear lines. No breaking change.

Resolves #1842

@mfedderly mfedderly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mfedderly mfedderly added this to the v7.4 milestone Jul 21, 2026
@mfedderly
mfedderly merged commit 0fc52bb into Turfjs:master Jul 21, 2026
5 checks 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.

boolean-disjoint on parallel lines not working (bug in boolean-disjoint)

2 participants