(Restart project to get a new random spline)
It works!! It took me ages to get this working, but now it does work, and it's as efficient as i can bother making it for now. The algorithm can be extended to support any number of points, and shouldn't be noticeably slower for it.