Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Bézier curve

From Wikipedia, the free encyclopedia
Curve used in computer graphics and related fields
Cubic Bézier curve with four control points
Thebasis functions on the ranget in [0,1] for cubic Bézier curves:blue:y = (1 −t)3,green:y = 3(1 −t)2t,red:y = 3(1 −t)t2, andcyan:y =t3.

ABézier curve (/ˈbɛz.i./BEH-zee-ay,[1]French pronunciation:[bezje]) is aparametric curve used incomputer graphics and related fields.[2] A set of discrete "control points" defines a smooth, continuous curve by means of a formula. Usually the curve is intended to approximate a real-world shape that otherwise has no mathematical representation or whose representation is unknown or too complicated. The Bézier curve is named afterFrench engineerPierre Bézier (1910–1999), who used it in the 1960s for designing curves for the bodywork ofRenault cars.[3] Other uses include the design of computerfonts and animation.[3] Bézier curves can be combined to form aBézier spline, or generalized to higher dimensions to formBézier surfaces.[3] TheBézier triangle is a special case of the latter.

Invector graphics, Bézier curves are used to model smooth curves that can be scaled indefinitely. "Paths", as they are commonly referred to in image manipulation programs,[note 1] are combinations of linked Bézier curves. Paths are not bound by the limits ofrasterized images and are intuitive to modify.

Bézier curves are also used in the time domain, particularly inanimation,[4][note 2]user interface design and smoothing cursor trajectory in eye gaze controlled interfaces.[5] For example, a Bézier curve can be used to specify the velocity over time of an object such as an icon moving from A to B, rather than simply moving at a fixed number of pixels per step. When animators orinterface designers talk about the "physics" or "feel" of an operation, they may be referring to the particular Bézier curve used to control the velocity over time of the move in question.

This also applies to robotics where the motion of a welding arm, for example, should be smooth to avoid unnecessary wear.

Invention

[edit]

The mathematical basis for Bézier curves—theBernstein polynomials—was established in 1912, but thepolynomials were not applied to graphics until some 50 years later when mathematicianPaul de Casteljau in 1959 developedde Casteljau's algorithm, anumerically stable method for evaluating the curves, and became the first to apply them tocomputer-aided design at French automakerCitroën.[6] De Casteljau's method was patented in France but not published until the 1980s[7] while the Bézier polynomials were widely publicised in the 1960s by theFrench engineerPierre Bézier, who discovered them independently and used them to designautomobile bodies atRenault.

Specific cases

[edit]

A Bézier curve is defined by aset ofcontrol pointsP0 throughPn, wheren is called the order of the curve (n = 1 for linear, 2 for quadratic, 3 for cubic, etc.). The first and last control points are always the endpoints of the curve; however, the intermediate control points generally do not lie on the curve. The sums in the following sections are to be understood asaffine combinations – that is, the coefficients sum to 1.

Linear Bézier curves

[edit]

Given distinct pointsP0 andP1, a linear Bézier curve is simply aline between those two points. The curve is given by

B(t)=P0+t(P1P0)=(1t)P0+tP1, 0t1{\displaystyle \mathbf {B} (t)=\mathbf {P} _{0}+t(\mathbf {P} _{1}-\mathbf {P} _{0})=(1-t)\mathbf {P} _{0}+t\mathbf {P} _{1},\ 0\leq t\leq 1}

This is the simplest and is equivalent tolinear interpolation.[8] The quantityP1P0{\displaystyle \mathbf {P} _{1}-\mathbf {P} _{0}} represents thedisplacement vector from the start point to the end point.

Quadratic Bézier curves

[edit]
Quadratic Béziers instring art: The end points () and control point (×) define the quadratic Bézier curve ().

A quadratic Bézier curve is the path traced by thefunctionB(t), given pointsP0,P1, andP2,

B(t)=(1t)[(1t)P0+tP1]+t[(1t)P1+tP2], 0t1{\displaystyle \mathbf {B} (t)=(1-t)[(1-t)\mathbf {P} _{0}+t\mathbf {P} _{1}]+t[(1-t)\mathbf {P} _{1}+t\mathbf {P} _{2}],\ 0\leq t\leq 1},

which can be interpreted as thelinear interpolant of corresponding points on the linear Bézier curves fromP0 toP1 and fromP1 toP2 respectively. Rearranging the preceding equation yields:

B(t)=(1t)2P0+2(1t)tP1+t2P2, 0t1.{\displaystyle \mathbf {B} (t)=(1-t)^{2}\mathbf {P} _{0}+2(1-t)t\mathbf {P} _{1}+t^{2}\mathbf {P} _{2},\ 0\leq t\leq 1.}

This can be written in a way that highlights the symmetry with respect toP1:

B(t)=P1+(1t)2(P0P1)+t2(P2P1), 0t1.{\displaystyle \mathbf {B} (t)=\mathbf {P} _{1}+(1-t)^{2}(\mathbf {P} _{0}-\mathbf {P} _{1})+t^{2}(\mathbf {P} _{2}-\mathbf {P} _{1}),\ 0\leq t\leq 1.}

Which immediately gives thederivative of the Bézier curve with respect tot:

