Skip to content

Conversation

@smallsaucepan
Copy link
Member

Previously, when checking the intersection of two lines booleanCrosses would only check candidate intersection points against line vertices, which lead to valid crossing points being missed and to false negatives.

This change has the function be more optimistic and only rule out candidate intersections if they coincide with the end points (or "boundary") of the lines. The crossing points can otherwise be anywhere on the lines.

Added tests to better exercise the different variations crosses needs to cater for, at least for two lines. Renamed a couple of other tests to better describe what they're testing.

Resolves #1901
Resolves #2967

Please provide the following when creating a PR:

  • Meaningful title, including the name of the package being modified.
  • Summary of the changes.
  • Heads up if this is a breaking change.
  • Any issues this resolves.
  • Inclusion of your details in the contributors field of package.json - you've earned it! 👏
  • Confirmation you've read the steps for preparing a pull request.

@smallsaucepan smallsaucepan merged commit 6717ef5 into Turfjs:master Dec 14, 2025
4 checks passed
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.

booleanCrosses gives incorrect result booleanCrosses not working as expected

2 participants