300px|thumb|Two definitions of a parallel curve: 1) envelope of a family of congruent circles, 2) by a fixed normal distance
A parallel curve of a given (progenitor) curve is the envelope of a family of congruent (equal-radius) circles centered on the curve.
It generalises the concept of parallel (straight) lines. It can also be defined as a curve whose points are at a constant normal distance from a given curve.
These two definitions are not entirely equivalent as the latter assumes smoothness, whereas the former does not.
In computer-aided design the preferred term for a parallel curve is offset curve. (In other geometric contexts, the term "offset" can also refer to a translation; however, a parallel curve may have a different shape than its progenitor.) Offset curves are important, for example, in numerically controlled (NC) machining, where they describe, for example, the shape of the cut made by a round cutting tool of a two-axis machine. The shape of the cut is offset from the trajectory of the cutter by a constant distance in the direction normal to the cutter trajectory at every point.
In the area of 2D computer graphics known as vector graphics, the (approximate) computation of parallel curves is involved in one of the fundamental drawing operations, called stroking, which is typically applied to polylines or polybeziers (themselves called paths) in that field.
300px|thumb|Parallel curves of the graph of <math>y=1.5 \sin(x)</math> (in red) for distances <math>d = 0.25, \dots, 1.5 </math>
Except in the case of a line or circle, the parallel curves have a more complicated mathematical structure than the progenitor curve.
The notion also generalizes to 3D surfaces, where it is called an offset surface or parallel surface. The opposite operation is sometimes called shelling. Offset surfaces are important in NC, where they describe the shape of the cut made by a ball nose end mill of a three-axis machine. Other shapes of cutting bits can be modelled mathematically by general offset surfaces.
Parallel curve of a parametrically given curve
If there is a regular parametric representation <math> \vec x= (x(t),y(t))</math> of the given curve available, the second definition of a parallel curve (s. above) leads to the following parametric representation of the parallel curve with distance <math> |d| </math>:
:<math> \vec x_d(t)=\vec x(t)+d\vec n(t)</math> with the unit normal <math>\vec n(t)</math>.
In cartesian coordinates:
:<math> x_d(t)= x(t)+\frac{d\; y'(t)}{\sqrt {x'(t)^2+y'(t)^2</math>
:<math> y_d(t)= y(t)-\frac{d\; x'(t)}{\sqrt {x'(t)^2+y'(t)^2 \ .</math>
The distance parameter <math>d</math> may be negative. In this case, one gets a parallel curve on the opposite side of the curve (see diagram on the parallel curves of a circle). One can easily check that a parallel curve of a line is a parallel line in the common sense, and the parallel curve of a circle is a concentric circle.
Geometric properties
Source:
- <math>\vec x'_d(t) \parallel \vec x'(t),\quad</math> that means: the tangent vectors for a fixed parameter are parallel.
- <math>k_d(t)=\frac{k(t)}{1+dk(t)},\quad</math> with <math>k(t)</math> the curvature of the given curve and <math>k_d(t)</math> the curvature of the parallel curve for parameter <math>t</math>.
- <math>R_d(t)=R(t) + d,\quad</math> with <math>R(t)</math> the radius of curvature of the given curve and <math>R_d(t)</math> the radius of curvature of the parallel curve for parameter <math>t</math>.
- When they exist, the osculating circles to parallel curves at corresponding points are concentric.
- As for parallel lines, a normal line to a curve is also normal to its parallels.
- When parallel curves are constructed they will have cusps when the distance from the curve matches the radius of curvature. These are the points where the curve touches the evolute.
- If the progenitor curve is a boundary of a planar set and its parallel curve is without self-intersections, then the latter is the boundary of the Minkowski sum of the planar set and the disk of the given radius.
If the given curve is polynomial (meaning that <math>x(t)</math> and <math>y(t)</math> are polynomials), then the parallel curves are usually not polynomial. In CAD area this is a drawback, because CAD systems use polynomials or rational curves. In order to get at least rational curves, the square root of the representation of the parallel curve has to be solvable. Such curves are called Pythagorean hodograph curves and were investigated by R.T. Farouki.
Parallel curves of an implicit curve
250px|thumb|Parallel curves of the implicit curve (red) with equation <math>x^4+y^4-1=0</math>
Not all implicit curves have parallel curves with analytic representations, but this is possible in some special cases. For instance, the Pythagorean hodograph curves are rational curves with rational parallel curves, which can be converted to implicit representations. Another class of implicit rational curves with rational parallel curves is the parabolas. For the simpler cases of lines and circles the parallel curves can be described easily.
For example:
: Line <math>\; f(x,y)=x+y-1=0\; </math> → distance function: <math>\; h(x,y)=\frac{x+y-1}{\sqrt{2=d\; </math> (Hesse normalform)
: Circle <math>\; f(x,y)=x^2+y^2-1=0\;</math> → distance function: <math>\; h(x,y)=\sqrt{x^2+y^2}-1=d\; .</math>
In general, presuming certain conditions, one can prove the existence of an oriented distance function <math>h(x,y)</math>. In practice one has to treat it numerically. Considering parallel curves the following is true:
- The parallel curve for distance d is the level set <math>h(x,y)=d</math> of the corresponding oriented distance function <math>h</math>.
Properties of the distance function
Source:
- <math>| \operatorname{grad} h (\vec x)|=1 \; ,</math>
- <math> h(\vec x+d\operatorname{grad} h (\vec x)) = h(\vec x)+d \; ,</math>
- <math> \operatorname{grad}h(\vec x+d\operatorname{grad}h (\vec x))= \operatorname{grad}h (\vec x) \; .</math>
Example:<br />
The diagram shows parallel curves of the implicit curve with equation <math>\; f(x,y)=x^4+y^4-1=0\; .</math> <br />
Remark:
The curves <math>\; f(x,y)=x^4+y^4-1=d\; </math> are not parallel curves, because <math>\; | \operatorname{grad} f (x,y)|=1 \;</math> is not true in the area of interest.
Further examples
thumb|Involutes of a circle
- The involutes of a given curve are a set of parallel curves. For example: the involutes of a circle are parallel spirals (see diagram).
And:
- A parabola has as (two-sided) offsets rational curves of degree 6.
- A hyperbola or an ellipse has as (two-sided) offsets an algebraic curve of degree 8.
- A Bézier curve of degree has as (two-sided) offsets algebraic curves of degree . In particular, a cubic Bézier curve has as (two-sided) offsets algebraic curves of degree 10.
Parallel curve to a curve with a corner
thumb|Parallel curves to a curve with a discontinuous normal around a corner
When determining the cutting path of part with a sharp corner for machining, one must define the parallel (offset) curve to a given curve that has a discontinuous normal at the corner. Even though the given curve is not smooth at the sharp corner, its parallel curve may be smooth with a continuous normal, or it may have cusps when the distance from the curve matches the radius of curvature at the sharp corner.
As described above, the parametric representation of a parallel curve, <math>\vec x_d(t)</math>, to a given curver, <math>\vec x(t)</math>, with distance <math>|d|</math> is:
:<math>\vec x_d(t) = \vec x(t) + d\vec n(t)</math> with the unit normal <math>\vec n(t)</math>.
At a sharp corner (<math>t = t_c</math>), the normal to <math>\vec x(t_c)</math> given by <math>\vec n(t_c)</math> is discontinuous, meaning the one-sided limit of the normal from the left <math>\vec n(t_c^-)</math> is unequal to the limit from the right <math>\vec n(t_c^+)</math>. Mathematically,
:<math>\vec n(t_c^-) = \lim_{t \to t_c^-}\vec n(t) \ne \vec n(t_c^+) = \lim_{t \to t_c^+}\vec n(t)</math>.
thumb|Normal fan for defining parallel curves around a sharp corner
However, we can define a normal fan Thus, in practice, approximation techniques are used. Any desired level of accuracy is possible by repeatedly subdividing the curve, though better techniques require fewer subdivisions to attain the same level of accuracy. A 1997 survey by Elber, Lee and Kim is widely cited, though better techniques have been proposed more recently. A modern technique based on curve fitting, with references and comparisons to other algorithms, as well as open source JavaScript source code, was published in a blog post in September 2022.
Another efficient algorithm for offsetting is the level approach described by
Kimmel and Bruckstein (1993).
Parallel (offset) surfaces
thumb|right|Offset surface of a complex irregular shape
Offset surfaces are important in numerically controlled machining, where they describe the shape of the cut made by a ball nose end mill of a three-axis mill.
- <math>{\partial \vec x_d \over \partial u} \parallel {\partial \vec x \over \partial u}, \quad {\partial \vec x_d \over \partial v} \parallel {\partial \vec x \over \partial v}, \quad</math> that means: the tangent vectors for fixed parameters are parallel.
- <math>\vec n_d(u,v) = \pm\vec n(u,v), \quad</math> that means: the normal vectors for fixed parameters match direction.
- <math>S_d = (1 + d S)^{-1} S, \quad</math> where <math>S_d</math> and <math>S</math> are the shape operators for <math>\vec x_d</math> and <math>\vec x</math>, respectively.
:The principal curvatures are the eigenvalues of the shape operator, the principal curvature directions are its eigenvectors, the Gaussian curvature is its determinant, and the mean curvature is half its trace.
- <math>S_d^{-1} = S^{-1} + d I, \quad</math> where <math>S_d^{-1}</math> and <math>S^{-1}</math> are the inverses of the shape operators for <math>\vec x_d</math> and <math>\vec x</math>, respectively.
:The principal radii of curvature are the eigenvalues of the inverse of the shape operator, the principal curvature directions are its eigenvectors, the reciprocal of the Gaussian curvature is its determinant, and the mean radius of curvature is half its trace.
Note the similarity to the geometric properties of parallel curves.
Generalizations
The problem generalizes fairly obviously to higher dimensions e.g. to offset surfaces, and slightly less trivially to pipe surfaces. Note that the terminology for the higher-dimensional versions varies even more widely than in the planar case, e.g. other authors speak of parallel fibers, ribbons, and tubes. For curves embedded in 3D surfaces the offset may be taken along a geodesic.
Another way to generalize it is (even in 2D) to consider a variable distance, e.g. parametrized by another curve.
thumb|An envelope of ellipses forming two general offset curves above and below a given curve
More recently Adobe Illustrator has added somewhat similar facility in version CS5, although the control points for the variable width are visually specified. In contexts where it's important to distinguish between constant and variable distance offsetting the acronyms CDO and VDO are sometimes used.
