-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find self-intersection points of a trail #261
Comments
See #207 which this might be useful for. |
You could split the bezier at vertical (or any) directions, then use the intersection functions on these. |
@kuribas I am not sure I understand what you mean. If a trail has a self-intersection, splitting it at some point does not guarantee that the intersection will be between the two halves---it could still be a self-intersection of one of the two pieces. One can continue doing this recursively, of course, but I am not sure how you would know when to stop. |
If the curve doesn't turn more than 180 degrees, it cannot self-intersect (assuming no singularities). |
@kuribas do you have a precise method of computing this turn? For instance:
Here |
Oh! Now I think I understand. You mean to split the bezier at every point where the normal vector (or its negation) is equal to some fixed direction. Yes, I think that should work nicely. We don't even have to so subdivision etc. since finding the parameters to split on just amounts to solving a quadratic. |
yes. I use the derivative curve, but the idea is the same. For example B_x'(t) = 0 for vertical directions. |
Using functions like
intersectPointsT
it is possible to find the points where two trails intersect. It would be nice to have a function to find self-intersection points of a single trail. Passing the same trail twice tointersectPointsT
will not work since they intersect at every point.The text was updated successfully, but these errors were encountered: