representing curves - brandeiscs155/lecture_10.pdf · 2003-10-08 · hermite curves properties: •...

28
Representing Curves Foley & Van Dam, Chapter 11

Upload: others

Post on 14-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Representing CurvesFoley & Van Dam, Chapter 11

Page 2: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Representing Curves

• Motivations• Techniques for Object Representation• Curves Representation• Free Form Representation• Approximation and Interpolation• Parametric Polynomials• Parametric and Geometric Continuity • Polynomial Splines

• Hermite Interpolation

Page 3: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

3D Objects Representation• Solid Modeling attempts to develop methods and algorithms to model and represent real objects by computers

Page 4: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Objects Representation• Three types of objects in 3D:

• 1D curves• 2D surfaces• 3D objects

• We need to represent objects when:• Modeling of existing objects (3D scan)

- modeling is not precise• Modeling a new object “from scratch” (CAD)

- modeling is precise- interactive sculpting capabilities

Page 5: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

General Techniques

• Primitive Based:A composition of “simple” components

• Not precise• Efficient and simple

• Free Form:Global representation, curved manifolds

• Precise• Complicated

• Statistical:Modeling of objects generated by statisticalphenomena, such as fog, trees, rocks

Page 6: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Curves Representation

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

10

5

10

15

20

Page 7: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Primitive Based Representation

• Line segments: A curve is approximated by a collection of connected line segments

Page 8: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Free Form Representations• Explicit form: z = f(x, y)

• f(x,y) must be a function• Not a rotation invariant representation• Difficult to represent vertical tangents

• Implicit form: f(x, y, z) = 0• Difficult to connect two curves in a smooth manner• Not efficient for drawing• Useful for testing object inside/outside

• Parametric: x(t), y(t), z(t)• A mapping from [0,1] →R3

• Very common in modeling

Page 9: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Free Form Representations

Example: A Circle of radius R

• Implicit: x2 + y2 + z2 - R2 = 0 & z = 0

• Parametric: x(θ) = R cos(θ)y(θ) = R sin(θ)z(θ) = 0 θ

x

y

z

Page 10: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Approximated vs. Interpolated Curves

• Given a set of control points Pi known to be on the curve, find a parametric curve that interpolates/approximates the points

P0

P1

P2

P3

P4

P0

P1

P2

P3

P4

Interpolating Curve

Approximating Curve

Page 11: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Parametric Polynomials• For interpolating n points we need a polynomial of degree n-1

• Example: Linear polynomial. For interpolating 2 points we need a polynomial of degree 1

+++=

+++=

+++=

2

2

