Вы находитесь на странице: 1из 49

Chapter 10 Curves

2D curves conic curves, such as ellipse, parabola, circle, hyperbola


3D freeform curves
Lagrange polynomial
Cubic splines
Bezier curves
B-spline
Rational curves, such as NURB (Non-Uniform Rational B-spline)

Complex curves are required for some applications, e.g. the design of
automobiles, ships, and airplanes.

Figure 10.1 Examples of freeform curves in the design of automobile bodies.

Any curve can be described by an array of points. One class of mathematical


function is particularly suitable for this purpose - the polynomial function:

Curves can be represented in two forms: Parametric and Implicit.


The parametric representation:

The implicit representations:


A planar curve -

A three-dimensional curve -
Implicitization: the method for conversion of a parametric equation of a curve
into an implicit equation. This approach to implicitization works well for linear
(1st degree) and quadratic (2nd degree) equations; however, cubic (3rd degree)
and quartic (4th degree) curves are very complex.

Resultant R(x,y) is used to solve this complex problem.


Consider two polynomials of the form

For quadratic curves:

(a 2 b1 ) (a 2 b0 )
=0 (10.7)
(a 2 b0 ) (a1b0 )

For cubic curves:

(a3b2 ) (a3 b1 ) (a3 b0 )


(a3b1 ) (a3 b0 ) + (a 2 b1 ) (a 2 b0 ) =0 (10.8)
(a3 b0 ) (a 2 b0 ) (a1b0 )

where ( a i b j ) = ( a i b j a j bi )

First, create two auxiliary polynomials:

(10.9)

Let r(x,t) = 0, and s(y,t) = 0, that is x(t) = x, and y(t) = y.


Example 10.1
Consider the planar quadratic curve given by
x = t 2 1 y = t 2 2t + 2
Determine its implicit equation.

Solution
The brute-force approach applied to this case yields the following results:
From the x equation: t = x + 1

( )
2
Substituting in y : y = x +1 2 x +1 + 2

Isolating the radicals and squaring both sides:

(
y ( x + 1) 2 = 2 x + 1 )
2 2

or
x 2 2 xy + y 2 + 2 x 6 y + 5 = 0
The same results are obtained using the general resultant method.
x = t 2 1
y = t 2 2t + 2
From Eq. 10.9, the auxiliary polynomials are:

r ( x, t ) = t 2 + ( x + 1)
s ( y, t ) = t 2 + 2t + ( y 2 )

The resultant is given by the determinant:

2 ( x y + 3)

( x y + 3) 2 ( x + 1)
= x 2 2 xy + y 2 + 2 x 6 y + 5 = 0

Conics - curves obtained by the intersection of a plane and a cone.

ax 2 + by 2 + 2hxy + 2ux + 2vy + d = 0

a b u x
[x y 1] h b v y = 0
u v d 1
Figure 10.2 Conic representations.

One of the most important characteristics of conic curves is its lack of inflection
points.

Figure 10.3 Flowchart for conic classification.

1. Circle
2. Ellipse

3. Parabola

4. Hyperbola
Interpolation techniques for curve definition
piecewise linear interpolation function f(x) for any value of x between two
arbitrary points, Xi and Xi+1.

Figure 10.6 (a) Piecewise linear interpolation. (b) Third order Lagrange interpolation.

Lagrange Polynomial
Consider a sequence of planar points defined by (X0,Y0), (X1,Y1), (Xn,Yn),
where Xi<Xj for i < j .

where

i.e.

Disadvantages:
1. The degree of the polynomial tied to the number of points used.
2. The number of points used is increased; the result is a polynomial of
higher degree subject to excessive oscillations.
Figure 10.7 Excessive oscillations for Lagrange interpolation, resulting from an increase in the number of
points used.

Example 10.2
Use a Lagrangian polynomial to interpolate the points

P1 (1,1) P2 (2, 2) P3 (3,3) P4 (4, 2) P5 (5,1)

Solution
Equation 10.26 is used to solve this problem, as follows.

( x 2 )( x 3)( x 4 )( x 5 ) ( x 1)( x 3)( x 4 )( x 5 )


f ( x) = (1) + ( 2)
(1 2 )(1 3)(1 4 )(1 5 ) ( 2 1)( 2 3)( 2 4 )( 2 5 )
( x 1)( x 2 )( x 4 )( x 5 ) ( x 1)( x 2 )( x 3)( x 5 )
+ ( 3) + ( 4)
( 3 1)( 3 2 )( 3 4 )( 3 5 ) ( 4 1)( 4 2 )( 4 3)( 4 5 )
( x 1)( x 2 )( x 3)( x 4 )
+ (1)
( 5 1)( 5 2 )( 5 3)( 5 4 )

Figure 10.9 Linear and Lagrange interpolation for a given set of points
Cubic Spline
Cubic spline may be considered as a thin elastic beam to which the
Bernoulli-Euler equation applies. If small deflections are considered, the
curvature is approximated by the second derivative of the assumed curve.

Figure 10.10 Piecewise parametric cubic interpolation

Cubic spline interpolation is satisfactory in many engineering applications,


which deal with large sets of very accurate values, such as measurements of
material properties (density, modulus of elasticity), or results obtained from the
simulation of various engineering systems.

The cubic spline is represented by a piecewise cubic polynomial with


second order derivative continuity at the common joints between segments.

Parametric continuity:

C0 continuity: no gaps or jumps in a curve


C1 continuity: slope/tangent or first derivative continuity
C2 continuity: curvature or second derivative continuity

0 1 2
Figure 10.14 Examples of parametric continuity: (a) Discontinuous; (b) C ; (c) C ; (d) C .
Geometric continuity: parameterization independent measure of
continuity, i.e. a curve is curvature continuity yet not twice differentiable.
G2 continuity: if it is C2 with respect to some parameterization

Above figure shows two symmetric parabolas that are combine to form a
composite curve.
It is tangent continuity and curvature continuity at b2.
However, it does not form a C2 piecewise polynomial curve over those two
intervals: for two parabolas to form a C2 piecewise quadratic curve, they must
both be part of one global parabola.

The term G2 curves denote that they are twice differentiable with respect to arc
length but not necessarily twice differentiable with respect to their current
parameterization. Note that curves with a zero tangent vector cannot be G2
under this definition.
Advantages of parametric cubic: it is the lowest degree space curve that allows
a point of inflection and has the ability to twist through space.

Consider the parametric cubic

where P(t) is a point on the curve.


Figure 10.11 Tangent vectors at the end of a segment

Figure 10.12 Changes in the magnitude of tangent vectors cause variabtions on the shape
of a parametric cubic curve.

Conditions: (Hermite interpolation)


1. Endpoints: Two points are interpolated at a time by a parametric cubic
curve.
2. Tangent vectors: The direction of the tangent vectors establishes the
slopes (direction cosines) of the curve at the endpoints, and changes in
the magnitude of the vectors allow modification of the shape of the curve.

P(t), 0t1

the first derivation at the end points,


Thus,

In matrix form,

(10.38)
Example 10.3
Find the matrix of geometric coefficients for a parametric cubic curve, knowing
that

for t = 0 (2, 20, 2) is a point on the curve and P (0) = ( x1 , 0, 4 x1 )


'

for t = 1 (10, 20, 2) is a point on the curve and P (1) = ( x2 , 0, 2 x2 )


'

for t = 0.5 (6, 20, 6) is a point on the curve

Solution
The matrix of geometric coefficients is given as
P (0)
P(1)

P ' (0)
'
P (1)
For this problem, P(0) and P(1) are given as (2, 20, 2) and (10, 20,

2),respectively. To obtain the values of P ' (0) '


and P (1) , the unknowns x1

and x2 must be calculated. For t = 0.5, the following expression can be used

based on Eq. 10.38:

P ( 0.5 ) = [ 6 20 6]
2 2 1 1 2 20 2
3 3 2 1 10 20 2
= (0.5)3 (0.5) 2 (0.5) 1
0 0 1 0 x1 0 4 x1

1 0 0 0 x2 0 2 x2
which, when expanded, yields:

6 = 6 + 0.125 x1 0.125 x2 (I)

and

6 = 2 + 0.5 x1 + 0.25 x2 (II)

From (I) x1 = x2
16
Substituting in (II) x1 = x2 =
3
The geometric coefficients matrix is therefore

2 20 2
10 20 2

16 64
0
3 3
16 32
3 0
3

Piecewise connection

(10.43)
or

(10.44)

Figure 10.15 Two cubic spline segments


from the position C0 continuity

Assume that the cubic spline has m-1 segments interpolating m points, P0 to
Pm-1. Therefore, there are m-2 internal joints and m-2 equations.
Four commonly used constraints are
(1) Clamped (encastered) cubic spline, known end tangent vectors, P0 and
Pm-1.

[m][m] x [m][1] = [m][1]

or
Example 10.4
Consider four two-dimensional point vectors

P0 [ 0 0] , P1 [ 2 1] , P2 [ 4 4] , P3 [ 6 0]

[ ]
with given tangent vectors P0 [1 1] and P3 1 1 . Determine the values of
' '

the tangent vectors at P1 and P2 needed for a cubic spline interpolation.

Solution
The tangent vectors are found through Eq. 10.51

1 0 0 0 P0' (1 1) 1 1

1 4 1 0 P1' 3 ( 4 0 )( 4 0 ) 12 12
= =
0 1 4 1 P2' 3 ( 6 2 )( 0 1) 12 3

0 0 0 1 P3' ( 1 1) 1 1

or
1
P0' 1 0 0 0 1 1
'
P1 = 1 4 1 0 12 12

P2' 0 1 4 1 12 3
'
P3 0 0 0 1 1 1
1 1
P
'
15 0 0 0 1 1 31 48
0

P = 1 4 4 1 1 12 12 = 15 15
'
1
P 15 1 1 4 4 12 3 41 27
'

P 0 0 0 15 1 1 15 15
'
3
1 1

(2) Relaxed (nature) cubic spline, second derivative at the endpoints P0 and
Pm-1 both made equal to zero.
P0=0, i.e.

or
P0=0,

(10.57)
[m][m] x [m][m] = [m][1]

Example 10.5
Solve the problem in Example 10.4, using a natural cubic spline. Calculate

1 2
cubic spline values at t = and t = for each spline segment.
3 3

Solution
Eq.10.57 is used in this problem to calculate the tangent vectors.

2 1 0 0 P0' 6 3
1 '
4 1 0 P1 12 12

=
0 1 4 1 P2' 12 3

0 0 1 2 P3' 6 12

P00' 26 7 2 1 6 3
' 7 14 4 2 12 12
P1 = 1
P2' 45 2 4 14 7 12 3
'
P3 1 2 7 26 6 12

P0' 2 0
'
P1 = 2 3
P2' 2 0
'
P3 20 6

1 2
To find points on the curve at t = and t = in the first segment, Eqs.10.43
3 3
and 10.44 are used.
1
At t =
3
2 -2 1 1 0 0
1 1
3
1
2
1 -3 3 -2 -1 2 1
P = 1
3 3 3 3 0 0 1 0 2 0

