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.
Motivation
I have use cases in which I need to specify the line type (line, ray, segment) for different use cases, e.g. ray casting algorithm to determine if point is contained in a closed shape, segment for rect/bezier intersections and line for finding extreme points on the bezier that intersect without needs to get the hull/bbox
Changes
I have changed to
lineIntersects
method to respect the 3 types of line, segment being the default value as it is currently.The
line
case test I have added surfaced a bug inroots
or at least a precision error that creates quite a substantial difference. I tried debugging it and saw that when I pass a line and a line pointing to the opposite direction thealigned
method rotates the curve wrt the line and that is where the precision error originates.I wonder if using a change basis calculation will fix this (I will try).
If not maybe consider sorting the line points so that the output is the same for both cases.
I admire your work
Thanks for this great repo