How does Raph Levien's Spiro choose angles for the ends of a path?

97 Views Asked by At

I've read Raph Levien's paper on splines (http://www.levien.com/phd/phd.html), and think I mostly understand chapter 8, the nuts and bolts of fitting a piecewise polynomial spiral to a sequence of points.

For the procedure described, the path has to be a loop. Otherwise it has two degrees of freedom too many: the Newton-like process does not affect the tangent angles at the ends.

Ideally, the end angles should be those that minimize the integral over path length of the square of the first derivative of curvature. Maybe that solution is hard to find, and Spiro uses a crude rule of thumb instead. Does someone know?

2

There are 2 best solutions below

0
On BEST ANSWER

So I asked Raph Levien.

You're absolutely right that these are under-determined. Simply, in Spiro the end segments are circular arcs.

I talk about this a little in section 3.1 of my newer spline research paper: https://spline.technology/paper1.pdf

Thanks for your interest!

1
On

You can do pretty much whatever you want. You can clamp endpoint curvature to zero, have it continue the curvature or try to minimize path length like you say. Depending on your solver it may do the latter for you.

The choice of method depends on the application, e.g. graphic designers might not like a strictly "correct" method (in terms of the math).