Bezier Curve – Control Points of Offset Bezier Curve

bezier-curve

If I have a cubic Bezier segment specified by two endpoints and two
control points, how can I find an offset curve which is "parallel" to
the original at some given distance, after i have determined the other 2 endpoints?

cubic Bezier segment illustration

The red dots in the image are the endpoints, and the red squares are the control points of the initial bezier segment. Everything red is known, and i need to find the blue squares, that is, the control points of the second curve, such that the second curve is parallel to the first one(must also take into account that the dimension varies, as if it was below the original bezier, the second curve would be smaller).

I am sorry for the graphics of the image, it has only a illustrative purpose and i am not good at drawing. Thank you for the help!

Best Answer

The simplest heuristic approximation method is the one proposed by Tiller and Hanson. They just offset the legs of the control polygon in perpendicular directions: bezier-offset

The blue curve is the original one, and the three blue lines are the legs of its control polygon. We offset these three lines, and intersect/trim them to get the points A and B. The red curve is the offset. It's only an approximation of the true offset, of course, but it's often adequate.

If the approximation is not good enough for your purposes, you split the curve into two, and approximate the two halves individually. Keep splitting until you're happy. You will certainly have to split the original curves at inflexion points, if any, for example.

Here is an example where the approximation is not very good, and splitting would probably be needed: bad offset

There is a long discussion of the Tiller-Hanson algorithm plus possible improvements on this web page.

The Tiller-Hanson approach is compared with several others (most of which are more complex) in this paper.

Another good reference, with more up-to-date materials, is this section from the Patrikalakis-Maekawa-Cho book.

For even more references, you can search for "offset" in this bibliography.