1 representing curves and surfaces. 2 introduction we need smooth curves and surfaces in many...

21
1 Representing Curves and Surfaces

Post on 22-Dec-2015

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

1

Representing Curves and Surfaces

Page 2: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

2

Introduction

• We need smooth curves and surfaces in many applications:– model real world objects– computer-aided design (CAD)– high quality fonts– data plots– artists sketches

Page 3: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

3

Introduction

• Most common representation for surfaces:– polygon mesh– parametric surfaces– quadric surfaces

• Solid modeling– don’t miss the next episode...

Page 4: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

4

Introduction

• Polygon mesh:– set of connected planar surfaces bounded by

polygons– good for boxes, cabinets, building exteriors– bad for curved surfaces– errors can be made arbitrarily small at the cost

of space and execution time– enlarged images show geometric aliasing

Page 5: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

5

Introduction

• Parametric polynomial curves:– point on 3D curve = (x(t), y(t), z(t))– x(t), y(t), and z(t) are polynomials– usually cubic: cubic curves

Page 6: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

6

Introduction

• Parametric bivariate (two-variable) polynomial surface patches:– point on 3D surface = (x(u,v), y(u,v), z(u,v))

– boundaries of the patches are parametric polynomial curves

– many fewer parametric patches than polynomial patches are needed to approximate a curved surface to a given accuracy

– more complex algorithms though

Page 7: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

7

Parametric cubic curves

• Polylines and polygons:– large amounts of data to achieve good accuracy– interactive manipulation of the data is tedious

• Higher-order curves:– more compact (use less storage)– easier to manipulate interactively

• Possible representations of curves:– explicit, implicit, and parametric

Page 8: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

8

Parametric cubic curves

• Explicit functions:– y = f(x), z = g(x)– impossible to get multiple values for a single x

• break curves like circles and ellipses into segments

– not invariant with rotation• rotation might require further segment breaking

– problem with curves with vertical tangents• infinite slope is difficult to represent

Page 9: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

9

Parametric cubic curves

• Implicit equations:– f(x,y,z) = 0– equation may have more solutions than we

want• circle: x² + y² = 1, half circle: ?

– problem to join curve segments together• difficult to determine if their tangent directions

agree at their joint point

Page 10: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

10

Parametric cubic curves

• Parametric representation:– x = x(t), y = y(t), z = z(t)– overcomes problems with explicit and implicit

forms– no geometric slopes (which may be infinite)– parametric tangent vectors instead (never infinite)– a curve is approximated by a piecewise

polynomial curve

Page 11: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

11

Parametric cubic curves

• Why cubic?– lower-degree polynomials give too little

flexibility in controlling the shape of the curve– higher-degree polynomials can introduce

unwanted wiggles and require more computation– lowest degree that allows specification of

endpoints and their derivatives– lowest degree that is not planar in 3D

Page 12: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

12

Parametric cubic curves

• Kinds of continuity:– G0: two curve segments join together– G1: directions of tangents are equal at the joint– C1: directions and magnitudes of tangents are

equal at the joint– Cn: directions and magnitudes of n-th

derivative are equal at the joint

Page 13: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

13

Parametric cubic curves

• Major types of curves:– Hermit

• defined by two endpoints and two tangent vectors

– Bezier• defined by two endpoints and two other points that

control the endpoint tangent vectors

– Splines• several kinds, each defined by four points

• uniform B-splines, non-uniform B-splines, ß-splines

Page 14: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

14

Parametric cubic curves

• General form:

GMTCTtztytxtQ

tttT

ddd

ccc

bbb

aaa

C

dtctbtatz

dtctbtaty

dtctbtatx

zyx

zyx

zyx

zyx

zzzz

yyyy

xxxx

)]()()([)(

]1[

)(

)(

)(

23

23

23

23

Page 15: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

15

Parametric cubic curves

• It is not necessary to choose a single representation, since it is possible to convert between them.

• Interactive editors provide several choices, but internally they usually use NURBS, which is the most general.

Page 16: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

16

Parametric bicubic surfaces

• Generalization of parametric cubic curves.

• For each value of s there is a family of curves in t.

• Major kinds of surfaces:– Hermit, Bezier, B-spline

)()(),( tGMTtCTtsQ

Page 17: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

17

Parametric bicubic surfaces

• Displaying bicubic surfaces:– brute-force iterative evaluation is very

expensive (the surface is evaluated 20,000 times if step in parameters is 0.01)

– forward-difference methods are better, but still expensive

– fastest is adaptive subdivision, but it might create cracks

Page 18: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

18

Quadric surfaces

• Implicit form:

• Particularly useful for molecular modeling.

• Alternative to rational surfaces if only quadric surfaces are being represented.

0222222),,( 222 kjzhygxfxzeyzdxyczbyaxzyxf

Page 19: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

19

Quadric surfaces

• Reasons to use them:– easy to compute normal– easy to test point inclusion– easy to compute z given x and y– easy to compute intersections of one surface

with another

Page 20: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

20

Summary

• Polygon meshes– well suited for representing flat-faced objects– seldom satisfactory for curved-faced objects– space inefficient– simpler algorithms– hardware support

Page 21: 1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided

21

Summary

• Piecewise cubic curves and bicubic surfaces– permit multiple values for a single x or y– represent infinite slopes– easier to manipulate interactively– can either interpolate or approximate– space efficient– more complex algorithms– little hardware support