Parallel Bezier

From CGAFaq

Jump to: navigation, search

This is generally not possible. It is possible in the uninteresting case when the Bézier curve is a straight line, in which case the parallel Bézier curve is also a straight line.

The following construction illustrates what the problem is. Let be a polynomial curve in the plane. The tangent vectors are provided by the derivative,

Unit-length tangent vectors are

The last equation defines the angle and is valid since is unit length. A unit-length normal vector is

and is consistently oriented to one side of the curve. If is the desired offset distance, the offset curve you want is

If is itself a polynomial curve, then is also a polynomial curve. But notice that and the components involve a square root in the denominator, so the chances of being a polynomial are slim to none. (For the mathematically inclined: although is not a polynomial in , there might be a reparameterization that makes it a polynomial. For polynomial curves this is unlikely. For rational curves the chances are greater.)

The situation is different for the broader class of rational Bézier curves. For example, these can represent circular arcs, and a parallel offset is just a concentric circular arc, also representable as a rational Bézier curve.

Personal tools