Converting Bezier Curves to Quadratic Splines

Jens Alfke, 1 Jun 1994
James Smith writes:
Can anyone show me a way to convert a Bezier cubic curve to a quadratic spline? Is this a trivial conversion? Can this conversion (if possible) be done to produce an identical curve from the Bezier to the spline?
The answer is it's not trivial, and it will necessarily be an approximation (since you're going from 3rd order to 2nd order.) The usual technique is recursive subdivision:

  1. Create a quadric that tries to approximate your cubic.
  2. Apply some metric to see how close an approximation it is.
  3. If it's not close enough, break the cubic in half at the midpoint and recurse on each half.
Call the Bezier curve ABCD, where A and D are the endpoints and B and C the control points. For step (1) I found the intersection of AB and CD (call it E) and used AED as the quadric. This is about your only option because the curve at A has to be parallel to AE, and at D has to be parallel to ED. In step (2), I used as my metric the distance from the midpoint of the quadric to the midpoint of the Bezier. The midpoint of the quadric is, if I remember correctly, halfway between the midpoint of AE and the midpoint of ED. The midpoint of the Bezier involves computing a few more midpoints; it's a standard construction that you should be able to find in a text.

This worked well enough but tended to produce more quadrics than was optimal. (In general there were 2-3 times as many quadrics as Beziers. But the quadrics are faster to render, so it balances out.) I know some people at Apple with more mathematical savvy than I have had worked on this a bit and had interesting techniques where they didn't always break the Bezier in the middle, and were sometimes able to merge pieces of adjacent Beziers into the same quadrics. This produced much more efficient results. To my knowlege their results haven't been published anywhere; but they probably ought to be now that the ship of QuickDraw GX is imminent. (If you have GX, you might look at the "cubic library", which apparently does some or all of this stuff. It does describe cubics in quadric form, but I'm not sure it does all the optimizations I've described in this paragraph...)