1 0 0 0 2 3
1
P = [ 0.666 0.0372]
3
2
At t =
3
2 -2 1 1 0 0
2 2
3
2
2
2 -3 3 -2 -1 2 1
P = 1
3 3 3 3 0 0 1 0 2 0

1 0 0 0 2 3
2
P = [1.332 0.2964]
3
The same Eqs. 10.43 and 10.44 are applied to the second and third segments.
In both cases only the geometry matrix varies, the first two matrices remaining
the same for each parametric value.
For the second segment:
2 1
4 4
[ ]H 2 3
G =

2 0
and the curve values are:
1
P = [ 2.666 2.223]
3
2
P = [3.333 3.444]
3
For the third segment:
4 4
6 0
[ G ]H =
2 0


2 6
and
1
P = [ 4.666 3.407 ]
3
2
P = [5.333 1.925]
3

Figure 10.16 Clamped and relaxed cubic splines

(3) Cyclic cubic spline, the slot and curvature at the beginning and end of the
curve are equal. (P0 = Pm-1, P0 = Pm-1)
Assume that the cubic spline has m-1 segments interpolating m points, P0
to Pm. Therefore, there are m-2 internal joints and m-2 equations.

P0 = Pm-1,


P0 = 3(2 Pm 2 2 Pm1 + Pm 2 + Pm1 ) + 2(3Pm 1 3Pm 2 2 Pm 2 Pm 1 ) + Pm 2


Pm 2 = P0 + Pm 2 Pm 1
P0 = Pm-1,


2(3P1 3P0 2P0 P1 ) = 6(2Pm2 2Pm1 + Pm2 + Pm1 ) + 2(3Pm1 3Pm2 2Pm2 Pm1 )


3P0 + 3P1 3Pm2 + 3Pm1 = 2 P0 + P1 + Pm 2 + 2 Pm1


3P0 + 3P1 + 3Pm1 = 5P0 + P1 + 4 Pm 2 Pm1


5 1 . . . 4 1 P0 3( P1 P0 + Pm 1 )
1 4 1 . . . . 3( P P )
1 P 2 0
. 1 4 1 . . . P 3( P3 P1 )
2
. . 1 4 1 . . . = 3( P4 P2 )
. . . . . . . . .


. . . . . . . Pm 2 .
. . . . 1 4 1
Pm 1 3( Pm 1 Pm 3 )

[m-1][m-1] x[m-1][1]=[m-1][1]

(4) Anti-Cyclic cubic spline is similar to the cyclic spline, except that

and

This type of spline is useful for producing parallel end spans with end tangent
vectors which are equal in magnitude but opposite in direction.

Figure 10.17 Anticyclic and cyclic cubic splines


Both cylic and anti-cylic cubic splines are used to produce a closed curve or a
portion of a curve, which repeats at intervals.

Figure 10.18 Curve approximates the given points without necessarily passing through all of them

Bezier Curves
In the early 1960s, P. Bezier (Renault - Franch car company) started working
on it to give the designer greater flexibility than the interpolating techniques.

Bezier curves employ control points (control vertices), i.e. an ordered set of
points (V0, , Vn) that approximate the curve. A Bezier curve of degree n,
specified by n+1 control points, is a parametric function:

(10.58)
The blending function (Bernstein polynomials):

(10.59)
where n is the degree of the polynomial and the binomial coefficient:

(10.60)
These blending functions satisfy the following conditions:

(10.61)
The eqs. (10.61) is called the normalizing property. These conditions force
the curve to lie entirely within the convex figure set by the extreme points of the
polygon formed by the control points, called the convex hull.

Figure 10.19 Bezier curves satisfy the convex hull property

Figure 10.20 Changes on a Bezier curve

For example:
Consider the case of four control points V0, V1, V2, V3, since n+1 = 4, the
degree n of the polynomial is 3. Expanding Eq. 10.38 yields

Q (t ) = V0 B0,3 + V1 B1,3 + V2 B2,3 + V3 B3,3


Four blending functions must be found based on the Bernstein polynomial
given in Eq. 10.59
3! 0
B0,3 = t (1 t )3 = (1 t )3
0!3!
3! 1
B1,3 = t (1 t ) 2 = 3t (1 t ) 2
1!2!
3! 2
B2,3 = t (1 t )1 = 3t 2 (1 t )
2!1!
3! 3
B3,3 = t (1 t )0 = t 3
3!0!
Note that the normalizing property applies to the blending functions, which
means that they add to one.

[(1 t )3 ] + [3t (1 t ) 2 ] + [3t 2 (1 t )] + t 3 = 1

So Q (t ) = (1 t )3V0 + 3t (1 t ) 2 V1 + 3t 2 (1 t )V2 + t 3V3


Note that at t=0, Q(0) = V0
t=1, Q(1) = V3

In matrix form
V0
V
3 1
Q(t ) = (1 t )3 3t (1 t ) 2 3t (1 t ) t
2
(10.68)
V2

V3
Closed curves

Figure 10.21 Closed Bezier curves Figure 10.22 Bezier curves lack local control.

Disadvantages:
1. Bezier curves lack local control
2. For improved design flexibility a large number of control points resulting in a
high-degree polynomial that can be difficult to handle.
To solve the second problem, curves with a large number of control points are
generated by connecting several segments of lower degree.

For improved design flexibility a large number of control points is necessary,


resulting in a high-degree polynomial that can be difficult to handle. To keep
the degree of the curve low and still obtain the required design flexibility,
curves with a large number of control points are genereated by connecting
several segments of lower degree, as shown in Figure 10.23. Here, two

segments V0 , V1 , V2 , V3 , V4 and V0* , V1* , V2* , V3* , V4* were used. C1 continuity

is usually applied to piecewise Bezier curves, which also imples C0 continuity.

Figure 10.23 Piecewise Bezier curve

C1 continuity is usually applied to piecewise Bezier curves, which also implies


C0 continuity. In other words, the control point joining two segments and the
points immediately before and after is must be co-linear.

Figure 10.24(b) Curve traces simulating the shape of a car


body, created by joining two Bezier formed by several cubic
1
Bexier segments joined with C continuity.
Figure 10.24 (a) Curve traces representing an
airfoil segments with C0 continuity.

Example 10.6
The slope continuity ( C1 ) requirement of Bezier curves forces two curves to
share the same parametric slope at the common point. Given two Bezier
curves defined by the following sequence of control points,
1st curve: A(2, 3, 4) B(3, 1, 5) C(x, y, z) D(3, 4, 3)
2nd curve: D(3, 4, 3) E(2, 6, 0) F(5, 7, 5) G(5, 2, 3)
establish the algebraic conditions that x, y, z must satisfy to ensure C1
continuity.

Solution
Eq. 10.68 can be differentiated with respect to t to find he tangent vectors:

V0
V
Q ' ( t ) = 3 (1 t )

2
(
3 3t 2 4t + 1 ) 3t ( 3t 2 ) 3t 2 1
V2

V3

To ensure C1 continuity at the joint between segments, Q ' ( t ) at t = 1 for the

first segment should equal Q ' ( t ) at t=0 for the second segment.

A
B
Q1 (1) = [ 0 0 3 3] = 3 ( D C )
'

C

D
Second segment (t = 0):
D
E
Q2' ( 0 ) = [ 3 3 0 0] = 3 ( E D )
F

G
As previously stated:

Q1' (1) = Q2' ( 0 )

To take into account variable magnitudes for the tangent vector ( slope remains
constant ), this equality can be written as:

Q1' (1) = kQ2' ( 0 )

where k is a constant.
Substitution appropriate values:
3 ( D C ) = 3k ( E D )
3 ( 3 4 3) ( x y z ) = 3k ( 2 6 0 ) ( 3 4 3)
or

3 ( 3 x )( 4 y )( 3 z ) = 3k [ 1 2 3]
And the algebraic conditions are

3 x = k x = 3 + k
4 y = 2 k y = 4 2k
3 z = 3k z = 3 + 3k

B-Spline Curves
To avoid high-degree polynomials and reduce the global effect, Bezier curves
are frequently built by connecting several segments of lower degree. This
permits local control and the freedom to alter the degree at the expense of
continuity.

Local control: if one vertex is moved only some curve segments are affected
and the rest of the curve remains invariant.
The curvature continuity, C2, guaranteed by cubic B-spline is preferred.

Uniform cubic B-spline

Figure 10.25 Uniform cubic B-spline basis functions, Ni(t).

Figure 10.26 Uniform cubic B-spline curve with six control points
Pi (t ) = N 0,3 (t )Vi + N 1,3 (t )Vi +1 + N 2,3 (t )Vi + 2 + N 3,3 (t )Vi +3

where N j ,3 (t ) = a j + b j t + c j t 2 + d j t 3 , j = 0,1,2,3 , ti<t<ti+4, knot vector is (ti,

ti+1, ti+2, ti+3, ti+4)


16 unknown polynomial coefficients

The first and second derivatives are identically zero at the left and right
endpoint (6 knowns)

N 0,3 (0) = N 0 ,3 (0) = N 0,3 (0) = 0, at the left end; N 0,3 (1) = N 0 ,3 (1) = N 0,3 (1) = 0, at

the right end


0 1 2
C , C , C continuity at the three internal knots of the basic functions (nine
knowns)
Normalizing condition summation of all these basic functions is equal to
one (one known)

Uniform cubic B-spline equation


1 3 3 1 Vi 1
3 6 3 0 Vi
Pi (t ) =
6
[
1 3
t t2 t 1 ]
3 0 3 0 Vi +1
(10.75)

1 4 1 0 Vi + 2

Uniform quadratic B-spline equation


1 2 1 Vi 1
1
Pi (t ) = t 2
2
[ ]
t 1 2 2 0 Vi (10.77)
1 1 0 Vi +1

Figure 10.28 Closed quadratic unidorm B-spline curve.


Example 10.7
Find the starting and ending locations for a uniform quadratic B-spline
segment.

Solution
Eq. 10.77 will be used in the solution of this problem. Knowing that the
segment starts at t = 0 and ends at t = 1, substitution into Eq. 10.77 yields:
For t = 0
1 2 1 Vi 1
Pi ( 0 ) = [ 0 0 1] 2 2 0 Vi
1
2
1 1 0 Vi +1
1
Pi ( 0 ) = (Vi 1 + Vi )
2
For t = 1
1 2 1 Vi 1
Pi (1) = [1 1 1] 2 2 0 Vi
1
2
1 1 0 Vi +1
1
Pi (1) = (Vi 1 + Vi )
2
Thus, for uniform quadratic B-splines, the joints between segments are located
halfway between the control vertices, as shown in Figure 10.29.

Figure 10.29 Location of joints between uniform quadratic B-spline segments.


Example 10.8
Use four control vertices to approximate a circle by a closed, uniform,
quadratic B-spline. Check the error incurred in the approximation at t = 0.5 in
the first segment.

