Parallel curve explained

A parallel of a curve is the envelope of a family of congruent 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.[1] These two definitions are not entirely equivalent as the latter assumes smoothness, whereas the former does not.[2]

In computer-aided design the preferred term for a parallel curve is offset curve.[2] [3] (In other geometric contexts, the term offset can also refer to translation.[4]) Offset curves are important, for example, in numerically controlled 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.[5]

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.[6]

Except in the case of a line or circle, the parallel curves have a more complicated mathematical structure than the progenitor curve.[1] For example, even if the progenitor curve is smooth, its offsets may not be so; this property is illustrated in the top figure, using a sine curve as progenitor curve.[2] In general, even if a curve is rational, its offsets may not be so. For example, the offsets of a parabola are rational curves, but the offsets of an ellipse or of a hyperbola are not rational, even though these progenitor curves themselves are rational.[7]

The notion also generalizes to 3D surfaces, where it is called an offset surface or parallel surface. Increasing a solid volume by a (constant) distance offset is sometimes called dilation.[8] The opposite operation is sometimes called shelling.[9] 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 machine.[10] Other shapes of cutting bits can be modelled mathematically by general offset surfaces.[11]

Parallel curve of a parametrically given curve

If there is a regular parametric representation

\vecx=(x(t),y(t))

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

|d|

:

\vecxd(t)=\vecx(t)+d\vecn(t)

with the unit normal

\vecn(t)

.In cartesian coordinates:

xd(t)=x(t)+

dy'(t)
\sqrt{x'(t)2+y'(t)2
}

yd(t)=y(t)-

dx'(t)
\sqrt{x'(t)2+y'(t)2
} \ .

The distance parameter

d

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:[12]

\vecx'd(t)\parallel\vecx'(t),

that means: the tangent vectors for a fixed parameter are parallel.
k
d(t)=k(t)
1+dk(t)

,

with

k(t)

the curvature of the given curve and

kd(t)

the curvature of the parallel curve for parameter

t

.

Rd(t)=R(t)+d,

with

R(t)

the radius of curvature of the given curve and

Rd(t)

the radius of curvature of the parallel curve for parameter

t

.

