Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Intersection of two curvy splines
#2
Hi
There are two ways I am thinking of:
  1. 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.
  2. 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.
I hope this helped
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.
Reply


Messages In This Thread
Intersection of two curvy splines - by Einherj - 09-30-2022, 02:34 PM
RE: Intersection of two curvy splines - by _Aka_ - 10-01-2022, 08:09 AM
RE: Intersection of two curvy splines - by _Aka_ - 10-03-2022, 09:13 AM
RE: Intersection of two curvy splines - by _Aka_ - 10-04-2022, 10:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Information New free asset: Converter For Unity Splines _Aka_ 5 19 04-25-2024, 11:11 AM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 1 10 04-03-2024, 03:16 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_

Forum Jump: