15 curves and surfaces - computer sciencecs.uky.edu/~cheng/cs535/notes/cs535-curves-1.pdf · 15...

33
1 15 Curves and Surfaces CS Dept, UK Can be used for font, carton character, car body, ..., design/representation

Upload: others

Post on 03-Jun-2020

23 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

1

15 Curves and Surfaces

CS Dept, UK

Can be used for font, carton character, car

body, ..., design/representation

Page 2: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

2CS Dept, UK

15 Curves and Surfaces

Types of Curves:

• Explicit

• Implicit

• Parametric

• Generative: generated with a procedure, e.g.,

subdivision schemes and fractals

Page 3: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

3CS Dept, UK

15 Curves and Surfaces

Why parametric?• Flexible• Not required to be functions

-curves can be multi-valued with respect to any coordinate system

• Parameter count gives theobject`s dimension

• Coord functions independent

Page 4: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

4CS Dept, UK

Specifying Curves

• Control Points:

- a set of points that influence the curve’s shape

• Knots:

- control points that lie on the curve

• Interpolating spline:

- curve passes through the control

points

• Approximating spline:

- control points merely influence

shape

Page 5: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

5CS Dept, UK

Piecewise Parametric Curves

We can represent an arbitrary length curve as a series of curve segments pieced together. WHY?

But we will want to control how these curveSegments fit together.

Page 6: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

6CS Dept, UK

Piecewise Cubic Curves

• In order to assure C2 continuity our functions must be

of at least degree 3. This is also the lowest degreeto describe a non-planar curve

• Cubic has 4 degrees of freedom and can control 4 things

• Use polynomials: x(t) of degree n is a function of t.

y(t) and z(t) are similar and eachis handled independently

• That is:

Page 7: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

7

15.1 Bezier Curve Segments of Degree 3

CS Dept, UK

Matrix form:

Page 8: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

8

15.1 Bezier Curve Segments of Degree 3

CS Dept, UK

Notes:

• Blending functions are

always non-negative

• Blending functions

always sum to 1

Page 9: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

9

15.1 Bezier Curve Segments of Degree 3

CS Dept, UK

A Bezier curve always starts at P0 and ends at P3

A Bezier curve is tangent to the control polygon at the

endpoints

Bezier curve segments satisfy convex hull property

Bezier curves have intuitive appeal for interactive users

Page 10: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

10

15.2 General Bezier Curve Segments

CS Dept, UK

Page 11: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

11

15.2 General Bezier Curve Segments

CS Dept, UK

All the properties mentioned on page 5 hold for general

Bezier curves

Page 12: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

12

15.2 General Bezier Curve Segments

CS Dept, UK

If degree = 3 then

Page 13: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

13

15.2 General Bezier Curve Segments

CS Dept, UK

R

Page 14: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

14

Proof:

CS Dept, UK

Define C1(t) = C(t/2). We have

PMSTPMttttC 8/,4/,2/,1)( 32

1

where

8/1000

04/100

002/10

0001

S

,

1331

0363

0033

0001

M TPPPPP 3210 ,,,

,,,,1 32 TtttT

(*)

Page 15: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

15

Proof:

CS Dept, UK

On the other hand, as a Bezier curve of degree 3, C1(t) can

Also be expressed as

TMQtC )(1

where 3210 ,,, QQQQQ is the control polygon of )(1 tC

(**)

From (*) and (**), we have

SMPMQ or

SMPMQ 1

Page 16: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

16

Proof:

CS Dept, UK

It is easy to see that

1111

03/13/21

003/11

0001

1M

Hence, we have

O

N

M

P

PPPP

PPP

PP

P

Q

0

3210

210

10

0

88

3

8

3

8

424

2

Page 17: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

17

15.2 General Bezier Curve Segments

CS Dept, UK

Recursively subdivide the control polygons at

the midpoints,

we can divide the curve into many small segments,

each with its own control points.

These control points, when connected, form a

good linear approximation of the curve C(t ).

(This linear approximation is usually used to find

the intersection points of two Bezier curves)

Page 18: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

18

15.3 Cubic Uniform B-spline Curves

(a curve representation with local property)

CS Dept, UK

A Cubic Uniform B-Spline Curve segment

Page 19: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

19

15.3 Cubic Uniform B-spline Curves

CS Dept, UK

Matrix form:

Blending functions:

Page 20: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

20

15.3 Uniform Cubic B-spline Curves

CS Dept, UK

Properties of B-spline blending functions

Non-negative

Sum = 1

Hence, again, a B-spline curve segment is always contained

in the convex hull of its control points.

However, the curve does not interpolate the first and the last

control points . Actually

Page 21: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

21

15.3 Cubic Uniform B-spline Curves

CS Dept, UK

A Cubic Uniform B-Spline Curve:

Given a set of n control points, one can define a cubic

(uniform) B-spline curve with (n -3) segments.

The first segment, , is defined by the first four control

points:

The second segment, , is defined by the second four

control points:

The last one, , by

)(1 tC

3210 ,,, PPPP)(2 tC

4321 ,,, PPPP)(3 tCn nnnn PPPP ,,, 123

Page 22: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

22

15.3 Cubic Uniform B-spline Curves

CS Dept, UK

Properties/Advantages of a B-spline curve:

Local property (changing one control point will affect at

most four segments)

C2 continuity at the joints

Compact form for multiple segments

Can use multiple control points to achieve exact point

interpolation

Page 23: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

23

15.4 Composite Bezier Curves

CS Dept, UK

Bezier curve segments can be joined together to form

complicated shapes

P0, P1, P2, and P3 are control points of the 1st segment

P3, P4, P5, and P6 are control points of the 2nd segment

P2, P3, and P4 are collinear (to guarantee smooth joint)

Page 24: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

24

15.4 Composite Bezier Curves

CS Dept, UK

Smoothness (continuity) at Join Points:

: the endpoints coincide

: tangents have the same slope

: first derivatives on both segments match at join point

: 2nd derivatives on both segments match at join point

0C

1C

1G

2C

Page 25: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

25

15.4 Composite Bezier Curves

CS Dept, UK

G1-continuity:

P2, P3, and P4

are collinear

C1-continuity:

P2, P3, and P4

are collinear and

P3 is the midpoint

of P2P4

Page 26: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

26

15.4 Composite Bezier Curves

CS Dept, UK

C2-continuity:

* P2, P3, and P4 are collinear

* P3 is the midpoint of P2P4

* P5 = P1 + 4(P3 - P2)

Page 27: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

27

15.5 Curve Interpolation using Composite

Bezier Curves

CS Dept, UK

Give a set of data points D0, D1, ..., Dn ( n >= 2 ), how

can a composite cubic Bezier curve that interpolates these

points be constructed?

The composite cubic Bezier curve has n segments C1(t ),

C2(t ), ..., Cn (t ) with Di-1 and Di being the start and

end points of Ci (t )

The composite cubic Bezier curve is C2-continuous

Page 28: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

28

15.5 Curve Interpolation using Composite

Bezier Curves

CS Dept, UK

An analysis of the problem:

To construct the curve, how many control points are needed?

How many of them are known to us now?

So, how many of them remain to be computed?

And how should they be computed?

(How should the C1- and C2-continuity conditions be

used?)

2n

Page 29: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

29

15.5 Curve Interpolation using Composite

Bezier Curves

CS Dept, UK Pi+1,2

Page 30: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

30

15.5 Curve Interpolation using Composite

Bezier Curves

CS Dept, UK

i= 1, 2, …, n-1 (3.1)

Page 31: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

31

15.5 Curve Interpolation using Composite

Bezier Curves

CS Dept, UK

If we use the 2nd approach for the extra conditions,

(3.2), together with (3.1),

we get a system of 2n equations in 2n unknowns, as

follows:

(3.2)

Page 32: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

32

15.5 Curve Interpolation using Composite

Bezier Curves

CS Dept, UK

This system of equations can be solved using Gaussian elimination

without pivoting.

Page 33: 15 Curves and Surfaces - Computer Sciencecs.uky.edu/~cheng/cs535/Notes/CS535-Curves-1.pdf · 15 Curves and Surfaces Types of Curves: •Explicit •Implicit •Parametric •Generative:

33

End of 15.5

CS Dept, UK