## Monday, August 22, 2011

### The Joys of Bezier Curves [NOT]

Someone please remind me why bezier curves are such a common parametric curve choice in the computer graphics world?  Some of their charming properties...
• No analytic solution for the curve's length.  The integral will make you cry.
• No analytic solution for the intersection of two curves.  Well, this guy found one, but he's not going to tell you what it is.
• No solution to find the closest point of encounter between two disjoint curves.
• No analytic solution to find the parametric value to split the bezier at a particular known length interval (e.g. into two halves of equal length).
You can subdivide a bezier curve into X or Y monotone regions analytically - to do this you intersect the X or Y parametric derivative with 0 and solve for t using the quadratic equation.

You can also intersect a bezier curve with a horizontal or vertical line - to do this you fill in the line coordinate and use the cubic equation (which does have a long but scary analytical solution) to find the roots.  (See here for code.)

Well, at least they're not riddled with patents.  Oh wait...