Hobby's algorithm for sexy splines

This small interactive demo illustrates how Hobby's algorithm can be used to create aesthetically attractive Bézier splines. Adjust the control points to see how the curves update dynamically.

A spline is a connected sequence of two or more curves. Naturally, a Bézier spline contains only Bézier curves. These types of curves are often used in vector graphics to smoothly link discrete points. The point where two curves are connected in a spline is called a Knot. Based on the orientation of two curves as they met at a knot, the curvature of the spline can vary drastically, and perhaps, unattractively.

Hobby's algorithm is focused on optimizing the orientation of curves at knots such that the curvature is more constant around these inflection points. The thin curve in the diagram is a Natural cubic spline through the same points. While mathematically smooth, it is not optimal.

omega, ω, is an artifact of the parametric equations used in the algorithm and it influences the curl at each knot.

This blog post was the inspiration behind this demo. It does a great job at explaining the finer points of what's happening and you should check it out if you're interested in more demos.

The paper to the left is the original one describing the algorithm.