Solution
In this solution the circle is assumed to have its center at the origin of the
coordinate axis (see accompanying figure). Since this is a quadratic B-spline
approximation, each of the four segments-I, II, III, IV- will be formed by three
control vertices, as follows:
Segment I- V0 V1 V2
Segment II- V1 V2 V3
Segment III- V2 V3 V0
Segment IV- V3 V0 V1
Each segment is obtained using equation 10.77. Segment I, for example< will
be as follows:

1 2 1 r r
t 1 2 2 0 r r
1
P ( t ) = t 2
2
1 1 0 r r

1
To find the error incurred in this formulation, calculate the value of P for t = .
2
If the exact circle had been generated, this value should be equal to the radius,
1
r. Substitution t = into the equation above yields
2
r r
1 1 1 3 1
P = r r
2 2 8 4 8
r r
1 3 3
P = r r
2 4 4

3 2
And the radius becomes r or 1.061r
4
The error is approximately 6.1%, at t = 0.5 in the first segment.
Conversion between representations
Under the condition of same degree of freeform curves, the conversion of
these freeform curves is
x = [t ][ M ] from [V ] from = [t ][ M ]to [V ]to
Therefore, [V ]to = [ M ]to1 [ M ] from [V ] from

Table 10.2
Hermite Bezier B-Spline
2 2 1 1 1 3 3 1 1 3 3 1
3 3 2 1 3 6 3 0 0
1 3 6 3
0 0 1 0 3 3 0 0 6 3 0 3 0

1 0 0 0 1 0 0 0 1 4 1 0

Table 10.3
From
Hermite Bezier B-Spline
To
1 0 0 0 1 0 0 0 1 4 1 0
0 1 0 0 0 0 0 1 1
10 1 4
Hermite
0 0 1 0 3 3 0 0 6 3 0 3 0

0 0 0 1 0 0 3 3 0 3 0 3
3 0 0 0 1 0 0 0 1 4 1 0
1 0 0 0 0
1 3 0 1 0 1 0 4 2
Bezier
3 0 3 0 1 0 0 1 0 6 0 2 4 0

0 3 0 0 0 0 0 1 0 1 4 1
3 6 7 2 6 7 2 0 1 0 0 0
0 2 1 0 0 0
1 6 3 2 1 1 0
B-Spline
3 3 6 1 2 0 1 2 0 0 0 1 0

6 3 2 7 0 2 7 6 0 0 0 1

Example 10.9
Given a cubic Bezier curve represented by the control points

P1 ( 6, 0, 0 ) , P2 ( 3, 4, 0 ) , P3 ( 3, 4, 0 ) and P4 ( 6, 0, 0 ) , find:

(a) The control points that would reproduce this curve as a uniform cubic
B-spline.
(b) The geometric coefficient matrix that would reproduce this curve as a
Hhermite.

Solution
(a) From Table 10.3 the conversion from a cubic Bezier representation to a
cubic uniform B-spline is obtained, so that
6 7 2 0 6 0 0 1
0 2 1 0 3 4 0 1
[V ]BS = 0 1 2 0 3 4 0 1

0 2 7 6 6 0 0 1
or
9 36 0 1
9 12 0 1
[ ]BS 9 12 0 1
V =

9 36 0 1
(b) Again from Table 10.3, the conversion is given by

1 0 0 0 6 0 0 1
0 0 0 1 3 4 0 1
[V ]H = [G ]H
3 3 0 0 3 4 0 1

0 0 3 3 6 0 0 1
and
6 0 0 1
6 0 0 1
[V ]H =
9 12 0 1

9 12 0 1

General B-Spline Representation

where Vi is the set of control points and N i ,k represents the appropriate

blending function of degree (k-1).

(10.82)
where the knot vector is [ti, , ti+k]. I.e. a B-spline of order k in the ith span is
the weighted average of the B-splines of order (k-1) in the ith and (i+1)st
spans.

Order k or degree (k-1) spline is defined as a piecewise (k-1)st degree


polynomial, i.e. Ck-2 continuous.
It means:
(a) The degree of the polynomial does not exceed (k-1) inside each [ti,ti+1]
interval;
(b) The position and [1 to (k-2)] derivatives are continuous.

The knots form a vector [t0, ,ti-1,ti+1, ,tn+k] of real numbers called the knot
vector, in non-decreasing order (ti<=ti+1).

Like Bezier curves, B-splines satisfy the convex-hull property and the
normalizing property.
Assume a knot vector [t0, ,tm]

(10.83)
or m=n+k

The knot vectors can be classified as:


1. Uniform/Periodic (parameter range (k-1)t(n+1))
2. Nonperiodic/Open (no loss of parameter range, the curve interpolates the
first and last control points)
3. Nonuniform (no loss of parameter range, the curve interpolates the first
and last control points)
4. Uniform/Periodic
A uniform knot vector has equal-spaced ti values, so that ti-ti-1=a for all
intervals.
The higher the order is, the shorter the length of the curve, parameter
represented by the expression
(k-1)t(n+1).

Uniform Cubic B-splines - To generate a uniform cubic B-spline curve, four


control vertices are multiplied at a time with the basis functions.

Table 10.4 shows th evariabtion of the parameter range and knot vector for the
B-spline curves shown in Figure 10.30.

Table 10.4
Figure 10.30 Uniform B-splines of various degrees.

z Nonperiodic/Open

ti = 0 i < k
t i = i k + 1 k i n (10.85)
ti = n k + 2 i > n

Order No.of control No.of knots


