# Paralel bezier curve

If I have a cubic Bezier curve 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 ? The red dots in the image http://s11.postimg.org/n44nmqzoj/bezier_question.png 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!

• Take a look at this: math.stackexchange.com/questions/302076/… – bubba Jul 24 '14 at 13:14
• I found another reference which mentions this: the very old (2003) comp.graphics.algorithms FAQ at faqs.org/faqs/graphics/algorithms-faq says in question 4.01: "How do I generate a Bezier curve that is parallel to another Bezier? You can't. The only case where this is possible is when the Bezier can be represented by a straight line. And then the parallel 'Bezier' can also be represented by a straight line." – Zsbán Ambrus Feb 4 '16 at 15:40
• See also mathoverflow.net/q/60902/5340 "Formulas for equidistant curves" – Zsbán Ambrus Jun 8 '17 at 14:36

## 1 Answer

There's no simple solution for this. I think the parallel curve is usually not exactly a Bezier curve: just think of how even a circle is not a Bezier curve.

As a practical solution, computer programs simply approximate Bezier curves with polygons (made of straight line segments), and compute polygons parallel to those. See the article Maxim Shemanarev, "Adaptive Subdivision of Bezier Curves" at http://antigrain.com/research/adaptive_bezier/ which explains the difficulties quite well.

I believe vector to pixel rendering engines (such as Postscript interpreters or Cairo or METAFONT) draw thick strokes around paths made of Bezier curves using a similar polygonal approximation, they never compute parallel Bezier curves, though I'm not sure of the details. This is the reason why MetaType1 (a modification of Metapost that outputs type 1 fonts) cannot handle strokes: the type 1 fonts must represent glyphs as cubic Bezier curves. Vector drawing editor programs such as CorelDraw or Inkscape have a feature where they compute the parallel curves as Bezier curve, but I think that's only an approximation, just like how these same drawing programs will convert a circle to a Bezier curve as well, see eg. http://www.angelfire.com/mi/kevincharles/inkscape/p7c7.html .
If you want to search for software approximation stuff, keywords to look for are: Minkowski sum, contour, inset/outset, bloat/shrink, stroke, pen, brush. Sorry if the search keywords are too general, and sorry for giving a reply that doesn't have much mathematics.