A demo of my spline projection algorithm to find the point in the spline that is closest to a given location. The algorithm can achieve sub-millimeter precision in a 300m-long spline consuming less than 100 samples. Brute force would require 300K samples for the same precision.
Supports spline self-crossing, spline changing in runtime, Transform's position, rotation and scale, both open and closed splines.
The method efficiently scales to splines of large lengths. It's more efficient the closer the location is to the spline. This makes this algorithm ideal for automotive and racing applications, where vehicles are typically close to the roads and tracks.