B(t)=2(1t)(P1P0)+2t(P2P1),{\displaystyle \mathbf {B} '(t)=2(1-t)(\mathbf {P} _{1}-\mathbf {P} _{0})+2t(\mathbf {P} _{2}-\mathbf {P} _{1}),}

from which it can be concluded that thetangents to the curve atP0 andP2 intersect atP1. Ast increases from 0 to 1, the curve departs fromP0 in the direction ofP1, then bends to arrive atP2 from the direction ofP1.

The second derivative of the Bézier curve with respect tot is

B(t)=2(P22P1+P0).{\displaystyle \mathbf {B} ''(t)=2(\mathbf {P} _{2}-2\mathbf {P} _{1}+\mathbf {P} _{0}).}

Cubic Bézier curves

[edit]

Four pointsP0,P1,P2 andP3 in the plane or in higher-dimensional space define a cubic Bézier curve.The curve starts atP0 going towardP1 and arrives atP3 coming from the direction ofP2. Usually, it will not pass throughP1 orP2; these points are only there to provide directional information. The distance betweenP1 andP2 determines "how far" and "how fast" the curve moves towardsP1 before turning towardsP2.

WritingBPi,Pj,Pk(t) for the quadratic Bézier curve defined by pointsPi,Pj, andPk, the cubic Bézier curve can be defined as an affine combination of two quadratic Bézier curves:

B(t)=(1t)BP0,P1,P2(t)+tBP1,P2,P3(t), 0t1.{\displaystyle \mathbf {B} (t)=(1-t)\mathbf {B} _{\mathbf {P} _{0},\mathbf {P} _{1},\mathbf {P} _{2}}(t)+t\mathbf {B} _{\mathbf {P} _{1},\mathbf {P} _{2},\mathbf {P} _{3}}(t),\ 0\leq t\leq 1.}

The explicit form of the curve is:

B(t)=(1t)3P0+3(1t)2tP1+3(1t)t2P2+t3P3, 0t1.{\displaystyle \mathbf {B} (t)=(1-t)^{3}\mathbf {P} _{0}+3(1-t)^{2}t\mathbf {P} _{1}+3(1-t)t^{2}\mathbf {P} _{2}+t^{3}\mathbf {P} _{3},\ 0\leq t\leq 1.}

For some choices ofP1 andP2 the curve may intersect itself, or contain acusp.

Any series of 4 distinct points can be converted to a cubic Bézier curve that goes through all 4 points in order.Given the starting and ending point of some cubic Bézier curve, and the points along the curve corresponding tot = 1/3 andt = 2/3, the control points for the original Bézier curve can be recovered.[9]

The derivative of the cubic Bézier curve with respect tot is

B(t)=3(1t)2(P1P0)+6(1t)t(P2P1)+3t2(P3P2).{\displaystyle \mathbf {B} '(t)=3(1-t)^{2}(\mathbf {P} _{1}-\mathbf {P} _{0})+6(1-t)t(\mathbf {P} _{2}-\mathbf {P} _{1})+3t^{2}(\mathbf {P} _{3}-\mathbf {P} _{2})\,.}

The second derivative of the Bézier curve with respect tot is

B(t)=6(1t)(P22P1+P0)+6t(P32P2+P1).{\displaystyle \mathbf {B} ''(t)=6(1-t)(\mathbf {P} _{2}-2\mathbf {P} _{1}+\mathbf {P} _{0})+6t(\mathbf {P} _{3}-2\mathbf {P} _{2}+\mathbf {P} _{1})\,.}
A cubic Bézier curve (red) whose control path (dotted black lines) forms two congruentisosceles triangles (blue) takes the form of an arc of theTschirnhausen cubic.

For control points whose consecutive triples form twosimilar triangles with the same orientation, the resulting cubic Bézier curve is an arc of a (scaled and translated)Tschirnhausen cubic. These arePythagorean hodograph curves, curves whose arc length andoffset curves have a rational parameterization, and they are the only cubic curves with these properties.[10]

General definition

[edit]

Bézier curves can be defined for any degreen.

Recursive definition

[edit]

A recursive definition for the Bézier curve of degreen expresses it as a point-to-pointlinear combination (linear interpolation) of a pair of corresponding points in two Bézier curves of degreen − 1.

LetBP0P1Pk{\displaystyle \mathbf {B} _{\mathbf {P} _{0}\mathbf {P} _{1}\ldots \mathbf {P} _{k}}} denote the Bézier curve determined by any selection of pointsP0,P1, ..., Pk. Then to start,

BP0(t)=P0, and{\displaystyle \mathbf {B} _{\mathbf {P} _{0}}(t)=\mathbf {P} _{0}{\text{, and}}}
B(t)=BP0P1Pn(t)=(1t)BP0P1Pn1(t)+tBP1P2Pn(t){\displaystyle \mathbf {B} (t)=\mathbf {B} _{\mathbf {P} _{0}\mathbf {P} _{1}\ldots \mathbf {P} _{n}}(t)=(1-t)\mathbf {B} _{\mathbf {P} _{0}\mathbf {P} _{1}\ldots \mathbf {P} _{n-1}}(t)+t\mathbf {B} _{\mathbf {P} _{1}\mathbf {P} _{2}\ldots \mathbf {P} _{n}}(t)}

This recursion is elucidated in theanimations below.

Explicit definition

[edit]

The formula can be expressed explicitly as follows (where t0 and (1-t)0 are extended continuously to be 1 throughout [0,1]):

B(t)=i=0n(ni)(1t)nitiPi=(1t)nP0+(n1)(1t)n1tP1++(nn1)(1t)tn1Pn1+tnPn,0t1{\displaystyle {\begin{aligned}\mathbf {B} (t)&=\sum _{i=0}^{n}{n \choose i}(1-t)^{n-i}t^{i}\mathbf {P} _{i}\\&=(1-t)^{n}\mathbf {P} _{0}+{n \choose 1}(1-t)^{n-1}t\mathbf {P} _{1}+\cdots +{n \choose n-1}(1-t)t^{n-1}\mathbf {P} _{n-1}+t^{n}\mathbf {P} _{n},&&0\leqslant t\leqslant 1\end{aligned}}}

where(ni){\displaystyle \scriptstyle {n \choose i}} are thebinomial coefficients.

For example, whenn = 5:

B(t)=(1t)5P0+5t(1t)4P1+10t2(1t)3P2+10t3(1t)2P3+5t4(1t)P4+t5P5,0t1.{\displaystyle {\begin{aligned}\mathbf {B} (t)&=(1-t)^{5}\mathbf {P} _{0}+5t(1-t)^{4}\mathbf {P} _{1}+10t^{2}(1-t)^{3}\mathbf {P} _{2}+10t^{3}(1-t)^{2}\mathbf {P} _{3}+5t^{4}(1-t)\mathbf {P} _{4}+t^{5}\mathbf {P} _{5},&&0\leqslant t\leqslant 1.\end{aligned}}}

Terminology

[edit]

Some terminology is associated with these parametric curves. We have

B(t)=i=0nbi,n(t)Pi,   0t1{\displaystyle \mathbf {B} (t)=\sum _{i=0}^{n}b_{i,n}(t)\mathbf {P} _{i},\ \ \ 0\leq t\leq 1}

where the polynomials

bi,n(t)=(ni)ti(1t)ni,   i=0,,n{\displaystyle b_{i,n}(t)={n \choose i}t^{i}(1-t)^{n-i},\ \ \ i=0,\ldots ,n}

are known asBernstein basis polynomials of degreen.

t0 = 1, (1 − t)0 = 1, and thebinomial coefficient,(ni){\displaystyle \scriptstyle {n \choose i}}, is:

(ni)=n!i!(ni)!.{\displaystyle {n \choose i}={\frac {n!}{i!(n-i)!}}.}

The pointsPi are calledcontrol points for the Bézier curve. Thepolygon formed by connecting the Bézier points withlines, starting withP0 and finishing withPn, is called theBézier polygon (orcontrol polygon). Theconvex hull of the Bézier polygon contains the Bézier curve.

Polynomial form

[edit]

Sometimes it is desirable to express the Bézier curve as apolynomial instead of a sum of less straightforwardBernstein polynomials. Application of thebinomial theorem to the definition of the curve followed by some rearrangement will yield

B(t)=j=0ntjCj{\displaystyle \mathbf {B} (t)=\sum _{j=0}^{n}{t^{j}\mathbf {C} _{j}}}

where

Cj=n!(nj)!i=0j(1)i+jPii!(ji)!=m=0j1(nm)i=0j(1)i+jPii!(ji)!.{\displaystyle \mathbf {C} _{j}={\frac {n!}{(n-j)!}}\sum _{i=0}^{j}{\frac {(-1)^{i+j}\mathbf {P} _{i}}{i!(j-i)!}}=\prod _{m=0}^{j-1}(n-m)\sum _{i=0}^{j}{\frac {(-1)^{i+j}\mathbf {P} _{i}}{i!(j-i)!}}.}

This could be practical ifCj{\displaystyle \mathbf {C} _{j}} can be computed prior to many evaluations ofB(t){\displaystyle \mathbf {B} (t)}; however one should use caution as high order curves may lacknumeric stability (de Casteljau's algorithm should be used if this occurs). Note that theempty product is 1.

Properties

[edit]
A cubic Bézier curve (yellow) can be made identical to a quadratic one (black) by
1. copying the end points, and
2. placing its 2 middle control points (yellow circles) 2/3 along line segments from the end points to the quadratic curve's middle control point (black rectangle).

Second-order curve is a parabolic segment

[edit]
Equivalence of a quadratic Bézier curve and a parabolic segment

A quadratic Bézier curve is also a segment of aparabola. As a parabola is aconic section, some sources refer to quadratic Béziers as "conic arcs".[13] With reference to the figure on the right, the important features of the parabola can be derived as follows:[14]

  1. Tangents to the parabola at the endpoints of the curve (A and B) intersect at its control point (C).
  2. If D is the midpoint of AB, the tangent to the curve which isperpendicular to CD (dashed cyan line) defines its vertex (V). Its axis of symmetry (dash-dot cyan) passes through V and is perpendicular to the tangent.
  3. E is either point on the curve with a tangent at 45° to CD (dashed green). If G is the intersection of this tangent and the axis, the line passing through G and perpendicular to CD is the directrix (solid green).
  4. The focus (F) is at the intersection of the axis and a line passing through E and perpendicular to CD (dotted yellow). The latus rectum is the line segment within the curve (solid yellow).

Derivative

[edit]

The derivative for a curve of ordern is

B(t)=ni=0n1bi,n1(t)(Pi+1Pi).{\displaystyle \mathbf {B} '(t)=n\sum _{i=0}^{n-1}b_{i,n-1}(t)(\mathbf {P} _{i+1}-\mathbf {P} _{i}).}

Constructing Bézier curves

[edit]

Linear curves

[edit]

Lett denote the fraction of progress (from 0 to 1) the pointB(t) has made along its traversal fromP0 toP1. For example, whent=0.25,B(t) is one quarter of the way from pointP0 toP1. Ast varies from 0 to 1,B(t) draws a line fromP0 toP1.

Animation of a linear Bézier curve, t in [0,1]
Animation of a linear Bézier curve,t in [0,1]

Quadratic curves

[edit]

For quadratic Bézier curves one can construct intermediate pointsQ0 andQ1 such that ast varies from 0 to 1:

  • PointQ0(t) varies fromP0 toP1 and describes a linear Bézier curve.
  • PointQ1(t) varies fromP1 toP2 and describes a linear Bézier curve.
  • PointB(t) is interpolated linearly betweenQ0(t) toQ1(t) and describes a quadratic Bézier curve.
Construction of a quadratic Bézier curveAnimation of a quadratic Bézier curve, t in [0,1]
Construction of a quadratic Bézier curveAnimation of a quadratic Bézier curve,t in [0,1]

Higher-order curves

[edit]

For higher-order curves one needs correspondingly more intermediate points. For cubic curves one can construct intermediate pointsQ0,Q1, andQ2 that describe linear Bézier curves, and pointsR0 andR1 that describe quadratic Bézier curves:

Construction of a cubic Bézier curveAnimation of a cubic Bézier curve, t in [0,1]
Construction of a cubic Bézier curveAnimation of a cubic Bézier curve,t in [0,1]

For fourth-order curves one can construct intermediate pointsQ0,Q1,Q2 andQ3 that describe linear Bézier curves, pointsR0,R1 andR2 that describe quadratic Bézier curves, and pointsS0 andS1 that describe cubic Bézier curves:

Construction of a quartic Bézier curveAnimation of a quartic Bézier curve, t in [0,1]
Construction of a quartic Bézier curveAnimation of a quartic Bézier curve,t in [0,1]

For fifth-order curves, one can construct similar intermediate points.

Animation of the construction of a fifth-order Bézier curve
Animation of a fifth-order Bézier curve,t in [0,1] in red. The Bézier curves for each of the lower orders are also shown.

These representations rest on the process used inDe Casteljau's algorithm to calculate Bézier curves.[15]

Offsets (or stroking) of Bézier curves

[edit]

The curve at a fixed offset from a given Bézier curve, called anoffset or parallel curve in mathematics (lying "parallel" to the original curve, like the offset between rails in arailroad track), cannot be exactly formed by a Bézier curve (except in some trivial cases). In general, the two-sided offset curve of a cubic Bézier is a 10th-orderalgebraic curve[16] and more generally for a Bézier of degreen the two-sided offset curve is an algebraic curve of degree 4n − 2.[17] However, there areheuristic methods that usually give an adequate approximation for practical purposes.[18]

In the field ofvector graphics, painting two symmetrically distanced offset curves is calledstroking (the Bézier curve or in general a path of several Bézier segments).[16] The conversion from offset curves to filled Bézier contours is of practical importance in convertingfonts defined inMetafont, which require stroking of Bézier curves, to the more widely usedPostScript type 1 fonts, which only require (for efficiency purposes) the mathematically simpler operation of filling a contour defined by (non-self-intersecting) Bézier curves.[19]

Degree elevation

[edit]

A Bézier curve of degreen can be converted into a Bézier curve of degreen + 1with the same shape. This is useful if software supports Bézier curves only of specific degree. For example, systems that can only work with cubic Bézier curves can implicitly work with quadratic curves by using their equivalent cubic representation.

To do degree elevation, we use the equalityB(t)=(1t)B(t)+tB(t).{\displaystyle \mathbf {B} (t)=(1-t)\mathbf {B} (t)+t\mathbf {B} (t).} Each componentbi,n(t)Pi{\displaystyle \mathbf {b} _{i,n}(t)\mathbf {P} _{i}} is multiplied by (1 − t) and t, thus increasing a degree by one, without changing the value. Here is the example of increasing degree from 2 to 3.

(1t)2P0+2(1t)tP1+t2P2=(1t)3P0+2(1t)2tP1+(1t)t2P2+(1t)2tP0+2(1t)t2P1+t3P2=(1t)3P0+(1t)2t(P0+2P1)+(1t)t2(2P1+P2)+t3P2=(1t)3P0+3(1t)2t13(P0+2P1)+3(1t)t213(2P1+P2)+t3P2{\displaystyle {\begin{aligned}(1-t)^{2}\mathbf {P} _{0}+2(1-t)t\mathbf {P} _{1}+t^{2}\mathbf {P} _{2}&=(1-t)^{3}\mathbf {P} _{0}+2(1-t)^{2}t\mathbf {P} _{1}+(1-t)t^{2}\mathbf {P} _{2}+(1-t)^{2}t\mathbf {P} _{0}+2(1-t)t^{2}\mathbf {P} _{1}+t^{3}\mathbf {P} _{2}\\&=(1-t)^{3}\mathbf {P} _{0}+(1-t)^{2}t\left(\mathbf {P} _{0}+2\mathbf {P} _{1}\right)+(1-t)t^{2}\left(2\mathbf {P} _{1}+\mathbf {P} _{2}\right)+t^{3}\mathbf {P} _{2}\\&=(1-t)^{3}\mathbf {P} _{0}+3(1-t)^{2}t{\tfrac {1}{3}}\left(\mathbf {P} _{0}+2\mathbf {P} _{1}\right)+3(1-t)t^{2}{\tfrac {1}{3}}\left(2\mathbf {P} _{1}+\mathbf {P} _{2}\right)+t^{3}\mathbf {P} _{2}\end{aligned}}}

In other words, the original start and end points are unchanged. The new control points areP1=13(P0+2P1){\displaystyle \mathbf {P'} _{1}={\tfrac {1}{3}}\left(\mathbf {P} _{0}+2\mathbf {P} _{1}\right)} andP2=13(2P1+P2){\displaystyle \mathbf {P'} _{2}={\tfrac {1}{3}}\left(2\mathbf {P} _{1}+\mathbf {P} _{2}\right)}.

For arbitraryn we use equalities[20]

{(n+1i)(1t)bi,n=(ni)bi,n+1(n+1i+1)tbi,n=(ni)bi+1,n+1{(1t)bi,n=n+1in+1bi,n+1tbi,n=i+1n+1bi+1,n+1{\displaystyle {\begin{cases}{n+1 \choose i}(1-t)\mathbf {b} _{i,n}={n \choose i}\mathbf {b} _{i,n+1}\\{n+1 \choose i+1}t\mathbf {b} _{i,n}={n \choose i}\mathbf {b} _{i+1,n+1}\end{cases}}\quad \implies \quad {\begin{cases}(1-t)\mathbf {b} _{i,n}={\frac {n+1-i}{n+1}}\mathbf {b} _{i,n+1}\\t\mathbf {b} _{i,n}={\frac {i+1}{n+1}}\mathbf {b} _{i+1,n+1}\end{cases}}}

Therefore:

B(t)=(1t)i=0nbi,n(t)Pi+ti=0nbi,n(t)Pi=i=0nn+1in+1bi,n+1(t)Pi+i=0ni+1n+1bi+1,n+1(t)Pi=i=0n+1(in+1Pi1+n+1in+1Pi)bi,n+1(t)=i=0n+1bi,n+1(t)Pi{\displaystyle {\begin{aligned}\mathbf {B} (t)&=(1-t)\sum _{i=0}^{n}\mathbf {b} _{i,n}(t)\mathbf {P} _{i}+t\sum _{i=0}^{n}\mathbf {b} _{i,n}(t)\mathbf {P} _{i}\\&=\sum _{i=0}^{n}{\frac {n+1-i}{n+1}}\mathbf {b} _{i,n+1}(t)\mathbf {P} _{i}+\sum _{i=0}^{n}{\frac {i+1}{n+1}}\mathbf {b} _{i+1,n+1}(t)\mathbf {P} _{i}\\&=\sum _{i=0}^{n+1}\left({\frac {i}{n+1}}\mathbf {P} _{i-1}+{\frac {n+1-i}{n+1}}\mathbf {P} _{i}\right)\mathbf {b} _{i,n+1}(t)\\&=\sum _{i=0}^{n+1}\mathbf {b} _{i,n+1}(t)\mathbf {P'} _{i}\end{aligned}}}

introducing arbitraryP1{\displaystyle \mathbf {P} _{-1}} andPn+1{\displaystyle \mathbf {P} _{n+1}}.

Therefore, new control points are[20]

Pi=in+1Pi1+n+1in+1Pi,i=0,,n+1.{\displaystyle \mathbf {P'} _{i}={\frac {i}{n+1}}\mathbf {P} _{i-1}+{\frac {n+1-i}{n+1}}\mathbf {P} _{i},\quad i=0,\ldots ,n+1.}

Repeated degree elevation

[edit]

The concept of degree elevation can be repeated on a control polygonR to get a sequence of control polygonsR,R1,R2, and so on. Afterr degree elevations, the polygonRr has the verticesP0,r,P1,r,P2,r, ...,Pn+r,r given by[20]

Pi,r=j=0nPj(nj)(rij)(n+ri).{\displaystyle \mathbf {P} _{i,r}=\sum _{j=0}^{n}\mathbf {P} _{j}{\tbinom {n}{j}}{\frac {\tbinom {r}{i-j}}{\tbinom {n+r}{i}}}.}

It can also be shown that for the underlying Bézier curveB,

limrRr=B.{\displaystyle \mathbf {\lim _{r\to \infty }R_{r}} =\mathbf {B} .}

Degree reduction

[edit]

Degree reduction can only be done exactly when the curve in question is originally elevated from a lower degree.[21] A number of approximation algorithms have been proposed and used in practice.[22][23]

Rational Bézier curves

[edit]
Segments of conic sections represented exactly by rational Bézier curves

The rational Bézier curve adds adjustable weights to provide closer approximations to arbitrary shapes. The numerator is a weighted Bernstein-form Bézier curve and the denominator is a weighted sum ofBernstein polynomials. Rational Bézier curves can, among other uses, be used to represent segments ofconic sections exactly, including circular arcs.[24]

Givenn + 1 control pointsP0, ...,Pn, the rational Bézier curve can be described by

B(t)=i=0nbi,n(t)Piwii=0nbi,n(t)wi,{\displaystyle \mathbf {B} (t)={\frac {\sum _{i=0}^{n}b_{i,n}(t)\mathbf {P} _{i}w_{i}}{\sum _{i=0}^{n}b_{i,n}(t)w_{i}}},}

or simply

B(t)=i=0n(ni)ti(1t)niPiwii=0n(ni)ti(1t)niwi.{\displaystyle \mathbf {B} (t)={\frac {\sum _{i=0}^{n}{n \choose i}t^{i}(1-t)^{n-i}\mathbf {P} _{i}w_{i}}{\sum _{i=0}^{n}{n \choose i}t^{i}(1-t)^{n-i}w_{i}}}.}

The expression can be extended by using number systems besidesreals for the weights. In thecomplex plane the points {1}, {-1}, and {1} with weights {i{\displaystyle i}}, {1}, and {i{\displaystyle -i}} generate a full circle with radius one. For curves with points and weights on a circle, the weights can be scaled without changing the curve's shape.[25] Scaling the central weight of the above curve by 1.35508 gives a more uniform parameterization.

Applications

[edit]

Computer graphics

[edit]
Bézier path inAdobe Illustrator

Bézier curves are widely used in computer graphics to model smooth curves. As the curve is completely contained in theconvex hull of itscontrol points, the points can be graphically displayed and used to manipulate the curve intuitively.Affine transformations such astranslation androtation can be applied on the curve by applying the respective transform on the control points of the curve.

Quadratic andcubic Bézier curves are most common. Higher degree curves are morecomputationally expensive to evaluate. When more complex shapes are needed, low order Bézier curves are patched together, producing acomposite Bézier curve. A composite Bézier curve is commonly referred to as a "path" invector graphics languages (likePostScript), vector graphics standards (likeSVG) and vector graphics programs (likeArtline,Timeworks Publisher,Adobe Illustrator,CorelDraw,Inkscape, andAllegro). In order to join Bézier curves into a composite Bézier curve without kinks, a property calledG1 continuity suffices to force the control point at which two constituent Bézier curves meet to lie on the line defined by the two control points on either side.

Abstract composition of cubic Bézier curves ray-traced in 3D. Ray intersection with swept volumes along curves is calculated with Phantom Ray-Hair Intersector algorithm.[26]

The simplest method for scan converting (rasterizing) a Bézier curve is to evaluate it at many closely spaced points and scan convert the approximating sequence of line segments. However, this does not guarantee that the rasterized output looks sufficiently smooth, because the points may be spaced too far apart. Conversely it may generate too many points in areas where the curve is close to linear. A common adaptive method is recursive subdivision, in which a curve's control points are checked to see if the curve approximates a line to within a small tolerance. If not, the curve is subdivided parametrically into two segments, 0 ≤t ≤ 0.5 and 0.5 ≤t ≤ 1, and the same procedure is applied recursively to each half. There are also forward differencing methods, but great care must be taken to analyse error propagation.[27]

Analytical methods where a Bézier is intersected with eachscan line involve findingroots of cubic polynomials (for cubic Béziers) and dealing with multiple roots, so they are not often used in practice.[27]

The rasterisation algorithm used inMetafont is based on discretising the curve, so that it is approximated by a sequence of "rook moves" that are purely vertical or purely horizontal, along the pixel boundaries. To that end, the plane is first split into eight 45° sectors (by the coordinate axes and the two linesy=±x{\displaystyle y=\pm x}), then the curve is decomposed into smaller segments such that thedirection of a curve segment stays within one sector; since the curve velocity is a second degree polynomial, finding thet{\displaystyle t} values where it is parallel to one of these lines can be done by solvingquadratic equations. Within each segment, either horizontal or vertical movement dominates, and the total number of steps in either direction can be read off from the endpoint coordinates; in for example the 0–45° sector horizontal movement to the right dominates, so it only remains to decide between which steps to the right the curve should make a step up.[28]

There is also a modified curve form ofBresenham's line drawing algorithm by Zingl that performs this rasterization by subdividing the curve into rational pieces and calculating the error at each pixel location such that it either travels at a 45° angle or straight depending on compounding error as it iterates through the curve. This reduces the next step calculation to a series ofinteger additions and subtractions.[29]

Animation

[edit]

In animation applications, such asAdobe Flash andSynfig, Bézier curves are used to outline, for example, movement. Users outline the wanted path in Bézier curves, and the application creates the needed frames for the object to move along the path.[30][31]

In 3D animation, Bézier curves are often used to define 3D paths as well as 2D curves for keyframe interpolation.[32] Bézier curves are now very frequently used to control the animation easing inCSS,JavaScript,JavaFx andFlutter SDK.[4]

Fonts

[edit]

TrueType fonts use composite Bézier curves composed ofquadratic Bézier curves. Other languages and imaging tools (such asPostScript,Asymptote,Metafont, andSVG) use composite Béziers composed ofcubic Bézier curves for drawing curved shapes.OpenType fonts can use either kind of curve, depending on which font technology underlies the OpenType wrapper.[33]

Font engines, likeFreeType, draw the font's curves (and lines) on a pixellated surface using a process known asfont rasterization.[13] Typically font engines and vector graphics engines render Bézier curves by splitting them recursively up to the point where the curve is flat enough to be drawn as a series of linear or circular segments. The exact splitting algorithm is implementation dependent, only the flatness criteria must be respected to reach the necessary precision and to avoid non-monotonic local changes of curvature. The "smooth curve" feature of charts inMicrosoft Excel also uses this algorithm.[34]

Because arcs of circles andellipses cannot be exactly represented by Bézier curves, they are first approximated by Bézier curves, which are in turn approximated by arcs of circles. This is inefficient as there exists also approximations of all Bézier curves using arcs of circles or ellipses, which can be rendered incrementally with arbitrary precision. Another approach, used by modern hardware graphics adapters with accelerated geometry, can convert exactly all Bézier and conic curves (or surfaces) intoNURBS, that can be rendered incrementally without first splitting the curve recursively to reach the necessary flatness condition. This approach also preserves the curve definition under all linear or perspective 2D and 3D transforms and projections.[citation needed]

Robotics

[edit]

Because the control polygon allows to tell whether or not the path collides with any obstacles, Bézier curves are used in producing trajectories of theend effectors.[35] Furthermore, joint space trajectories can be accurately differentiated using Bézier curves. Consequently, the derivatives of joint space trajectories are used in the calculation of the dynamics and control effort (torque profiles) of the robotic manipulator.[35]

See also

[edit]

Notes

[edit]
  1. ^Image manipulation programs such asInkscape,Adobe Photoshop, andGIMP.
  2. ^In animation applications such asAdobe Flash,Adobe After Effects,Microsoft Expression Blend,Blender,Autodesk Maya andAutodesk 3ds Max.

References

[edit]

Citations

[edit]
  1. ^Wells, John (3 April 2008).Longman Pronunciation Dictionary (3rd ed.). Pearson Longman.ISBN 978-1-4058-8118-0.
  2. ^Mortenson, Michael E. (1999).Mathematics for Computer Graphics Applications. Industrial Press Inc. p. 264.ISBN 9780831131111.
  3. ^abcHazewinkel, Michiel (1997).Encyclopaedia of Mathematics: Supplement. Vol. 1. Springer Science & Business Media. p. 119.ISBN 9780792347095.
  4. ^ab"Cubic class - animation library - Dart API".api.flutter.dev. Retrieved2021-04-26.
  5. ^Biswas, Pradipta; Langdon, Pat (2015-04-03). "Multimodal Intelligent Eye-Gaze Tracking System".International Journal of Human-Computer Interaction.31 (4):277–294.doi:10.1080/10447318.2014.1001301.ISSN 1044-7318.S2CID 36347027.
  6. ^Gerald E. Farin; Josef Hoschek; Myung-Soo Kim (2002).Handbook of Computer Aided Geometric Design. Elsevier. pp. 4–6.ISBN 978-0-444-51104-1.
  7. ^Paul de Casteljau (1986).Mathématiques et CAO. Tome 2 : Formes à pôles. Hermès.ISBN 9782866010423.
  8. ^Mario A. Gutiérrez; Frédéric Vexo; Daniel Thalmann (2023).Stepping into Virtual Reality. Springer Nature. p. 33.ISBN 9783031364877.
  9. ^John Burkardt."Forcing Bezier Interpolation". Archived fromthe original on 2013-12-25.
  10. ^Farouki, Rida T. (2008).Pythagorean-Hodograph Curves: Algebra and Geometry Inseparable. Geometry and Computing. Vol. 1. Springer. pp. 384,400–404.doi:10.1007/978-3-540-73398-0.ISBN 978-3-540-73397-3.MR 2365013.
  11. ^Teofilo Gonzalez; Jorge Diaz-Herrera; Allen Tucker (2014).Computing Handbook, Third Edition: Computer Science and Software Engineering. CRC Press. page 32-14.ISBN 978-1-4398-9852-9.
  12. ^Max K. Agoston (2005).Computer Graphics and Geometric Modelling: Implementation & Algorithms. Springer Science & Business Media. p. 404.ISBN 978-1-84628-108-2.
  13. ^ab"FreeType Glyph Conventions / VI. FreeType outlines".The Free Type Project. 13 February 2018.
    "FreeType Glyph Conventions – Version 2.1 / VI. FreeType outlines". 6 March 2011. Archived fromthe original on 2011-09-29.
  14. ^Duncan Marsh (2005).Applied Geometry for Computer Graphics and CAD. Springer Undergraduate Mathematics Series (2nd ed.).ISBN 978-1-85233-801-5.ASIN 1852338016.
  15. ^Shene, C. K."Finding a Point on a Bézier Curve: De Casteljau's Algorithm". Retrieved6 September 2012.
  16. ^abMark Kilgard (April 10, 2012)."CS 354 Vector Graphics & Path Rendering". p. 28.
  17. ^Rida T. Farouki."Introduction to Pythagorean-hodograph curves"(PDF). Archived fromthe original(PDF) on June 5, 2015., particularly p. 16 "taxonomy of offset curves".
  18. ^For example:For a survey seeElber, G. (May 1997)."Comparing offset curve approximation methods"(PDF).IEEE Computer Graphics and Applications.17 (3):62–71.doi:10.1109/38.586019.
  19. ^Richard J. Kinch (1995)."MetaFog: Converting Metafont shapes to contours"(PDF).TUGboat.16 (3–Proceedings of the 1995 Annual Meeting).Archived(PDF) from the original on 2022-10-09.
  20. ^abcFarin, Gerald (1997).Curves and surfaces for computer-aided geometric design (4 ed.).Elsevier Science & Technology Books.ISBN 978-0-12-249054-5.
  21. ^"Bézier Splines".FontForge 20230101 documentation.
  22. ^Eck, Matthias (August 1993). "Degree reduction of Bézier curves".Computer Aided Geometric Design.10 (3–4):237–251.doi:10.1016/0167-8396(93)90039-6.
  23. ^Rababah, Abedallah; Ibrahim, Salisu (2018). "Geometric Degree Reduction of Bézier Curves".Mathematics and Computing. ICMC 2018, Varanasi, India. pp. 87–95.doi:10.1007/978-981-13-2095-8_8.ISBN 978-981-13-2094-1.
  24. ^Neil Dodgson (2000-09-25)."Some Mathematical Elements of Graphics: Rational B-splines". Retrieved2009-02-23.
  25. ^J. Sánchez-Reyes (November 2009). "Complex rational Bézier curves".Computer Aided Geometric Design.26 (8):865–876.doi:10.1016/j.cagd.2009.06.003.
  26. ^Alexander Reshetov and David Luebke, Phantom Ray-Hair Intersector. In Proceedings of the ACM on Computer Graphics and Interactive Techniques (August 1, 2018).[1]
  27. ^abXuexiang Li & Junxiao Xue."Complex Quadratic Bézier Curve on Unit Circle". Zhengzhou, China: School of Software, Zhengzhou University.
  28. ^Parts 19–22 ofKnuth, Donald E. (1986).Metafont: The Program. Addison-Wesley.ISBN 0-201-13438-1.
  29. ^Zingl, Alois (2012).A Rasterizing Algorithm for Drawing Curves(PDF) (Report).
    HTML abstract and demo:Zingl, Alois (2016)."Bresenham".members.chello.at.
  30. ^"Using motion paths in animations".Adobe. Retrieved2019-04-11.
  31. ^"Following a Spline".Synfig Wiki. Retrieved2019-04-11.
  32. ^Dodgson, Neil A. (1999)."Advanced Graphics Lecture Notes"(PDF).cl.cam.ac.uk. University of Cambridge Computer Laboratory.Archived(PDF) from the original on 2022-10-09.
  33. ^"The difference between CFF and TTF".Know How. Linotype. Archived fromthe original on 2017-07-03. Retrieved3 July 2018.The OpenType format was formulated in 1996. By 2003, it began to replace two competing formats: the Type1 fonts, developed by Adobe and based on [P]ost[S]cript, and the TrueType fonts, specified by Microsoft and Apple. (...) TTF stands for TrueTypeFont and indicates that the font data is the same as in the TrueType fonts. CFF stands for the Type1 font format. Strictly speaking, it refers to the Compact Font Format, which is used in the compression processes for the Type2 fonts. (...) the cubic Bézier format of the Type1 fonts is more space-saving compared to the quadratic format of the TrueType fonts. Some kilobytes can be saved in large, elaborate fonts which may represent an advantage on the Web. On the other hand, the more detailed hinting information of the TrueType fonts is useful for very extensive optimization for screen use.
  34. ^"smooth_curve_bezier_example_file.xls".Rotating Machinery Analysis, Inc. Archived fromthe original on 2011-07-18. Retrieved2011-02-05.
  35. ^abMalik, Aryslan; Henderson, Troy; Prazenica, Richard (January 2021)."Trajectory Generation for a Multibody Robotic System using the Product of Exponentials Formulation".AIAA Scitech 2021 Forum: 2016.doi:10.2514/6.2021-2016.ISBN 978-1-62410-609-5.S2CID 234251587.
  36. ^Gross, Renan (2014). "Bridges, String Art, and Bézier Curves". In Pitici, Mircea (ed.).The Best Writing on Mathematics 2013. Princeton University Press. pp. 77–89.doi:10.1515/9781400847990-011.ISBN 9780691160412.JSTOR j.ctt4cgb74.13.

Sources

[edit]

Further reading

[edit]

External links

[edit]
Computer code
Retrieved from "https://en.wikipedia.org/w/index.php?title=Bézier_curve&oldid=1321323973"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp