James Smith writes:

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: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?

- Create a quadric that tries to approximate your cubic.
- Apply some metric to see how close an approximation it is.
- If it's not close enough, break the cubic in half at the midpoint and recurse on each half.

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...)