2

)(

)(

)(

ucubauz

ucubauy

ucubaux

zzz

yyy

xxx

p0

p1

p2

p3

p4

ubauzubauyubaux

zz

yy

xx

+=

+=+=

)()()(

p0

p1

Page 12: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Example: Linear Polynomial• The geometrical constraints for x(u) are:

• Solving the coefficients for x(u) we get:

• Solving for [x(u) y(u) z(u)] we get:

xxx

xx PbaxPax 10 )1(;)0( =+===

xxx

xx PPbPa 010 ; −==

0 1 0( ) ( )x x xx u P P P u⇒ = + −

0 1 0

( )( ) ( ) ( )

( )

x uV u y u P P P u

z u

= = + −

p0

p1

u=0u=1

Page 13: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Example: Linear Polynomial

p0

p1

p2

p3

p4V1(u) V2(u) V3(u)

V4(u)

1 0 1 0

( )( ) ( ) ( )

( )

x uV u y u P P P u

z u

= = + −

p0

p1u=0 u=1

( )( )( )

( ) ( )ii

x uV u y u V u

z u

= =

( ) ( ) 1[ , ]0

i i ii

V u if u u uwhere V u

otherw ise+ ∈

=

Page 14: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Parametric Polynomials• Polynomial interpolation has several disadvantages:

• Polynomial coefficients are geometrically meaningless• Polynomials of high degree introduce unwanted wiggles• Polynomials of low degree give little flexibility

• Solution: Polynomial Splines

p0

p1

p2

p3

p4

Page 15: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Polynomial Splines• Piecewise, low degree, polynomial curves, with continuous joints

• Advantages:• Rich representation• Geometrically meaning coefficients• Local effects• Interactive sculpting capabilities

( )( )( )

( ) ( )ii

x uC u y u C u

z u

= =

( ) ( ) 1[ , ]0

i i ii

C u if u u uwhere C u

otherw ise+ ∈

=

p0

p1

p2

p3

p4c1(u)

c2(u) c3(u) c4(u)

Page 16: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Tangent Vector• Let V(u)=[x(u), y(u), z(u)], u→[0,1] be a continuous univariate parametric curve in R3

• The tangent vector at u0, T(u0), is:

• V(u) may be thought of as the trajectory of a point in time• In this case, T(u0) is the instantaneous velocity vector at time u0

00 uuuu00 du

dzdudy

dudx

du)u(dV)u(V)u(T

==

==′=

T(u0)

u0u=0

u=1

Page 17: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Parametric Continuity• Let V1(u) and V2(u) , u→[0,1], be two parametric curves•Level of parametric continuity of the curves at the joint between V1(1) and V2(0):

• C-1: The joint is discontinuous, V1(1)≠V2(0)• C0: Positional continuos, V1(1)=V2(0)• C1: Tangent continuos, C0 & V’1(1)=V’2(0)• Ck, k>0: Continuous up to the k-th derivative,

V1(j) (1)=V2

(j) (0), 0 ≤ j ≤ k

C-1 C0C1

V1(1)

V2(0)

Page 18: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Geometric Continuity• In computer aided geometry design, we also consider the notion of geometric continuity:

• G-1, G0: Same as C-1 and C0

• G1: Same tangent direction: V’1(1)=αV’2(0)• Gk: All derivatives up to the k-th order are proportional

• Given a set of points {pi}:• A piecewise constant interpolant is C-1

• A piecewise linear interpolant is C0

Page 19: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Parametric and Geometric Continuity

• Q1-Q2 both C1 and G1

• Q1-Q3 is G1 but not C1

• S-C0 is C0

• S-C1 is C1

• S-C2 is C2

• In general, Ci implies Gi

(not vice versa)• Exception when the tangents are zero

Page 20: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Parametric Cubic Curves• Cubic polynomials defining a curve in R3 have the form:

Where u is in [0,1]. Defining:

The curve can be rewritten as:

zzzz

yyyy

xxxx

ducubuauz

ducubuauy

ducubuaux

+++=

+++=

+++=

23

23

23

)(

)(

)(

[ ]

==

zyx

zyx

zyx

zyx

T

dddcccbbbaaa

QuuuuU and1)( 23

[ ]( ) ( ) ( ) ( ) ( ) T Tx u y u z u V u U u Q= =

Page 21: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Parametric Cubic Curves

• The coefficients Q are unknown and should be determined

• For this purpose we have to supply 4 geometrical constraints

• Different types of constraints define different types of Splines

Page 22: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Hermite Curves• Assume we have n control points {pk} with their tangents {Tk}• W.L.O.G. V(u) represents a parametric cubic function for the section between pk and pk+1• For V(u) we have the following geometric constraints:

V(0)=pk; V(1)=pk+1V'(0)=Tk; V'(1)=Tk+1

pk

Pk+1

V(u)V(0)

V(1)Tk

Tk+1

Page 23: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Hermite CurvesSince

we have that

We can write the constraints in a matrix form:

And thus

Where

3 2

2

( ) 1

( ) ( ) 3 2 1 0

T

T

V u u u u Q

V u u u Q

=

′ =

Q

TTpp

MQG

k

k

k

k

=

⇒=

+

+

0123010011111000

1

1

G MGMuUQuUuV TTT 1)()()( −==

−−−

=−

00010100

12331122

1M

Page 24: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Hermite Curves13 2

1

2 2 1 13 3 2 1

( ) [ 1 ]0 0 1 01 0 0 0

k

k

k

k

pp

V u u u uTT

+

+

− − − − =

Geometrymatrix

=

=

−+−

+−+−

=

+

+

+

+

1

1

3

2

1

0

1

1

23

23

23

23

)()()()(

232

132

)(

k

k

k

k

k

k

k

k

TTppT

uHuHuHuH

TTppT

uuuuu

uuuu

uV

Blending functions

Page 25: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Hermite Curves

0 0 .1 0 .2 0 .3 0 .4 0 .5 0 .6 0 .7 0 .8 0 .9 1-0 .2

0

0 .2

0 .4

0 .6

0 .8

1

1 .2

H0=H(0)H1=H(1)

H2=H’(0)

H3=H’(1)

Hermite Blending Functions

Page 26: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Hermite Curves

Change in Magnitude of T0

Change in Direction of T0

P0 P1

x(u)

y(u)

T0

T1

x(u)

y(u)

Page 27: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Hermite CurvesProperties:

• The Hermite curve is composed of a linear combinations of tangents and locations (for each u)

• Alternatively, the curve is a linear combination of Hermitebasis functions (the matrix M)

• It can be used to create geometrically intuitive curves

• The piecewise interpolation scheme is C1 continuous

• The blending functions have local support; changing a control point or a tangent vector, changes its local neighborhood while leaving the rest unchanged

Page 28: Representing Curves - Brandeiscs155/Lecture_10.pdf · 2003-10-08 · Hermite Curves Properties: • The Hermite curve is composed of a linear combinations of tangents and locations

Hermite Curves

• Main Drawback:

Requires the specification of the tangents This information is not always available