Need help finding the right type of 2D spline for certain criteria

was wondering something and thought it would be best to explain myself by abstracting my question to be more math related while still giving me my answer:


(whenever i refer to a point or direction just assume Vector2)
does anyone know a module/name for a 2D spline that supports these criteria?:

  1. is constructed by 2 points with a corresponding unit direction vector for the way the spline should articulate before reaching each point
  2. a method to use a point in whatever process to determine a resultant point closest to the original that lays on the spline
  3. a method like most other splines to still be able to provide a numerical value between 0-1 that returns a point ___% of the way across the entire spline

here is a code example and diagram to hopefully articulate the first two criteria better than my words can :sweat_smile:

1 Like

bumping, i always forget how competitive this channel is

1 Like

Hey there.

Have you checked these 2?

Not sure if they help but here you go.

1 Like

sorry for the late response, but after some more research into what i actually am looking for i realised that, not only do both of these modules not align with the first and second criteria i provided, i dont believe its possible for any curve to follow my first criteria.

because of this, for now and for my usecase, i think i’ll be trying to use bezier curves, and then sampling positions across its length to get a rough estimate for the function i need :+1: leaving this post open though because this solution only really resolves criteria 2, i’ll need to make my own code for suitable control points based on requested direction values

1 Like