Parallel curve: Difference between revisions

Content deleted Content added
No edit summary
Tags: Mobile edit Mobile app edit iOS app edit
 
(25 intermediate revisions by 18 users not shown)
Line 1:
{{Short description|Generalization of the concept of parallel lines}}
{{Distinguish|parallel transport}}
[[File:Offset-curves-of-sinus-curve.svg|300px|thumb|Parallel curves of the graph of <math>y=1.5 \sin(x)</math> for distances <math>d = 0.25, \dots, 1.5 </math>]]
[[File:Offset-definition-poss.svg|300px|thumb|Two definitions of a parallel curve: 1) envelope of a family of congruent circles, 2) by a fixed normal distance]]
[[File:Offset-of-a-circle.svg|thumb|The parallel curves of a circle (red) are circles, too]]
 
A '''parallel curve''' of a given (progenitor) [[curve]] is the [[envelope (mathematics)|envelope]] of a family of [[Congruence (geometry)|congruent]] (equal-radius) [[circle]]s centered on the curve.
It generalises the concept of ''[[parallel (geometry)|parallel (straight) lines]]''. It can also be defined as a curve whose points are at a constant ''[[normal distance]]'' from a given curve.<ref name="Willson">{{cite book
|title=Theoretical and Practical Graphics
Line 17 ⟶ 16:
These two definitions are not entirely equivalent as the latter assumes [[smoothness]], whereas the former does not.<ref name="DevadossO'Rourke2011">{{cite book|first1=Satyan L.|last1= Devadoss|author1-link= Satyan Devadoss |first2=Joseph |last2=O'Rourke|author2-link=Joseph O'Rourke (professor)|title=Discrete and Computational Geometry|url=https://books.google.com/books?id=InJL6iAaIQQC&pg=PA128|year=2011|publisher=Princeton University Press|isbn=978-1-4008-3898-1|pages=128–129}}</ref>
 
[[File:Offset-of-a-circle.svg|thumb|The parallel curves of a circle (red) are circles,concentric toocircles]]
In [[computer-aided design]] the preferred term for a parallel curve is '''offset curve'''.<ref name="DevadossO'Rourke2011"/><ref name="SendraWinkler2007"/><ref name="Agoston2005m">{{cite book|first=Max K.|last= Agoston|title=Computer Graphics and Geometric Modelling: Mathematics|url=https://books.google.com/books?id=LPsAM-xuGG8C&pg=PA586|year=2005|publisher=Springer Science & Business Media|isbn=978-1-85233-817-6|page=586}}</ref> (In other geometric contexts, the term [[offset (disambiguation)|the term "offset"]] can also refer to a [[Translation (geometry)|translation]]; however, a parallel curve may have a different [[shape (geometry)|shape]] than its progenitor.<ref name="Vince2006">{{cite book|first=John|last=Vince|title=Geometry for Computer Graphics: Formulae, Examples and Proofs|url=https://books.google.com/books?id=VkzklwKLv7UC&pg=PA293|year=2006|publisher=Springer Science & Business Media|isbn=978-1-84628-116-7|page=293}}</ref>) 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.<ref name="Marsh2006">{{cite book|first=Duncan|last=Marsh|title=Applied Geometry for Computer Graphics and CAD|url=https://books.google.com/books?id=5wHxT5W424QC&pg=PA107|year=2006|publisher=Springer Science & Business Media|isbn=978-1-84628-109-9|page=107|edition=2nd}}</ref>
 
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 [[polyline]]s or [[polybezier]]s (themselves called paths) in that field.<ref name="Kilgard">http{{cite web |author=Mark Kilgard | title=CS 354 Vector Graphics & Path Rendering | website=www.slideshare.net | date=2012-04-10 | url=https://www.slideshare.net/Mark_Kilgard/22pathrender, p. |page=28}}</ref>
 
[[File:Offset-curves-of-sinus-curve.svg|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.<ref name="Willson"/> For example, even if the progenitor curve is [[Smooth function|smooth]], its offsets may not be so; this property is illustrated in the top figure, using a [[sine curve]] as progenitor curve.<ref name="DevadossO'Rourke2011"/> In general, even if a curve is [[rational curve|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.<ref name="SendraWinkler2007">{{cite book|first1=J. Rafael |last1=Sendra|first2=Franz|last2= Winkler|first3=Sonia |last3=Pérez Díaz|title=Rational Algebraic Curves: A Computer Algebra Approach|url=https://books.google.com/books?id=puWxs7KG2D0C&pg=PA10|year=2007|publisher=Springer Science & Business Media|isbn=978-3-540-73724-7|page=10}}</ref>
 
The notion also generalizes to 3D [[surface (mathematics)|surface]]s, where it is called an '''offset surface''' or '''parallel surface'''.<ref name="Agoston2005"/> Increasing a [[solid (geometry)|solid]] volume by a (constant) distance offset is sometimes called ''dilation'' (similar to the [[dilation (morphology)|dilation]] image operation).<ref name="jarek">http://www.cc.gatech.edu/~jarek/papers/localVolume.pdf, p. 3</ref> The opposite operation is sometimes called ''shelling''.<ref name="Agoston2005">{{cite book|first=Max K.|last= Agoston|title=Computer Graphics and Geometric Modelling|url=https://books.google.com/books?id=fGX8yC-4vXUC&pg=PA645|year=2005|publisher=Springer Science & Business Media|isbn=978-1-85233-818-3|pages=638–645}}</ref> Offset surfaces are important in [[numerically controlled]] [[machining]]NC, where they describe the shape of the cut made by a ball nose end mill of a three-axis machine.<ref name="Faux1979">{{cite book|first1=I. D.|last1=Faux|first2=Michael J.|last2=Pratt|title=Computational Geometry for Design and Manufacture|year=1979|publisher=Halsted Press|isbn=978-0-47026-473-7|oclc=4859052}}</ref> Other shapes of cutting bits can be modelled mathematically by general offset surfaces.<ref name="Brechner1990">{{cite thesis |last=Brechner|first=Eric|date=1990|title=Envelopes and tool paths for three-axis end milling|type=PhD|publisher=Rensselaer Polytechnic Institute}}</ref>
 
== Parallel curve of a parametrically given curve ==
Line 33 ⟶ 34:
:<math> y_d(t)= y(t)-\frac{d\; x'(t)}{\sqrt {x'(t)^2+y'(t)^2}} \ .</math>
 
The dstancedistance parameter <math>d</math> may be negative, too. 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:<ref name="hart30">E. Hartmann: [http://www.mathematik.tu-darmstadt.de/~ehartmann/cdgen0104.pdf ''Geometry and Algorithms for COMPUTER AIDED DESIGN.''] S. 30.</ref>===
Line 39 ⟶ 40:
*<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 [[curvature#Curvature of plane curves|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 circle|osculating circles]] to parallel curves at corresponding points are concentric. <ref>Fiona O'Neill: [https://fionasmathblog.com/2022/04/26/planar-bertrand-curves-with-pictures/ ''Planar Bertrand Curves (with Pictures!).''] {{Webarchive|url=https://web.archive.org/web/20221011143632/https://fionasmathblog.com/2022/04/26/planar-bertrand-curves-with-pictures/ |date=2022-10-11 }}</ref>
*As for [[parallel (geometry)|parallel lines]], a normal line to a curve is also normal to its parallels.
*When parallel curves are constructed they will have [[Cusp (singularity)|cusp]]s 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[[Pythagorean hodograph curves''curve]]s and were investigated by R.T. Farouki.<ref>Rida T. Farouki:
''Pythagorean-Hodograph Curves: Algebra and Geometry Inseparable (Geometry and Computing).'' Springer, 2008, {{ISBN|978-3-540-73397-3}}.</ref>
 
== Parallel curves of an implicit curve ==
[[File:Offset-of-implicit-curve-c4.svg|250px|thumb|Parallel curves of the implicit curve (red) with equation <math>x^4+y^4-1=0</math>]]
GenerallyNot theall [[implicit curve]]s have parallel curves with analytic representationrepresentations, ofbut athis parallelis curvepossible ofin ansome special cases. For instance, the [[implicitPythagorean hodograph curve]]s 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 notthe possible[[parabola]]s.{{sfn|Farouki|2008|pp=216–217, Only448}} forFor the simplesimpler 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)
Line 57 ⟶ 58:
* 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:<ref name="hart30" /><ref>J.{{cite book | last=Thorpe | first=John A. Thorpe:| ''title=Elementary topicsTopics in Differential Geometry'', | publisher=Springer Science & Business Media | publication-Verlag,place=New 1979,York Heidelberg {{ISBN| date=1994-10-27 | isbn=0-387-90357-7 | page=}}.</ref>===
*<math>| \operatorname{grad} h (\vec x)|=1 \; ,</math>
* <math> h(\vec x+d\operatorname{grad} h (\vec x)) = h(\vec x)+d \; ,</math>
Line 71 ⟶ 72:
*The [[involute]]s of a given curve are a set of parallel curves. For example: the involutes of a circle are parallel spirals (see diagram).
 
And:<ref name="farouki-slides">http://faculty.engineering.ucdavis.edu/farouki/wp-content/uploads/sites/41/2013/02/Introduction-to-PH-curves.pdf {{Webarchive|url=https://web.archive.org/web/20150605214546/http://faculty.engineering.ucdavis.edu/farouki/wp-content/uploads/sites/41/2013/02/Introduction-to-PH-curves.pdf |date=2015-06-05 }}, p. 16 "taxonomy of offset curves"</ref>
* A [[parabola]] has as (two-sided) offsets [[rational curve]]s 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 {{mvar|n}} has as (two-sided) offsets [[algebraic curve]]s of degree {{math|4''n'' − 2}}. In particular, a cubic BezierBézier curve has as (two-sided) offsets algebraic curves of degree 10.
 
==Parallel curve to a curve with a corner==
Line 101 ⟶ 102:
{{expand section|date=August 2014}}
 
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.<ref>{{cite journal |last1=Tiller |first1=Wayne |last2=Hanson |first2=Eric |title=Offsets of Two-Dimensional Profiles |journal=IEEE Computer Graphics and Applications |year=1984 |volume=4 |issue=9 |pages=36-4636–46 |doi=10.1109/mcg.1984.275995|s2cid=9046817 }}</ref> 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<ref>{{cite journal |last1=Elber |first1=Gershon |last2=Lee |first2=In-Kwon |last3=Kim |first3=Myung-Soo
|url=https://ieeexplore.ieee.org/document/586019/ |doi=10.1109/38.586019 |title=Comparing offset curve approximation methods |journal=IEEE Computer Graphics and Applications |volume=17 |issue=3 |pages=62-7162–71 |date=May–Jun 1997}}</ref> 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<ref>{{cite web |url=https://raphlinus.github.io/curves/2022/09/09/parallel-beziers.html |title=Parallel curves of cubic Béziers |last=Levien |first=Raph |date=September 9, 2022 |access-date=September 9, 2022}}</ref> in September 2022.
 
Another efficient algorithm for offsetting is the level approach described by
[[Ron Kimmel|Kimmel]] and Bruckstein (1993).<ref>{{cite journal | last1=Kimmel | first1=R. | last2=Bruckstein | first2=A.M. | title=Shape offsets via level sets | journal=Computer-Aided Design | publisher=Elsevier BV | volume=25 | issue=3 | year=1993 | issn=0010-4485 | doi=10.1016/0010-4485(93)90040-u | pages=154–162 | s2cid=8434463 |url=https://www.cs.technion.ac.il/~ron/PAPERS/offsets_cad1993.pdf}}</ref>
[[Ron Kimmel|Kimmel]] and Bruckstein (1993).<ref>Kimmel and Bruckstein (1993)
[https://www.cs.technion.ac.il/~ron/PAPERS/offsets_cad1993.pdf ''Shape offsets via level sets'' ]
CAD (Computer Aided Design)
25(3):154&ndash;162.
</ref>
 
== Parallel (offset) surfaces ==
Line 129 ⟶ 126:
 
== Generalizations ==
The problem generalizes fairly obviously to higher dimensions e.g. to offset surfaces, and slightly less trivially to [[pipe surface]]s.<ref name="PottmannWallner2001">{{cite book|first1=Helmut|last1=Pottmann|first2=Johannes|last2=Wallner|title=Computational Line Geometry|url=https://books.google.com/books?id=6ZrqcYKgtE0C&pg=PA303|year=2001|publisher=Springer Science & Business Media|isbn=978-3-540-42058-3|pages=303–304}}</ref> 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.<ref name="Chirikjian2009">{{cite book|author1-link=Gregory S. Chirikjian|first=Gregory S.|last=Chirikjian|title=Stochastic Models, Information Theory, and Lie Groups, Volume 1: Classical Results and Geometric Methods|year=2009|publisher=Springer Science & Business Media|isbn=978-0-8176-4803-9|pages=171–175}}</ref> For curves embedded in 3D surfaces the offset may be taken along a [[geodesic]].<ref name="Sarfraz2003">{{cite book|editor-first=Muhammad|editor-last=Sarfraz|title=Advances in geometric modeling|url=https://books.google.com/books?id=kfZQAAAAMAAJ&pg=PA72|year=2003|publisher=Wiley|isbn=978-0-470-85937-7|page=72}}</ref>
 
Another way to generalize it is (even in 2D) to consider a variable distance, e.g. parametrized by another curve.<ref name="barn"/> One can for example stroke (envelope) with an ellipse instead of circle<ref name="barn"/> as it is possible for example in [[METAFONT]].<ref>{{Cite journal |last=Kinch |first=Richard J. |date=1995 |title=MetaFog: Converting METAFONT Shapes to Contours |url=https://www.tug.org/TUGboat/tb16-3/tb48kinc.pdf {{Bare|journal=TUGboat URL|volume=16 PDF|dateissue=March3 2022|pages=233–243}}</ref>
[[File:Envelope of ellipses.png|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.<ref>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 [http://tv.adobe.com/watch/learn-illustrator-cs5/using-variablewidth-strokes/ video])</ref> In contexts where it's important to distinguish between constant and variable distance offsetting the acronyms CDO and VDO are sometimes used.<ref name="jarek"/>
Line 210 ⟶ 207:
*[http://mathworld.wolfram.com/ParallelCurves.html Parallel curves on MathWorld]
*[http://xahlee.org/SpecialPlaneCurves_dir/Parallel_dir/parallel.html Visual Dictionary of Plane Curves] Xah Lee
* http://library.imageworks.com/pdfs/imageworks-library-offset-curve-deformation-from-Skeletal-Anima.pdf application to animation; patented as http://www.google.com/patents/US8400455
* http://www2.uah.es/fsegundo/Otros/Offset/16-SanSegundoSendraSendra-1532.pdf
 
{{Differential transforms of plane curves}}