Nonperiotic knot vector
(k) points (m+1=n+k+1)
2 4 6 (0 0 1 2 3 3)
3 4 7 (0 0 0 1 2 2 2)
4 4 8 (0 0 0 0 1 1 1 1)
3 5 8 (0 0 0 1 2 3 3 3)
4 5 9 (0 0 0 0 1 2 2 2 2)
3 6 9 (0 0 0 1 2 3 4 4 4)
3 7 10 (0 0 0 1 2 3 4 5 5 5)
4 7 11 (0 0 0 0 1 2 3 4 4 4 4)
6 6(Bezier) 12 (0 0 0 0 0 0 1 1 1 1 1 1)

Figure 10.31 Nonperiodic B-splines of various degrees.


Figure 10.32 Cubic nonperiodic B-spline exhibiting local control.

Bezier representation is a special case of a nonperiodic B-spline, where the


number of vertices used identifies to the order of the curve.

Nonuniform in the nonperiodic knot vector, multiplicity of knot values


occurred at the ends and the internal knots were equal-spaced. If either or both
of these conditions are not satisfied, the knot vector is said to be nonuniform.
When is the right moment to use nonuniform B-spline?
Although uniform knot spacing is easy to use, somehow, undesirable
oscillations may occur when using a uniform B-spline curve with highly
unevenly spaced data points.

Figure 10.33 Nonuniform cubic B-splines.


B-spline recursive formula
Example 10.10
Apply Eqs. 10.87 to 10.98 to a uniform / periodic B-spline which has the
variable t modified as follows:
(a) t is reparameterized so that it varies within equal subintervals:
0 t 1,1 t 2 , and so forth.
(b) t is locally reparameterized so that, for each B-spline segment, the
parameter t ranges from zero to one. Do this for quadratic and cubic
B-splines.
Solution
(a) With t reparameterized within the equal intervals given, the blending
functions become
t 0 t 1
k = 2 Liner N i ,2 ( t ) = (10.99)
2 t 1 t 2
1 2
t 0 t 1
2

3 3
2

k = 3 Quadratic N i ,3 ( t ) = t 1 t 2 (10.100)
4 2
1
(3 t )
2
2t 3
2
1 3
t 0 t 1
6

2 1 3
3

3 2 2 (t 2) 1 t 2
2
t

k =4 Cubic N i ,4 ( t ) = 3
2 1 3
3 + 2 t 2 ( t 2 )
2
2t 3

1
(4 t ) 3t 4
3
6
(10.101)

(b) In this case t is replaced by (t + i ) in each individual interval in Eqs. 10.99 to


10.101.
For the quadratic and cubic B-splines ( Eqs. 10.100 and 10.101 ), this local
reparameterization yields
Quadratic Cubic
1 3
t
1 2
6
t
2 1 3
3
2
3 2 2 (t 2)
2
t
3 3
2

N i ,3 ( t ) = t N i ,4 ( t ) = (10.102)
4 2
3
2 1 3
3 + 2 t 2 ( t 2 )
2
1
(3 t )
2

2 1
(4 t )
3
6
The blending functions for the uniform cubic B-spline in this equation are
identical to the ones listed in Eq.10.74.

Example 10.11
Find the blending functions for a nonperiodic quadratic B-spline curve, defined
over five control points.

Solution
For this B-spline: k = 3 ( order )
n = 4 ( no. of control vertices = n + 1 = 5 )
m=7(n+k)

We have a series of eight knots varying from t0 and t7 , with multiplicity of k

= 3 at the ends. A knot vector [t ] = {0, 0, 0,1, 2,3,3,3} will be used.

Eq.10.82 is applied recursively in the definition of the blending functions.


Individual knots are

t0 = t1 = t2 = 0
t3 = 1
t4 = 2
t5 = t6 = t7 = 3
For k =1

N 0,1 = 1 if t = 0 and 0 elsewhere

N1,1 = 1 if t = 0 and 0 elsewhere

N 2,1 = 1 if 0 t 1 and 0 elsewhere


N 3,1 = 1 if 1 t 2 and 0 elsewhere

N 4,1 = 1 if P4 ( 4, 2 ) , P1 (1,1) , P2 ( 2, 1) , P3 ( 3,1) , and 0 elsewhere

N 5,1 = 1 if t = 3 and 0 elsewhere

N 6,1 = 1 if t = 3 and 0 elsewhere

For k = 2

N 0,2 =
( t t0 ) N + ( t 2 t ) N = 0 + 0 = 0
( t1 t0 ) 0,1 ( t2 t1 ) 1,1
( t t1 ) N + ( t3 t ) N = 0 + 1 t = 1 t
N1,2 = ( ) for 0 t < 1
( t2 t1 ) 1,1 ( t3 t2 ) 2,1

N 2,2 =
( t t2 ) N + ( t4 t ) N = t for 0 t < 1

( t3 t2 ) 2,1 ( t4 t3 ) 3,1 ( 2 t ) for 1 t < 2

N 3,2 =
( t t3 ) N + ( t5 t ) N = ( t 1) for 1 t < 2

( t4 t3 ) 3,1 ( t5 t4 ) 4,1 ( 3 t ) for 2 t < 3

( t t 4 ) N + ( t6 t ) N = t 2
N 4,2 = ( ) for 2 t < 3
( t5 t4 ) 4,1 ( t6 t5 ) 5,1
For k = 3

( t t 0 ) N + ( t3 t ) N = 1 t 2
N 0,3 = ( ) for 0 t < 1
( t2 t0 ) 0,2 ( t3 t1 ) 1,2
t
( t t1 ) ( t4 t ) t (1 t ) + 2 ( 2 t )
N1,3 = N + N =
( t3 t1 ) 1,2 ( t4 t2 ) 2,2 1 ( 2 t )2
2
for 0 t < 1

