Bezier Curves of Arbitrary Degree

advertisement
Bezier Curves of Arbitrary Degree
Specification of the Curve:
Given the set of control points (P0, P1, …, PN), we can define a Bezier curve of degree n
by either of the following:
1. The Analytical Definition:
n
P (t )   Pi Bi ,n (t )
i 0
n
where Bi ,n (t )   t i (1  t ) n i
t 
are the Bernstein polynomial of degree n, and range is 0  t  1 .
2. Geometric Definition:
P (t )  Pn( n ) (t )
(1  t ) Pi ( 1j 1) (t )  tPi ( j 1) (t )
, j0
where P (t )  
Pi
, otherwise

for 0  t  1.
( n)
n
Quadratic Bezier Curves
We can develop the curve through a divide-and-conquer approach of which the basic
operation is the generation of midpoints on the curve.
Here we want to use points other than the midpoints.
Example:
Given 3 points P0, P1 and P2, we develop a divide procedure that is based on a parameter
0<t<1 such that:

Let P1(1) be the point on the segment P0 P1 defined by:
P1(1)  (1  t ) P0  tP1  P0  t ( P1  P0 )

Let P2(1) be the point on the segment P1 P2 defined by:
P2(1)  (1  t ) P1  tP2  P1  t ( P2  P1 )

Let P2( 2) be the point on the segment P1(1) P2(1) defined by:
P2( 2)  (1  t ) P1(1)  tP2(1)  P1(1)  t ( P2(1)  P1(1) )

P(t )  P2( 2)
t =0.75
This is a similar approach to the divide-and-conquer in which geometric means are used
to define points on the curve.
If t = 0.5 ==> divide-and-conquer
Developing the Equation of the Curve:
- Each point P1(1) , P2(1) and P2( 2) is a function of parameter t.
- P2( 2) can be equated with P(t) since it is a point on the curve
The algebra:
P(t )  P2( 2) (t )
 (1  t ) P1(1) (t )  tP2(1) (t )
where
P1(1) (t )  (1  t ) P0  tP1
P2(1) (t )  (1  t ) P1  tP2
substitute:
P(t )  (1  t ) P1(1) (t )  tP2(1) (t )
 (1  t )[(1  t ) P0  tP1 ]  t[(1  t ) P1  tP2 ]
 (1  t ) 2 P0  2t (1  t ) P1  t 2 P2
This is a Quadratic Polynomial (as it is a linear combination of quadratic polynomials).
Properties of the Quadratic Curve(Bezier)
1. P(0) = P0 and P(1) = P2, so the curve passes through the control points P0 and P2.
2. The curve P(t) is continuous and has continuous derivatives of all orders. (It is a
polynomial.)
3. We can differentiate P(t) with respect to t:
dP(t )
 2(1  t ) P0  [2t  2(1  t )]P1  2tP2
dt
 2[(1  t}( P1  P0 )  t ( P2  P1 )]
Therefore,
dP(0)
 2( P1  P0 ) is the tangent vector at t = 0.
dt
and
dP (1)
 2( P2  P1 ) is the tangent vector at t = 1.
dt
4. The functions (1-t)2, 2t(1-t) and t2 that are used to “blend” the control points P0, P1 and
P2 are the degree two Bernstein Polynomial. These all are non-negative and add up to 1:
(1  t ) 2  2t (1  t )  t 2  1  2t  t 2  2t  2t 2  t 2  1
5. The curve is contained within the triangle P0 P1 P2 .
6. All the points, generated from the divide-and-conquer lie on the curve. Clearly P(0.5)
is the first point calculated by divide-and-conquer. You can show P(0.25) … etc.
Properties of the Bezier Curve
 P0 and Pn are on the curve.

The curve is continuous and has continuous derivatives of all order.

The tangent line to the curve at the point P0 is the line P0 P1 . The tangent to the curve
at the point Pn is the line Pn1 Pn .

The curve lies within the convex hull of its control points. This is because each
successive Pi ( j ) is a convex combination of the points Pi ( j 1) and Pi ( 1j 1) .

P1, P2, …, Pn are all on the curve only if the curve is linear.
Download