If the given curve is polynomial (meaning that

x(t)

and

y(t)

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.[14]

Parallel curves of an implicit curve

Generally the analytic representation of a parallel curve of an implicit curve is not possible. Only for the simple cases of lines and circles the parallel curves can be described easily.For example:

Line

f(x,y)=x+y-1=0 

→ distance function:

h(x,y)=

x+y-1
\sqrt{2
}=d\; (Hesse normalform)

Circle

f(x,y)=x2+y2-1=0 

→ distance function:

h(x,y)=\sqrt{x2+y2}-1=d.

h(x,y)

. In practice one has to treat it numerically.[15] Considering parallel curves the following is true:

h(x,y)=d

of the corresponding oriented distance function

h

.

Properties of the distance function:[16]

|\operatorname{grad}h(\vecx)|=1,

h(\vecx+d\operatorname{grad}h(\vecx))=h(\vecx)+d,

\operatorname{grad}h(\vecx+d\operatorname{grad}h(\vecx))=\operatorname{grad}h(\vecx).

Example:
The diagram shows parallel curves of the implicit curve with equation

f(x,y)=x4+y4-1=0 .


Remark:The curves

f(x,y)=x4+y4-1=d

are not parallel curves, because

|\operatorname{grad}f(x,y)|=1

is not true in the area of interest.

Further examples

And:[17]

Parallel curve to a curve with a corner

When determining the cutting path of part with a sharp corner for machining, you 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.

Normal fans

As described above, the parametric representation of a parallel curve,

\vecxd(t)

, to a given curver,

\vecx(t)

, with distance

|d|

is:

\vecxd(t)=\vecx(t)+d\vecn(t)

with the unit normal

\vecn(t)

.

At a sharp corner (

t=tc

), the normal to

\vecx(tc)

given by

\vecn(tc)

is discontinuous, meaning the one-sided limit of the normal from the left

\vec

-)
n(t
c
is unequal to the limit from the right

\vec

+)
n(t
c
. Mathematically,

\vec

-)
n(t
c

=

\lim
t\to
-
t
c

\vecn(t)\ne\vec

+)
n(t
c

=

\lim
t\to
+
t
c

\vecn(t)

.

However, we can define a normal fan[11]

\vecnf(\alpha)

that provides an interpolant between

\vec

-)
n(t
c
and

\vec

+)
n(t
c
, and use

\vecnf(\alpha)

in place of

\vecn(tc)

at the sharp corner:

\vecnf(\alpha)=

(1-\alpha)\vec
-)
n(t
c
+\alpha\vec
+)
n(t
c
\lVert(1-\alpha)\vec
-)
n(t
c
+\alpha\vec
+)
n(t
c
\rVert

,

where

0<\alpha<1

.

The resulting definition of the parallel curve

\vecxd(t)

provides the desired behavior:

\vecxd(t)=\begin{cases} \vecx(t)+d\vecn(t),&ift<tcort>tc\\ \vecx(tc)+d\vecnf(\alpha),&ift=tcwhere0<\alpha<1 \end{cases}

Algorithms

In general, the parallel curve of a Bézier curve is not another Bézier curve, a result proved by Tiller and Hanson in 1984.[18] 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[19] 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[20] in September 2022.

Another efficient algorithm for offsetting is the level approach described byKimmel and Bruckstein (1993).[21]

Parallel (offset) surfaces

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.[10] If there is a regular parametric representation

\vecx(u,v)=(x(u,v),y(u,v),z(u,v))

of the given surface available, the second definition of a parallel curve (see above) generalizes to the following parametric representation of the parallel surface with distance

|d|

:

\vecxd(u,v)=\vecx(u,v)+d\vecn(u,v)

with the unit normal

\vecnd(u,v)={{{\partial\vecx\over\partialu} x {\partial\vecx\over\partialv}}\over{|{{\partial\vecx\over\partialu} x {\partial\vecx\over\partialv}}|}}

.

Distance parameter

d

may be negative, too. In this case one gets a parallel surface on the opposite side of the surface (see similar diagram on the parallel curves of a circle). One easily checks: a parallel surface of a plane is a parallel plane in the common sense and the parallel surface of a sphere is a concentric sphere.

Geometric properties:[22]

{\partial\vecxd\over\partialu}\parallel{\partial\vecx\over\partialu},{\partial\vecxd\over\partialv}\parallel{\partial\vecx\over\partialv},

that means: the tangent vectors for fixed parameters are parallel.

\vecnd(u,v)=\pm\vecn(u,v),

that means: the normal vectors for fixed parameters match direction.

Sd=(1+dS)-1S,

where

Sd

and

S

are the shape operators for

\vecxd

and

\vecx

, 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.

-1
S
d

=S-1+dI,

where
-1
S
d
and

S-1

are the inverses of the shape operators for

\vecxd

and

\vecx

, 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.[23] 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.[24] For curves embedded in 3D surfaces the offset may be taken along a geodesic.[25]

Another way to generalize it is (even in 2D) to consider a variable distance, e.g. parametrized by another curve.[22] One can for example stroke (envelope) with an ellipse instead of circle[22] as it is possible for example in METAFONT.[26] More recently Adobe Illustrator has added somewhat similar facility in version CS5, although the control points for the variable width are visually specified.[27] In contexts where it's important to distinguish between constant and variable distance offsetting the acronyms CDO and VDO are sometimes used.[8]

General offset curves

Assume you have a regular parametric representation of a curve,

\vecx(t)=(x(t),y(t))

, and you have a second curve that can be parameterized by its unit normal,

\vecd(\vecn)

, where the normal of

\vecd(\vecn)=\vecn

(this parameterization by normal exists for curves whose curvature is strictly positive or negative, and thus convex, smooth, and not straight). The parametric representation of the general offset curve of

\vecx(t)

offset by

\vecd(\vecn)

is:

\vecxd(t)=\vecx(t)+\vecd(\vecn(t)),

where

\vecn(t)

is the unit normal of

\vecx(t)

.Note that the trival offset,

\vecd(\vecn)=d\vecn

, gives you ordinary parallel (aka, offset) curves.

Geometric properties:[22]

\vecx'd(t)\parallel\vecx'(t),

that means: the tangent vectors for a fixed parameter are parallel.

kd(t)=\dfrac{k(t)}{1+\dfrac{k(t)}{kn(t)}},

with

kd(t)

the curvature of the general offset curve,

k(t)

the curvature of

\vecx(t)

, and

kn(t)

the curvature of

\vecd(\vecn(t))

for parameter

t

.

Rd(t)=R(t)+Rn(t),

with

Rd(t)

the radius of curvature of the general offset curve,

R(t)

the radius of curvature of

\vecx(t)

, and

Rn(t)

the radius of curvature of

\vecd(\vecn(t))

for parameter

t

.

General offset surfaces

General offset surfaces describe the shape of cuts made by a variety of cutting bits used by three-axis end mills in numerically controlled machining.[11] Assume you have a regular parametric representation of a surface,

\vecx(u,v)=(x(u,v),y(u,v),z(u,v))

, and you have a second surface that can be parameterized by its unit normal,

\vecd(\vecn)

, where the normal of

\vecd(\vecn)=\vecn

(this parameterization by normal exists for surfaces whose Gaussian curvature is strictly positive, and thus convex, smooth, and not flat). The parametric representation of the general offset surface of

\vecx(t)

offset by

\vecd(\vecn)

is:

\vecxd(u,v)=\vecx(u,v)+\vecd(\vecn(u,v)),

where

\vecn(u,v)

is the unit normal of

\vecx(u,v)

.Note that the trival offset,

\vecd(\vecn)=d\vecn

, gives you ordinary parallel (aka, offset) surfaces.

Geometric properties:[22]

Sd=(1+

-1
SS
n

)-1S,

where

Sd,S,

and

Sn

are the shape operators for

\vecxd,\vecx,

and

\vecd(\vecn)

, 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.

-1
S
d

=S-1+

-1
S
n

,

where
-1
S
d

,S-1

and
-1
S
n
are the inverses of the shape operators for

\vecxd,\vecx,

and

\vecd(\vecn)

, 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 general offset curves.

Derivation of geometric properties for general offsets

The geometric properties listed above for general offset curves and surfaces can be derived for offsets of arbitrary dimension. Assume you have a regular parametric representation of an n-dimensional surface,

\vecx(\vecu)

, where the dimension of

\vecu

is n-1. Also assume you have a second n-dimensional surface that can be parameterized by its unit normal,

\vecd(\vecn)

, where the normal of

\vecd(\vecn)=\vecn

(this parameterization by normal exists for surfaces whose Gaussian curvature is strictly positive, and thus convex, smooth, and not flat). The parametric representation of the general offset surface of

\vecx(\vecu)

offset by

\vecd(\vecn)

is:

\vecxd(\vecu)=\vecx(\vecu)+\vecd(\vecn(\vecu)),

where

\vecn(\vecu)

is the unit normal of

\vecx(\vecu)

. (The trival offset,

\vecd(\vecn)=d\vecn

, gives you ordinary parallel surfaces.)

First, notice that the normal of

\vecx(\vecu)=

the normal of

\vecd(\vecn(\vecu))=\vecn(\vecu),

by definition. Now, we'll apply the differential w.r.t.

\vecu

to

\vecxd

, which gives us its tangent vectors spanning its tangent plane.

\partial\vecxd(\vecu)=\partial\vecx(\vecu)+\partial\vecd(\vecn(\vecu))

Notice, the tangent vectors for

\vecxd

are the sum of tangent vectors for

\vecx(\vecu)

and its offset

\vecd(\vecn)

, which share the same unit normal. Thus, the general offset surface shares the same tangent plane and normal with

\vecx(\vecu)

and

\vecd(\vecn(\vecu))

. That aligns with the nature of envelopes.

We now consider the Weingarten equations for the shape operator, which can be written as

\partial\vecn=-\partial\vecxS

. If

S

is invertable,

\partial\vecx=-\partial\vecnS-1

. Recall that the principal curvatures of a surface are the eigenvalues of the shape operator, the principal curvature directions are its eigenvectors, the Gauss curvature is its determinant, and the mean curvature is half its trace. The inverse of the shape operator holds these same values for the radii of curvature.

Substituting into the equation for the differential of

\vecxd

, we get:

\partial\vecxd=\partial\vecx-\partial\vecn

-1
S
n

,

where

Sn

is the shape operator for

\vecd(\vecn(\vecu))

.

Next, we use the Weingarten equations again to replace

\partial\vecn

:

\partial\vecxd=\partial\vecx+\partial\vecxS

-1
S
n

,

where

S

is the shape operator for

\vecx(\vecu)

.

Then, we solve for

\partial\vecx

and multiple both sides by

-S

to get back to the Weingarten equations, this time for

\partial\vecxd

:

\partial\vecxd(I+S

-1
S
n

)-1=\partial\vecx,

-\partial\vecxd(I+S

-1
S
n

)-1S=-\partial\vecxS=\partial\vecn.

Thus,

Sd=(I+S

-1
S
n

)-1S

, and inverting both sides gives us,
-1
S
d

=S-1+

-1
S
n
.

See also

References

Further reading

External links

Notes and References

  1. Book: Theoretical and Practical Graphics. Frederick Newton. Willson. Macmillan. 1898. 978-1-113-74312-1. 66.
  2. Book: Satyan L.. Devadoss. Satyan Devadoss . Joseph . O'Rourke. Joseph O'Rourke (professor). Discrete and Computational Geometry. 2011. Princeton University Press. 978-1-4008-3898-1. 128–129.
  3. Book: Agoston, Max K.. Computer Graphics and Geometric Modelling: Mathematics. 2005. Springer Science & Business Media. 978-1-85233-817-6. 586.
  4. Book: Vince, John. Geometry for Computer Graphics: Formulae, Examples and Proofs. 2006. Springer Science & Business Media. 978-1-84628-116-7. 293.
  5. Book: Marsh, Duncan. Applied Geometry for Computer Graphics and CAD. 2006. Springer Science & Business Media. 978-1-84628-109-9. 107. 2nd.
  6. Web site: Mark Kilgard . CS 354 Vector Graphics & Path Rendering . www.slideshare.net . 2012-04-10 . 28.
  7. Book: J. Rafael . Sendra. Franz. Winkler. Sonia . Pérez Díaz. Rational Algebraic Curves: A Computer Algebra Approach. 2007. Springer Science & Business Media. 978-3-540-73724-7. 10.
  8. http://www.cc.gatech.edu/~jarek/papers/localVolume.pdf, p. 3
  9. Book: Agoston, Max K.. Computer Graphics and Geometric Modelling. 2005. Springer Science & Business Media. 978-1-85233-818-3. 638–645.
  10. Book: I. D.. Faux. Michael J.. Pratt. Computational Geometry for Design and Manufacture. 1979. Halsted Press. 978-0-47026-473-7. 4859052.
  11. Brechner. Eric. 1990. Envelopes and tool paths for three-axis end milling. PhD. Rensselaer Polytechnic Institute.
  12. E. Hartmann: Geometry and Algorithms for COMPUTER AIDED DESIGN. S. 30.
  13. Fiona O'Neill: Planar Bertrand Curves (with Pictures!).
  14. Rida T. Farouki:Pythagorean-Hodograph Curves: Algebra and Geometry Inseparable (Geometry and Computing). Springer, 2008, .
  15. E. Hartmann: Geometry and Algorithms for COMPUTER AIDED DESIGN. S. 81, S. 30, 41, 44.
  16. Book: Thorpe, John A. . Elementary Topics in Differential Geometry . Springer Science & Business Media . New York Heidelberg . 1994-10-27 . 0-387-90357-7 .
  17. http://faculty.engineering.ucdavis.edu/farouki/wp-content/uploads/sites/41/2013/02/Introduction-to-PH-curves.pdf, p. 16 "taxonomy of offset curves"
  18. Tiller . Wayne . Hanson . Eric . Offsets of Two-Dimensional Profiles . IEEE Computer Graphics and Applications . 1984 . 4 . 9 . 36–46 . 10.1109/mcg.1984.275995. 9046817 .
  19. Elber . Gershon . Lee . In-Kwon . Kim . Myung-Soo . Comparing offset curve approximation methods . 10.1109/38.586019 . IEEE Computer Graphics and Applications . 17 . 3 . 62–71 . May–Jun 1997.
  20. Web site: Parallel curves of cubic Béziers . Levien . Raph . September 9, 2022 . September 9, 2022.
  21. Kimmel . R. . Bruckstein . A.M. . Shape offsets via level sets . Computer-Aided Design . Elsevier BV . 25 . 3 . 1993 . 0010-4485 . 10.1016/0010-4485(93)90040-u . 154–162 . 8434463 .
  22. Book: Brechner, Eric L.. Robert E.. Barnhill. Geometry Processing for Design and Manufacturing. 1992. SIAM. 978-0-89871-280-3. 5. General Offset Curves and Surfaces. 101–.
  23. Book: Helmut. Pottmann. Johannes. Wallner. Computational Line Geometry. 2001. Springer Science & Business Media. 978-3-540-42058-3. 303–304.
  24. Book: Chirikjian, Gregory S.. Gregory S. Chirikjian. Stochastic Models, Information Theory, and Lie Groups, Volume 1: Classical Results and Geometric Methods. 2009. Springer Science & Business Media. 978-0-8176-4803-9. 171–175.
  25. Book: Muhammad. Sarfraz. Advances in geometric modeling. 2003. Wiley. 978-0-470-85937-7. 72.
  26. https://www.tug.org/TUGboat/tb16-3/tb48kinc.pdf
  27. http://design.tutsplus.com/tutorials/illustrator-cs5-variable-width-stroke-tool-perfect-for-making-tribal-designs--vector-4346 application of the generalized version in Adobe Illustrator CS5 (also video)