for 1 t < 2

1 2
t
2

N 2,3 =
( t t2 ) N + ( t4 t ) N 1 1
= t ( 2 t ) + ( 3 t )( t 1)
( t4 t2 ) 2,2 ( t5 t3 ) 3,2 2 2
1
(3 t )
2

2
for 0 t < 1

for 1 t < 2

for 2 t < 3
1
( t 1)
2

N 3,3 =
( t t3 )
N +
( t6 t )
N =
2
( t5 t3 ) 3,2 ( t6 t4 ) 4,2 1 ( t 1)( 3 t ) + ( 3 t )( t 2 )
2
for 1 t < 2

for 2 t < 3

( t t 4 ) N + ( t7 t ) N = t 2 2
N 4,3 = ( ) for 2 t < 3
( t6 t4 ) 4,2 ( t7 t5 ) 5,2
Multiplicity of control points

Figure 10.36 Effect of multiplicity of control points on the shape of B-spline curves
B-Spline Formulation-Highlights
Here summarizes the many important relationships and definitions used in the
previous sections for formulation B-splines.

B-Spline General Form


n
P ( t ) = N i ,k ( t ) Vi defining a point on the curve
i =0

where i indicated position: Vi control point I, ti knot i, and


k is order of curve
(n+1) is number of control points

N i ,k ( t ) are blending functions given by Eq. 10.82

Vi are control points


Continuity

Continuity of position, Co

1 to ( k 2 ) derivatives are continuous

Knot Vectors
These are the parametric intervals within which the blending functions are

defined. For example: [t0 ...... tm ]

The elements ti of the knot vector must satisfy the relation: ti ti +1


The relationship among
degree of the curve (k-1)
no. of control points (n+1)
no. of knot (m+1)
is given by
m= n + k
Classification of Knot Vectors:
I. Uniform/ Periodic
( ti ti 1 ) = constant
Influence of each basis function is
limited to k ( see Figure 10.34 ).

Parameter range: ( k 1) t ( n + 1)
Example: [0 1 2 3 4]

II. Nonperiodic
Satisfies the following equations:

ti = 0 for i<k
ti = i k + 1 for k i n

ti = n k + 2 for i > 0

for a knot vector starting at i = 0 and (n + 1) control points.

No loss of parameter range, so that the curve interpolates


the first and last control points.

Example: [0 0 1 2 2 2]
III. Nonuniform
Knot vector is not equispaced.

Example: [ 0 1 2 3 3 4]

Bezier Representation
It is simply a special case of the general B-spline formulation when the
following conditions are satisfied:
The number of defining polygon vertices is equal to the order of the
B-spline basis.
A nonperiodic knot vector is used.
For example:
No. of control points = 4 (i.e., n = 3)
Order of the curve, k = 4

Open periodic knot vector: [0 0 0 0 1 1 1 1]

Rational Curves
A procedure that allows the incorporation of both types of curves (freeform and
conics) is the use of rational polynomial functions.
The term rational means these functions are obtained by the ratio of two
polynomials.
Considering the Bezier curve

The weights wi give an added degree of freedom to the design of curves.


NURB (NonUniform Rational B-spline) is popular because the NURB
representation includes all B-splines, Bezier and conic curves.
Figure 10.37 Rational curves, with varying weight values at V4.

Figure 10.38 Nonperiodic cubic rational B-spline.

For computational efficiency, rational quadratic B-splines (n=2, k=3) are best
suited to represent the conics, since they provide the lowest order possible.
The knot vector can be determined by the order the the number of control
points. Defining the quadratic rational B-spline by three control points, with
0t1 and a knot vector [t] = [ 0 0 0 1 1 1], yields:
N 0,3 (t ) w0 v0 + N1,3 (t ) w1v1 + N 2,3 (t ) w2 v2
P(t ) =
N 0,3 (t ) w0 + N1,3 (t ) w1 + N 2,3 (t ) w2

This equation defines a one-parameter family of conics, with each conic


passing through V0 and V2, and tangent to the chords [V0 V1] and [V1 V2], as
shown in Figure 10.40. Included in this family are ellipses, parabolas, and

hyperbolas. If w0 = w2 = 1 , the equation reduces to

N 0,3 (t )V0 + N1,3 (t ) wV


1 1 + N 2,3 (t )V2
P(t ) =
N 0,3 (t ) + N1,3 (t ) w1 + N 2,3 (t )
The various conics are obtained by adjusting V0, V1, V2, and w1. The value of
w1 determines what conic type will be obtained, such that
w1 = 0 straight line
0 < w < 1
1 elliptic segment

w1 = 1 paraboics egment
w1 > 1 hyperbolic segment

Figure 10.39 Examples of cubic NURBs.

Figure 10.40 Nonuniform rational quadratic B-spline representation of conics.


NURBs become one of the Initial Graphics Exchange Standard (IGES) for
curve or surface definition.

Two types of application problems


1. Interpolation of scattered data points, using Lagrange polynomial,
parametric cubics, and cubic splines.
2. Approximation for shape designs, using Bezier and B-spline curves.

Example 10.12
This problem will compare the shape of curves resulting from the use of
various curve-defining techniques. Given the data points

P0 ( 0, 0 ) , P1 (1,1) , P2 ( 2, 1) , P3 ( 3,1) and P4 ( 4, 2 ) , desire a curve that will

interpolate them using the following techniques:


(a) Lagrange polynomial
(b) Natural cubic spline
(c) Bezier representatioin in this case the Bezier control polygon that
forces the curve to pass through the points will have to be found.
(d) Nonperiodic, quadratic B-spline representation - in this case the
control polygon will also have to be definded.

Solution
(a) Lagrange polynomial. The Lagrangian interpolation formula is given in Eq.
10.26. For this problem it becomes
x ( x 2 )( x 3)( x 4 ) x ( x 1)( x 3)( x 4 ) x ( x 1)( x 2 )( x 4 ) x ( x 1)( x 2 )( x 3)
f ( x) = 0 + (1) + ( 1) + (1) + ( 2)
(1 0 )(1 2 )(1 3)(1 4 ) ( 2 0 )( 2 1)( 2 3)( 2 4 ) ( 3 0 )( 3 1)( 3 2 )( 3 4 ) ( 4 0 )( 4 1)( 4 2 )( 4 3)

Figure 10.41
(b) Natural cubic spline. Equation 10.57 is used to solve the problem, as
follows:

2 1 0 0 P0' 3 ( P1 P0 )
0 P0' 1.67 .94
1 '
4 1 0 P1' 3 ( P2 P0 )
0 P1 1.33 .881

0 1 4 0 P2' = 3 ( P3 P1 ) and P2' = .833 .42
1
'
0 0 1 1 P3' 3 ( P4 P2 )
4 P3 1.33 2.55
0 0 0 1 2 P4' 3 ( P4 P3 ) P ' 1.67 0.77
4

A plot of the nature cubic curve obtained from the application of these
tangent vectors to the given points is shown in Figure 10.41.
(c) Bezier curve. Five control vertices are to be found, describing a fourth
degree Bezier curve (order = 5). The blending functions for this Bezier
curve are obtained from Eq., as follows:

B0,4 = (1 t )
4

B1,4 = 4t (1 t )
3

B2,4 = 6t 2 (1 t )
2

B3,4 = 4 (1 t ) t 3
B4,4 = t 4

or, in matrix form:

1 4 6 4 1
4 12 12 4 0

t t 1 6 12 6 0
4
t3 t2 0

4 4 0 0 0
1 0 0 0 0

The parameter values t along the Bezier curve corresponding to the data points
can be found as an approximation to the chord length between each two data
points:

(1 0 ) + (1 0 ) = 2
2 2
L21 = P2 P1 =

( 2 1) + ( 1 1) = 5
2 2
L32 = P3 P2 =

(3 2) + (1 + 1) = 5
2 2
L43 = P4 P3 =

L54 = P5 P4 = ( 4 3) + ( 2 1) = 2
2 2

The total chord length is L51 = L21 + L32 + L43 + L54 = 7.3
and the parameter values become
t1 = 0
t2 L21 2
= = = 0.19
tmax L51 7.3
t3 L31 5+ 2
= = = 0.5
tmax L51 7.3
t4 L41 5+ 2+ 5
= = = 0.81
tmax L51 7.3
t5 L51
= =1
tmax L51

where tmax is the maximum parameter value, equal to one in he Bezier

formulation.
Substituting these t values into the blending function equations for the quartic
Bezier curve yields:

1 0 0 0 0
.4305 .4039 .1421 .0222 .0013

[ B ] = .0625 .25 .375 .25 .0625 0

.0013 .0222 .1421 .4039 .4
0 0 0 0 1
The control vertices are found from:

[V ]B = [ B ] [ P ]B
1

1 0 0 0 0 0 0
1.375 3.423 1.601 .803 .25 1 1

= .916 2.817 4.802 2.817 .916 2 1

.25 .803 1.602 3.423 1.375 3 1
0 0 0 0 1 4 2
0 0
1.629 5.327

= 2 8.604

2.37 3.078
4 2

Figure 10.41 shows a plot of this curve.


(d) Nonperiodic, quadratic B-spline. For this problem, five control vertices are
used, and the order of the curve is k = 3. The knot vector, based on Eq.

10.85, is [0 0 0 1 2 3 3 3]
which maximum knot value equal to 3. The same chord approximation used in

the Bezier case is applied, knowing that tmax here is equal to 3, so that

t1 = 0
t2 = 0.57
t3 = 1.5
t4 = 2.43
t5 = 3
For k = 3 and five control points, the blending functions N were derived in
Ezample 10.11 and, for the values of t found in this problem, become
for t1 = 0

N 0,3 = 1 and all others are zero.

for t2 = 0.57
N 0,3 = (1 t ) = 0.1849
2

t
N1,3 = t (1 t ) + ( 2 t ) = 0.6527
2
t2
N 2,3 = = 0.1625
2
for t3 = 1.5
(2 t )
2

N1,3 = = 0.125
2
t (2 t ) ( 3 t )( t 1) = 0.75
N 2,3 = +
2 2
( t 1)
2

N 3,3 = = 0.125
2
for t4 = 2.43

(3 t )
2

N 2,3 = = 0.1625
2
( t 1)( 3 t ) 3
N 3,3 = + ( t )( t 2 ) = 0.6527
2
N 4,3 = ( t 2 ) = 0.1849
2
for t5 = 3

N 4,3 = 1 and all others are zero.

In matrix form:
1 0 0 0 0
.1849 .6527 .1625 0 0

[ N ] = 0 .125 .75 .125 0

0 0 .1625 .6527 .1849
0 0 0 0 1
The control vertices are given by:

[V ]Bs = [ N ] [ P ]Bs
1

0 0
0 0 1.034 2.007
1 1
, [V ]Bs = 2.000 1.908
[V ]Bs = [ N ] 2 1
1

2.965 1.440
3 1 4 2
4 2

A plot of this curve is also shown in Figure 10.41.

Example 10.13 Dummy point for Bezier representation

Вам также может понравиться