5-1 v. space curves types of curves explicit implicit parametric

Post on 12-Jan-2016

268 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

5-1

V. Space Curves

• Types of curves Explicit Implicit Parametric

5-2

data pointsapproximating curve

interpolating data point

• Modeling with curves

• Curves with explicit representation

)(

)(

xgz

xfy

xx

5-3

• Curves with implicit representation Intersect two surface to get a curve

0),,(

0),,(

zyxg

zyxf

• Parametric space curves ,

Example: The parametric equations of the circular helix are given by

)(

)(

)(

tzz

tyy

txx

21 ttt

p(t)

p(t1)

p(t2)

5-4

Selecting Functions• Usually we can select “good” functions

not unique for a given spatial curve Approximate or interpolate known data Want functions which are easy to evaluate Want functions which are easy to differentiate

• Computation of normals• Connecting pieces (segments)

Want functions which are smooth

5-5

Parametric Lines

• Line connecting two points p0 and p1

p(t)=(1-t)p0+tp1

• We can normalize t to be over the interval (0,1)

p(0) = p0

p(1)= p1

• Ray from p0 in the direction d

p(u)=p0+td

p(0) = p0

p(1)= p0 +d

d

5-6

Parametric Polynomial Curves

tBtx iN

ixi

1

1

)(

tBty j

M

jyj

1

1

)(

tBtz k

L

kzk

1

1

)(

• If N=M=L, we need to determine 3N coefficients

• Equivalently we need 3N independent conditions

• Noting that the curves for x, y and z are independent, we can define each independently in an identical manner

• We will use the form where P can be any of x, y, z

tBt iN

ii

1

1

)(

P

)]()()([)( tztytxt P

5-7

• N=M=L=3:

Cubic Splines

34

2321

14

1

)(

tBtBtBB

tBt i

ii

P

21 ttt tBtz

tBty

tBtx

i

iiz

i

iiy

i

iix

14

1

14

1

14

1

)(

)(

)(

5-8

• Four coefficients to determine for each of x, y and z

• Seek four independent conditions for various values of t resulting in 4 equations in 4 unknowns for each of x, y and z

• Boundary conditions:

, and let t1= 0 221

221

)(,)0(

)(,)0(

PPPP

PPPP

t

t

5-9

• Piecewise cubic spline through n given position vectors , , with end tangent vectors and

nk 11P

nP• The internal tangent

vectors 132 ,,, nPPP can be determined by imposing the continuity conditions at the internal joints, i.e., the second derivatives or the curvature are continuous across the joints.

kP

4

1

3)2)(1()("i

iitBiitP•

5-10

5-11

• The generalized equation for a piecewise cubic spline

11,0)( 11

4

1

nktttBt k

i

iikkP

5-12

Blending or weighting functions:

5-13

• Any point on a cubic spline segment is a weighted sum of the end position and tangent vectors

][][)( GFtk P• In matrix form: , where

function, and

contains the geometric information.

])()()()([][ 3321 FFFFF

][][ 11 kkkkTG PPPP

is a blending

5-14

5-15

5-16

5-17

5-18

5-19

• Normalized cubic spline: segment parameter values is normalized to unity, i.e., 10 t

Blending functions become:

][][][][][)( GNTGFt P

5-20

The internal tangent vectors required in ,][Gnow becomes

5-21

5-22

5-23

5-24

5-25

Bezier Curves

n

iini tJBtP

0, )()( 10 t

iB

iniin tt

i

ntJ

)1()(, )!(!

!

ini

n

i

n

)(, tJ in

• Mathematically a parametric Bezier curve is defined by

where is the position vectors of the vertices of the defining polygon, and

is the ith nth-order Bezier or Bernstein basis or blending function. Here n, the degree of the defining Bernstein basis function and thus of the polynomial curve segment, is one less than the number of points in the defining Bezier polygon.

5-26

The vertices of the Bezier polygon are numbered from 0 to n.

• Properties of Bezier curve - The basis functions are real. - The degree of the polynomial defining the curve segment

is one less than the number of defining polygon points.

5-27

- The curve generally follows the shape of the defining polygon.

- The first and last points on the curve are coincident with the first and last points of the defining polygon.

- The tangent vectors at the ends of the curve have the same direction as the first and last polygon spans, respectively.

- The curve is contained within the convex hull of the defining polygon, i.e., within the largest convex polygon obtainable with the defining polygon vertices

- The curve is invariant under an affine transformation.

5-28

• The maximum value of each blending function occurs at , and is given bynit /

n

ini

in n

ini

i

n

n

iJ

)()(,

5-29

1)(0

,

n

iin tJ

• For any given value of the parameter t, the summation of the basis functions is precisely one; i.e.,

5-30

5-31

5-32

][][][

][][)(

GNT

GFtP

][][ ,1,0, nnnn JJJF

][][ 10 nT BBBG

]1[][ 1 tttT nn

• The matrix form for a Bezier curve

where

5-33

The individual terms in [N] can be given by

5-34

][][][ DCN [N] can be also decomposed into the form:

where

5-35

3n• For example, considering four defining polygon

points ( ), the cubic Bezier curve is given by

• The first and second derivatives of a Bezier curve

5-36

5-37

5-38

5-39

5-40

5-41

• Two characteristics of the Bernstein basis limit the flexibility of the Bezier curves

- First the number of specified polygon vertices fixes the order of the resulting polynomial which defines the curve.

- Second the global nature of the Bernstein basis limits the ability to produce a local change within a curve. Since the value of the blending function is nonzero for all parameter values over the entire curve and any point on a Bezier curve is a result of blending the values of all defining vertices, a change in one vertex is felt throughout the entire curve

5-42

B-spline Curves• B-spline basis function is generally nonglobal. The

nonglobal behavior of B-spline curves is due to the fact that each vertex is associated with a unique basis function.

• The B-spline basis also allows the order of the basis function and hence the degree of the resulting curve to be changed without changing the number of defining polygon vertices.

• A B-spline Curve is given by

12)()( maxmin

1

1,

nktttttn

ikiiNBP

5-43

)(, tN ki

where Bi are the position vectors of the defining polygon vertices and are the normalized B-spline basis functions. For the ith normalized B-spline basis function of order k (degree ), the basis functions

formulas:

1nkiN ,

1kare defined by the Cox-deBoor recursion

otherwise0

if1)( 1

1,ii

i

xtxtN

1

1,1

1

1,,

)()()()()(

iki

kiki

iki

kiiki xx

ttx

xx

txtt

NNN

The value of xi are elements of a knot vector satisfying the relation 1 ii xx

5-44

The parameter t varies from tmin to tmax along the curve P(t)

The convention is adopted.00/0 • Formally a B-spline curve is defined as a polynomial

spline function of order k (degree ) since it satisfies the following two conditions:

- The function P(t) is a polynomial of degree on each interval

. - P(t) and its derivatives of order 1, 2, are all continuous over the entire curve.

1k

1k1 ii xtx

2, k

• Properties of B-spline curves:

- The sum of the B-spline basis functions for any parameter value t can be shown to be

1

1, 1)(

n

iki tN

5-45

- Each basis function is positive or zero for all parameter values, i.e.,

- Except for each basis function has precisely one maximum value.

- The maximum order of the curve is equal to the number of defining polygon vertices.

- The curve generally follows the shape of the defining polygon.

- Any affine transformation can be applied to the curve by applying it to the defining polygon vertices; i.e., the curve is transformed by transforming the defining polygon vertices.

- The curve lies within the convex hull of its defining polygon.

0, kiN

1k

5-46

• Convex hull property: For a B-spline curve of order k (degree ) a point on the curve lies within the convex hull of k neighboring points

1k

5-47

• Colinear polygon vertices make the resulting B-spline curve to be a straight line

5-48

• If at least coincident defining polygon vertices occur, then the convex hull of these vertices is the vertex itself, the resulting B-spline curve must pass through the vertex.

1k

5-49

• A B-spline curve is everywhere continuous. 2kC

5-50

• The only requirement for a knot vector is that it satisfy the relation ; , i.e., it is a monotonically increasing series of real numbers.

• The number of knot values is .

• Fundamentally three types of knot vector are used: uniform, open uniform (or open) and nonuniform.

1 ii xx

1 kn

- Uniform knot vector: Individual knot values are evenly spaced, for example: [0 1 2 3 4]; [-0.2 -0.1 0 0.1 0.2]; [0 0.25 0.5 0.75 1.0]. For a given order k, uniform knot vectors yield periodic uniform basis functions for which

)1()1()( ,1,1, tNtNtN kikiki

5-51

- An open uniform knot vector has multiplicity of knot values at the ends equal to the order k of the B-spline basis function. Internal knot values are evenly spaced, for example: [0 0 1 2 3 4 4], [0 0 1/4 1/2 3/4 1 1]; [0 0 0 1 2 3 3 3]. Formally, an open uniform knot vector is given by

2k3k

5-52

When the number of defining polygon vertices is equal to the order of the B-spline basis and an open uniform knot vector is used, the B-spline basis reduces to the Berstein basis. Hence, the resulting B-spline curve is a Bezier curve. In that case, the knot vector is just k zeros followed by k ones. For example, for four polygon vertices the fourth order ( ) open uniform knot vector is [0 0 0 0 1 1 1 1], and a cubic Bezier/B-spline curve results.

4k

5-53

- Nonuniform knot vectors may have either unequally spaced and/or multiple internal knot values. They may be periodic or open. Examples are [0 0 0 1 1 2 2 2]; [0 1 2 2 3 4]; [0 0.28 0.5 0.72 1].

5-54

5-55

• The Cox-deBoor formula used to calculate B-spline basis functions is a recursion relation. A basis function of a given order k depends on lower order basis functions down to order 1. For a given basis function this dependence forms a triangular pattern given by

kiN ,

5-56

5-57

5-58

5-59

5-60

1)1()(1 nkkntk

Note: For a uniform knot vector beginning at 0 with integer spacings the usable parameter range is

For more general or normalized knot vectors, the reduction in usable parameter range corresponds to the loss of knot value intervals at each end of the knot vector.

1k

5-61

5-62

5-63

5-64

5-65

• Different types of control are used to influence the shape of the B-spline Curves

- Change the type of knot vector and hence basis function: periodic uniform, open uniform or nonuniform.

- Change the order k of the basis function.

- Change the number and position of the of the defining polygon vertices.

- Use multiple polygon vertices.

- Use multiple knot values in the knot vector.

5-66

5-67

5-68

5-69

5-70

5-71

5-72

5-73

• Use periodic B-spline curve to generate closed curves: By repeating a total of polygon vertices at the beginning and/or end of the defining closed polygon, a closed periodic B-spline curve is obtained.

2k

5-74

5-75

5-76

• An open nonuniform B-spline curve generated using a knot vector with interior values proportion to the chord distances between polygon vertices, the knot vector is given by

iii BBc 1

5-77

5-78

5-79

5-80

5-81

][][][][][)( GNTGFtP

][][ 11 nT BBG

]1[][ 21 tttT kk

• B-spline curves expressed in a matrix form

- The element of [N] can be obtained using the Cox-deBoor algorithm for each nonzero interval in the knot vector [X]

• The derivatives of a B-spline curve

5-82

0)('1, tN i

0)("1, tN i 0)("

2, tN i

5-83

5-84

5-85

5-86

• End conditions for periodic B-spline curves: Techniques for controlling the position of the start and end points and the conditions at those points fall into two categories: multiple vertices and pseudovertices.

5-87

• B-spline curve fit

For j data points lie on the B-spline yield

5-88

][][][ BND

where . This system of equation can be written in matrix form as

jnk 12

][][][ 1 DNB

- If , then the matrix [N] is square and the defining polygon is obtained directly by matrix inversion:

jnk 12

5-89

][][][][][

][][][

BNNDN

BNDTT

][][]][][[][ 1 DNNNB TT

- A fairer or smoother curve is obtained by specifying fewer defining polygon points than data points, i.e., . Here, [N] is no longer square. The defining polygon vertices for a B-spline curve that fairs or smoothes the data are given by

jnk 12

5-90

5-91

5-92

5-93

5-94

Rational B-Spline Curves • A rational B-spline curve is given by

where the Bi are the 3D defining polygon vertices for the rational B-spline curve and

are the rational B-spline basis functions. Here, for all values of i .0ih

5-95

• Rational B-spline basis functions and curves are a generalization of nonrational B-spline basis functions and curves, since it is clear that when all , 1ih )()( ,, tNtR kiki

• The analytic and geometric characteristics of a rational B-spline are:

- Each rational basis function is positive or zero for all parameter values, i.e.,

- The sum of the rational b-spline basis functions for any parameter value t is one, i.e.,

0, kiR

1

1, 1)(

n

iki tR

5-96

- Except for , each rational basis function has precisely one maximum.

- A rational B-spline curve of order k (degree ) is continuous everywhere.

- The maximum order of the rational B-spline curve is equal to the number of defining polygon vertices.

- A rational B-spline curve lies within the union of convex hulls formed by k successive defining polygon vertices.

- Any projective transformation is applied to a rational B-spline curve by applying it to the defining polygon vertices; i.e., the curve is invariant with respect to a projective transformation.

- An open rational B-spline curve with order equal to the number of defining polygon vertices is a rational Bezier curve.

1k

1k2kC

5-97

5-98

5-99

5-100

5-101

5-102

5-103

5-104

5-105

5-106

5-107

5-108

5-109

• The derivatives of rational B-spline curves are obtained by

5-110

5-111

5-112

top related