[Math] Interpolating between points in 3D

spline

I want to interpolate a spline of some sort between several points in three dimensions, but I have some very specific requirements.

  1. I must know the length of each spline segment between two points
  2. I must be able to find the point on any spline segment some distance along that spline segment
  3. I must be able to find the direction of the spline segment at any such point
  4. Interpolation between points must be smooth: i.e. first and second derivative define at all points

Additionally, the algorithm should be fast and efficient. What method would best suit my purposes?

Best Answer

Your requirements are somewhat conflicting. #1 and #2 would lead you to use some sort of arc-spline. This is a "spline" that's composed of a sequence of circular arcs joined end-to-end. See here or here or here for more info. It is common to use a "bi-arc" construction to build arc splines. An early paper on bi-arcs is this one. You can refer to it and later papers that cite it. Using circular arcs is the simplest way of getting easy arclength computations.

But arc splines will only be tangent continuous, at best; they will have discontinuities of curvature. So, they violate your condition #4. If you use a large number of circular arcs then these discontinuities will be small, so they may be tolerable for your application. Only you can decide. A word of warning: there is only a flimsy relationship between continuity of derivatives and visual/aesthetic smoothness. So, if visual smoothness is what you really want, it might be fine to give up on C2 continuity.

If you really need continuity of second derivatives (requirement #4), you are forced to use more complex curve segments to build the spline. The most common choice would be cubic segments (i.e. parametric cubic splines). These will give you C2 continuity, but calculating arclengths will require numerical methods. Cubic splines are somewhat easier to construct than arc splines, and lots of software is available to help.

If you're willing to do some work, you could try constructing so-called "Pythagorean Hodograph" curves. These are special polynomial splines whose arclength functions are polynomials. I guess they give you everything you want, but constructing them is fairly complicated. A good starting point is this book and other papers by Rida Farouki.

So, you can have easy construction, continuity of derivatives, speed of arclength calculations. Pick two.