10-01-2022, 08:09 AM
Hi
There are two ways I am thinking of:
Have a nice day
There are two ways I am thinking of:
- The elegant one, but difficult one: look up for "X splines intersection" with X being the type of splines you are using. You should find the mathematical equation to find such intersection. Implement it, then apply it on the splines for which you want to find an intersection.
- The brute force one: take one of the splines (A), and go through its points (for example sample 1000 point on it) and for each one find the nearest point on the other spline (B) (see CurvySpline.GetNearestPoint). Calculate the distance between both points. If you find a point with a distance smaller than a threshold you would specify, then it means that there might be an intersection nearby. You can try again with another set of points around that found point, until you find a distance small enough to be considered equivalent to 0.
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.