Skip to content

Fix boolean-disjoint missing overlapping collinear lines#3097

Open
cycsmail wants to merge 1 commit into
Turfjs:masterfrom
cycsmail:boolean-disjoint-overlap
Open

Fix boolean-disjoint missing overlapping collinear lines#3097
cycsmail wants to merge 1 commit into
Turfjs:masterfrom
cycsmail:boolean-disjoint-overlap

Conversation

@cycsmail

@cycsmail cycsmail commented Jul 5, 2026

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant