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

112
5-1 V. Space Curves •Types of curves Explicit Implicit Parametric

Upload: norma-thompson

Post on 12-Jan-2016

267 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-1

V. Space Curves

• Types of curves Explicit Implicit Parametric

Page 2: 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

Page 3: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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)

Page 4: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 5: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 6: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 7: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

)(

)(

)(

Page 8: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 9: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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•

Page 10: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-10

Page 11: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-11

• The generalized equation for a piecewise cubic spline

11,0)( 11

4

1

nktttBt k

i

iikkP

Page 12: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-12

Blending or weighting functions:

Page 13: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 14: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-14

Page 15: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-15

Page 16: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-16

Page 17: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-17

Page 18: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-18

Page 19: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-19

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

Blending functions become:

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

Page 20: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-20

The internal tangent vectors required in ,][Gnow becomes

Page 21: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-21

Page 22: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-22

Page 23: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-23

Page 24: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-24

Page 25: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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.

Page 26: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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.

Page 27: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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.

Page 28: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-28

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

n

ini

in n

ini

i

n

n

iJ

)()(,

Page 29: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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.,

Page 30: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-30

Page 31: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-31

Page 32: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-32

][][][

][][)(

GNT

GFtP

][][ ,1,0, nnnn JJJF

][][ 10 nT BBBG

]1[][ 1 tttT nn

• The matrix form for a Bezier curve

where

Page 33: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-33

The individual terms in [N] can be given by

Page 34: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-34

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

where

Page 35: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 36: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-36

Page 37: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-37

Page 38: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-38

Page 39: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-39

Page 40: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-40

Page 41: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 42: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 43: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 44: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 45: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 46: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 47: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-47

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

Page 48: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 49: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-49

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

Page 50: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 51: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 52: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 53: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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].

Page 54: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-54

Page 55: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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 ,

Page 56: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-56

Page 57: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-57

Page 58: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-58

Page 59: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-59

Page 60: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 61: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-61

Page 62: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-62

Page 63: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-63

Page 64: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-64

Page 65: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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.

Page 66: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-66

Page 67: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-67

Page 68: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-68

Page 69: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-69

Page 70: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-70

Page 71: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-71

Page 72: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-72

Page 73: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 74: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-74

Page 75: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-75

Page 76: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 77: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-77

Page 78: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-78

Page 79: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-79

Page 80: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-80

Page 81: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 82: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-82

0)('1, tN i

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

2, tN i

Page 83: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-83

Page 84: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-84

Page 85: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-85

Page 86: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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.

Page 87: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-87

• B-spline curve fit

For j data points lie on the B-spline yield

Page 88: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 89: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 90: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-90

Page 91: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-91

Page 92: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-92

Page 93: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-93

Page 94: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 95: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 96: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

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

Page 97: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-97

Page 98: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-98

Page 99: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-99

Page 100: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-100

Page 101: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-101

Page 102: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-102

Page 103: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-103

Page 104: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-104

Page 105: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-105

Page 106: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-106

Page 107: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-107

Page 108: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-108

Page 109: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-109

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

Page 110: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-110

Page 111: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-111

Page 112: 5-1 V. Space Curves Types of curves Explicit Implicit Parametric

5-112