If there is a regular parametric representation x → = ( x ( t ) , y ( t ) ) {\displaystyle {\vec {x}}=(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 | {\displaystyle |d|} :
In cartesian coordinates:
The distance parameter d {\displaystyle 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.
If the given curve is polynomial (meaning that x ( t ) {\displaystyle x(t)} and y ( t ) {\displaystyle 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.19
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:
In general, presuming certain conditions, one can prove the existence of an oriented distance function h ( x , y ) {\displaystyle h(x,y)} . In practice one has to treat it numerically.20 Considering parallel curves the following is true:
Example: The diagram shows parallel curves of the implicit curve with equation f ( x , y ) = x 4 + y 4 − 1 = 0 . {\displaystyle \;f(x,y)=x^{4}+y^{4}-1=0\;.} Remark: The curves f ( x , y ) = x 4 + y 4 − 1 = d {\displaystyle \;f(x,y)=x^{4}+y^{4}-1=d\;} are not parallel curves, because | grad f ( x , y ) | = 1 {\displaystyle \;|\operatorname {grad} f(x,y)|=1\;} is not true in the area of interest.
And:23
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.
As described above, the parametric representation of a parallel curve, x → d ( t ) {\displaystyle {\vec {x}}_{d}(t)} , to a given curver, x → ( t ) {\displaystyle {\vec {x}}(t)} , with distance | d | {\displaystyle |d|} is:
At a sharp corner ( t = t c {\displaystyle t=t_{c}} ), the normal to x → ( t c ) {\displaystyle {\vec {x}}(t_{c})} given by n → ( t c ) {\displaystyle {\vec {n}}(t_{c})} is discontinuous, meaning the one-sided limit of the normal from the left n → ( t c − ) {\displaystyle {\vec {n}}(t_{c}^{-})} is unequal to the limit from the right n → ( t c + ) {\displaystyle {\vec {n}}(t_{c}^{+})} . Mathematically,
However, we can define a normal fan24 n → f ( α ) {\displaystyle {\vec {n}}_{f}(\alpha )} that provides an interpolant between n → ( t c − ) {\displaystyle {\vec {n}}(t_{c}^{-})} and n → ( t c + ) {\displaystyle {\vec {n}}(t_{c}^{+})} , and use n → f ( α ) {\displaystyle {\vec {n}}_{f}(\alpha )} in place of n → ( t c ) {\displaystyle {\vec {n}}(t_{c})} at the sharp corner:
The resulting definition of the parallel curve x → d ( t ) {\displaystyle {\vec {x}}_{d}(t)} provides the desired behavior:
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.25 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 Kim26 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 post27 in September 2022.
Another efficient algorithm for offsetting is the level approach described by Kimmel and Bruckstein (1993).28
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.29 If there is a regular parametric representation x → ( u , v ) = ( x ( u , v ) , y ( u , v ) , z ( u , v ) ) {\displaystyle {\vec {x}}(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 | {\displaystyle |d|} :
Distance parameter d {\displaystyle 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.
Note the similarity to the geometric properties of parallel curves.
The problem generalizes fairly obviously to higher dimensions e.g. to offset surfaces, and slightly less trivially to pipe surfaces.31 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.32 For curves embedded in 3D surfaces the offset may be taken along a geodesic.33
Another way to generalize it is (even in 2D) to consider a variable distance, e.g. parametrized by another curve.34 One can for example stroke (envelope) with an ellipse instead of circle35 as it is possible for example in METAFONT.36
More recently Adobe Illustrator has added somewhat similar facility in version CS5, although the control points for the variable width are visually specified.37 In contexts where it's important to distinguish between constant and variable distance offsetting the acronyms CDO and VDO are sometimes used.38
Assume you have a regular parametric representation of a curve, x → ( t ) = ( x ( t ) , y ( t ) ) {\displaystyle {\vec {x}}(t)=(x(t),y(t))} , and you have a second curve that can be parameterized by its unit normal, d → ( n → ) {\displaystyle {\vec {d}}({\vec {n}})} , where the normal of d → ( n → ) = n → {\displaystyle {\vec {d}}({\vec {n}})={\vec {n}}} (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 x → ( t ) {\displaystyle {\vec {x}}(t)} offset by d → ( n → ) {\displaystyle {\vec {d}}({\vec {n}})} is:
Note that the trival offset, d → ( n → ) = d n → {\displaystyle {\vec {d}}({\vec {n}})=d{\vec {n}}} , gives you ordinary parallel (aka, offset) curves.
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.40 Assume you have a regular parametric representation of a surface, x → ( u , v ) = ( x ( u , v ) , y ( u , v ) , z ( u , v ) ) {\displaystyle {\vec {x}}(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, d → ( n → ) {\displaystyle {\vec {d}}({\vec {n}})} , where the normal of d → ( n → ) = n → {\displaystyle {\vec {d}}({\vec {n}})={\vec {n}}} (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 x → ( t ) {\displaystyle {\vec {x}}(t)} offset by d → ( n → ) {\displaystyle {\vec {d}}({\vec {n}})} is:
Note that the trival offset, d → ( n → ) = d n → {\displaystyle {\vec {d}}({\vec {n}})=d{\vec {n}}} , gives you ordinary parallel (aka, offset) surfaces.
Note the similarity to the geometric properties of general offset curves.
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, x → ( u → ) {\displaystyle {\vec {x}}({\vec {u}})} , where the dimension of u → {\displaystyle {\vec {u}}} is n-1. Also assume you have a second n-dimensional surface that can be parameterized by its unit normal, d → ( n → ) {\displaystyle {\vec {d}}({\vec {n}})} , where the normal of d → ( n → ) = n → {\displaystyle {\vec {d}}({\vec {n}})={\vec {n}}} (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 x → ( u → ) {\displaystyle {\vec {x}}({\vec {u}})} offset by d → ( n → ) {\displaystyle {\vec {d}}({\vec {n}})} is:
First, notice that the normal of x → ( u → ) = {\displaystyle {\vec {x}}({\vec {u}})=} the normal of d → ( n → ( u → ) ) = n → ( u → ) , {\displaystyle {\vec {d}}({\vec {n}}({\vec {u}}))={\vec {n}}({\vec {u}}),} by definition. Now, we'll apply the differential w.r.t. u → {\displaystyle {\vec {u}}} to x → d {\displaystyle {\vec {x}}_{d}} , which gives us its tangent vectors spanning its tangent plane.
Notice, the tangent vectors for x → d {\displaystyle {\vec {x}}_{d}} are the sum of tangent vectors for x → ( u → ) {\displaystyle {\vec {x}}({\vec {u}})} and its offset d → ( n → ) {\displaystyle {\vec {d}}({\vec {n}})} , which share the same unit normal. Thus, the general offset surface shares the same tangent plane and normal with x → ( u → ) {\displaystyle {\vec {x}}({\vec {u}})} and d → ( n → ( u → ) ) {\displaystyle {\vec {d}}({\vec {n}}({\vec {u}}))} . That aligns with the nature of envelopes.
We now consider the Weingarten equations for the shape operator, which can be written as ∂ n → = − ∂ x → S {\displaystyle \partial {\vec {n}}=-\partial {\vec {x}}S} . If S {\displaystyle S} is invertable, ∂ x → = − ∂ n → S − 1 {\displaystyle \partial {\vec {x}}=-\partial {\vec {n}}S^{-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 x → d {\displaystyle {\vec {x}}_{d}} , we get:
Next, we use the Weingarten equations again to replace ∂ n → {\displaystyle \partial {\vec {n}}} :
Then, we solve for ∂ x → {\displaystyle \partial {\vec {x}}} and multiple both sides by − S {\displaystyle -S} to get back to the Weingarten equations, this time for ∂ x → d {\displaystyle \partial {\vec {x}}_{d}} :
Thus, S d = ( I + S S n − 1 ) − 1 S {\displaystyle S_{d}=(I+SS_{n}^{-1})^{-1}S} , and inverting both sides gives us, S d − 1 = S − 1 + S n − 1 {\displaystyle S_{d}^{-1}=S^{-1}+S_{n}^{-1}} .
Willson, Frederick Newton (1898). Theoretical and Practical Graphics. Macmillan. p. 66. ISBN 978-1-113-74312-1. {{cite book}}: ISBN / Date incompatibility (help) 978-1-113-74312-1 ↩
Devadoss, Satyan L.; O'Rourke, Joseph (2011). Discrete and Computational Geometry. Princeton University Press. pp. 128–129. ISBN 978-1-4008-3898-1. 978-1-4008-3898-1 ↩
Sendra, J. Rafael; Winkler, Franz; Pérez Díaz, Sonia (2007). Rational Algebraic Curves: A Computer Algebra Approach. Springer Science & Business Media. p. 10. ISBN 978-3-540-73724-7. 978-3-540-73724-7 ↩
Agoston, Max K. (2005). Computer Graphics and Geometric Modelling: Mathematics. Springer Science & Business Media. p. 586. ISBN 978-1-85233-817-6. 978-1-85233-817-6 ↩
Vince, John (2006). Geometry for Computer Graphics: Formulae, Examples and Proofs. Springer Science & Business Media. p. 293. ISBN 978-1-84628-116-7. 978-1-84628-116-7 ↩
Marsh, Duncan (2006). Applied Geometry for Computer Graphics and CAD (2nd ed.). Springer Science & Business Media. p. 107. ISBN 978-1-84628-109-9. 978-1-84628-109-9 ↩
Mark Kilgard (2012-04-10). "CS 354 Vector Graphics & Path Rendering". www.slideshare.net. p. 28. https://www.slideshare.net/Mark_Kilgard/22pathrender ↩
Agoston, Max K. (2005). Computer Graphics and Geometric Modelling. Springer Science & Business Media. pp. 638–645. ISBN 978-1-85233-818-3. 978-1-85233-818-3 ↩
http://www.cc.gatech.edu/~jarek/papers/localVolume.pdf, p. 3 http://www.cc.gatech.edu/~jarek/papers/localVolume.pdf ↩
Faux, I. D.; Pratt, Michael J. (1979). Computational Geometry for Design and Manufacture. Halsted Press. ISBN 978-0-47026-473-7. OCLC 4859052. 978-0-47026-473-7 ↩
Brechner, Eric (1990). Envelopes and tool paths for three-axis end milling (PhD). Rensselaer Polytechnic Institute. ↩
E. Hartmann: Geometry and Algorithms for COMPUTER AIDED DESIGN. S. 30. http://www.mathematik.tu-darmstadt.de/~ehartmann/cdgen0104.pdf ↩
Fiona O'Neill: Planar Bertrand Curves (with Pictures!). https://fionasmathblog.com/2022/04/26/planar-bertrand-curves-with-pictures/ ↩
Rida T. Farouki: Pythagorean-Hodograph Curves: Algebra and Geometry Inseparable (Geometry and Computing). Springer, 2008, ISBN 978-3-540-73397-3. /wiki/ISBN_(identifier) ↩
E. Hartmann: Geometry and Algorithms for COMPUTER AIDED DESIGN. S. 81, S. 30, 41, 44. http://www.mathematik.tu-darmstadt.de/~ehartmann/cdgen0104.pdf ↩
Thorpe, John A. (1994-10-27). Elementary Topics in Differential Geometry. New York Heidelberg: Springer Science & Business Media. ISBN 0-387-90357-7. 0-387-90357-7 ↩
http://faculty.engineering.ucdavis.edu/farouki/wp-content/uploads/sites/41/2013/02/Introduction-to-PH-curves.pdf Archived 2015-06-05 at the Wayback Machine, p. 16 "taxonomy of offset curves" http://faculty.engineering.ucdavis.edu/farouki/wp-content/uploads/sites/41/2013/02/Introduction-to-PH-curves.pdf ↩
Tiller, Wayne; Hanson, Eric (1984). "Offsets of Two-Dimensional Profiles". IEEE Computer Graphics and Applications. 4 (9): 36–46. doi:10.1109/mcg.1984.275995. S2CID 9046817. /wiki/Doi_(identifier) ↩
Elber, Gershon; Lee, In-Kwon; Kim, Myung-Soo (May–Jun 1997). "Comparing offset curve approximation methods". IEEE Computer Graphics and Applications. 17 (3): 62–71. doi:10.1109/38.586019. https://ieeexplore.ieee.org/document/586019 ↩
Levien, Raph (September 9, 2022). "Parallel curves of cubic Béziers". Retrieved September 9, 2022. https://raphlinus.github.io/curves/2022/09/09/parallel-beziers.html ↩
Kimmel, R.; Bruckstein, A.M. (1993). "Shape offsets via level sets" (PDF). Computer-Aided Design. 25 (3). Elsevier BV: 154–162. doi:10.1016/0010-4485(93)90040-u. ISSN 0010-4485. S2CID 8434463. https://www.cs.technion.ac.il/~ron/PAPERS/offsets_cad1993.pdf ↩
Brechner, Eric L. (1992). "5. General Offset Curves and Surfaces". In Barnhill, Robert E. (ed.). Geometry Processing for Design and Manufacturing. SIAM. pp. 101–. ISBN 978-0-89871-280-3. 978-0-89871-280-3 ↩
Pottmann, Helmut; Wallner, Johannes (2001). Computational Line Geometry. Springer Science & Business Media. pp. 303–304. ISBN 978-3-540-42058-3. 978-3-540-42058-3 ↩
Chirikjian, Gregory S. (2009). Stochastic Models, Information Theory, and Lie Groups, Volume 1: Classical Results and Geometric Methods. Springer Science & Business Media. pp. 171–175. ISBN 978-0-8176-4803-9. 978-0-8176-4803-9 ↩
Sarfraz, Muhammad, ed. (2003). Advances in geometric modeling. Wiley. p. 72. ISBN 978-0-470-85937-7. 978-0-470-85937-7 ↩
Kinch, Richard J. (1995). "MetaFog: Converting METAFONT Shapes to Contours" (PDF). TUGboat. 16 (3): 233–243. https://www.tug.org/TUGboat/tb16-3/tb48kinc.pdf ↩
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) http://design.tutsplus.com/tutorials/illustrator-cs5-variable-width-stroke-tool-perfect-for-making-tribal-designs--vector-4346 ↩