+ All Categories
Home > Documents > Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · •...

Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · •...

Date post: 03-Jul-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
101
Curves and Surfaces Shireen Elhabian and Aly A. Farag University of Louisville February 2010
Transcript
Page 1: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Curves and Surfaces

Shireen Elhabian and Aly A. FaragUniversity of Louisville

February 2010

Page 2: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

“A smile is a curve that sets everything straight…”

Phyllis Diller(American comedienne and actress, born 1917)

Page 3: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Outline• Introduction

• Affine transformations

• Curves

– What is a curve?

– Affine invariance

– Convex Hull

– Lagrange Interpolation

– Bezier Curves

• Surfaces

Page 4: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Introduction

We will discuss some of the existing curves associated with theirinterpolation techniques. We will start with few of the importantproperties which we desire for curves e.g. continuity and affineinvariance. We will introduce transformations for manipulatingcurves and then proceed to discuss some of the most popularcurves used in computer graphics. But let’s first introduce thenotion of parametric curves which will be later extended todefine parametric surfaces.

Page 5: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Points in space

Page 6: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

• A point, which can be defined as follows:

Page 7: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Line Segment

Page 8: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

• A line segment can be defined by its ending points.

• Many ways to define the equation of a line.

• Think about it as a road, we will end up with the parametricform of the line.

x0

x1

t = 0

t = 1

x(t)=(1-t) x0+t x1

Page 9: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 10: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Affine Transformations

Page 11: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

What is a transform?

Recall …

Page 12: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 13: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Scaling

Page 14: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Scaling in 2D

• Scaling a coordinate means multiplying each ofits components by a scalar

• Uniform scaling means this scalar is the samefor all components:

´ 2

Page 15: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Scaling in 2D

• Non-uniform scaling: different scalars percomponent:

• How can we represent this in matrix form?

X ´ 2,Y ´ 0.5

Page 16: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Scaling in 2D

• Scaling operation:

• Or, in matrix form:

úû

ùêë

é=ú

û

ùêë

ébyax

yx''

úû

ùêë

éúû

ùêë

é=ú

û

ùêë

éyx

ba

yx

00

''

scaling matrix

Page 17: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Scaling in 3D

úúúú

û

ù

êêêê

ë

é

×

úúúú

û

ù

êêêê

ë

é

=

úúúú

û

ù

êêêê

ë

é

11000000000000

1'''

zyx

ss

s

zyx

z

y

x

z x

y

Page 18: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Translation

Page 19: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Translation in 2D

y

x

tyytxx+=+=

''

tx = 2ty = 1

Page 20: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Translation in 3D

úúúú

û

ù

êêêê

ë

é

×

úúúú

û

ù

êêêê

ë

é

=

úúúú

û

ù

êêêê

ë

é

11000100010001

1'''

zyx

ttt

zyx

z

y

x

(x’,y’,z’)

(x,y,z) T=(tx,ty,tz)

z

x

y

Page 21: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Rotation

Page 22: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Rotation in 2D

q

(x, y)

(x’, y’)x’ = x cos(q) - y sin(q)y’ = x sin(q) + y cos(q)

úû

ùêë

éúû

ùêë

é -=ú

û

ùêë

éyx

yx

qqqq

cossinsincos

''

Or, in matrix form

Page 23: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Rotation in 3D• How should we specify rotations?

• In 2D, it was always counterclockwise in the xy-plane.

• In 3D, we have more choices

– xz-plane, yz-plane, an arbitrary plane.

• We could specify these in terms of the vectorperpendicular to the plane of rotation.

– z axis, y-axis, x-axis, arbitrary axis

Page 24: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Rotation in 3D – Euler Angles

úúúú

û

ù

êêêê

ë

é

×

úúúú

û

ù

êêêê

ë

é -

=

úúúú

û

ù

êêêê

ë

é

11000010000cossin00sincos

1'''

zyx

zyx

gggg

úúúú

û

ù

êêêê

ë

é

×

úúúú

û

ù

êêêê

ë

é

-=

úúúú

û

ù

êêêê

ë

é

110000cos0sin00100sin0cos

1'''

zyx

zyx

bb

bb

úúúú

û

ù

êêêê

ë

é

×

úúúú

û

ù

êêêê

ë

é-

=

úúúú

û

ù

êêêê

ë

é

110000cossin00sincos00001

1'''

zyx

zyx

aaaa

z x

y

z x

y

z x

y

Page 25: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Curves

Page 26: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

What are they?

Page 27: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Example – Space Curves

The intersection is acircle (space curve)

x

y

z

1

y -½ =0x2 + y2 + z2 = 1

Page 28: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Parametric Curves

Page 29: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Parametric Curves• Some restrictions should be placed on the continuous functions defining the

curve in order not to fill the space, however there are still some parametriccurves that are space filling, e.g. the Peano curve.

In 1880 the Italian logician Giuseppe Peano (1858-1932) constructed the Peano curve, abase motif fractal which uses a line segment as base. The motif is dividing the linesegment in three parts, and making a square up and down the middle part. This leads to afilled square, so the curve is a space-filling curve.

Peano curve - 2Peano curve - 1Peano curve - 0

Page 30: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Affine Invariance

Proof left as homework L

Page 31: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Convex Hull

Page 32: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

• Another useful property is that if a curve lies within its convex hull which canbe defined as follows:

x yx

y

Non-convex setConvex set

Page 33: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Given a set of pins on a pin board and a rubber band around them. How does the rubber band look when it snaps tight? We represent the convex hull as the sequence of points on the convex hull polygon, in counter-clockwise order.

Page 34: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Interpolation

Page 35: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

• In numerical analysis, interpolation is a method of constructing new pointswithin the range of a discrete set of known points.

• From the engineering point of view, we often has a number of points,obtained by sampling or experimentation, and we wish to construct afunction which closely fits these points, this is called curve fitting whereinterpolation is a special case, in which the function must go exactly throughthe known points.

• Another way to define interpolation is from its linguistic meaning, inter meansbetween and pole means points or nodes, hence any method of calculating anew point between two or more known points is called interpolation.

Page 36: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

n-degree Interpolation

Page 37: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Lagrange Interpolation

Joseph-Louis Lagrange, Italian-born mathematician and astronomer, who lived most of his life in Prussia and France, making significant contributions to all fields of analysis, to number theory, and to classical and celestial mechanics.

Page 38: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Example: Uniform Lagrange Interpolation

Page 39: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 40: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

0 0.5 1 1.5 2 2.5 3-0.5

0

0.5

1

1.5

t

L3 k

L30 L31 L32 L33

Basis functions for uniform Lagrange interpolation of degree 3.

Page 41: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 42: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Uniform Lagrange interpolation of four points, control points are shown in read, the convexhull of the control points is shown in dashed-red line while the convex hull of the generatedcurve (shown in dashed-blue) is much larger than the convex hull of the control points, henceLagrange curve does not satisfy the convex hull property.

0 1 2 3 4 5-2

-1

0

1

2

3

4

x

y

x0

x1

x2

x3

Convex hull of the control points

Convex hull of the curve

t = t0 = 0

, t = t1 = 1

t = t2 = 2

t = t3 = 3

Page 43: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

In Matlab…

Page 44: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Next …

• However Lagrange interpolation does not satisfy the convex hullproperty.

• Typically, we would like the curve to be more confined, i.e. thearea of the convex hull of the curve should not be much greaterthan the area of the convex hull of the control points.

• Next we will discuss some of the more popular curves and howthey may be used to interpolate points.

Page 45: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Bézier CurvesBézier curves are one of the most popular representations for curves.

Pierre Étienne Bézier (September 1, 1910 – November 25, 1999) was a French engineer and patentor (but not the inventor) of the Bézier curves and Bézier surfaces that are now used in most computer-aided design and computer graphics systems.

Page 46: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 47: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

The t in the function for a linear Bézier curve can be thought of as describing how far x(t) isfrom P0 to P1. For example when t=0.25, x(t) is one quarter of the way from point P0 to P1. As tvaries from 0 to 1, x(t) describes a curved line from P0 to P1.

Page 48: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

For quadratic Bézier curves one can construct intermediate points Q0 and Q1 such that as t varies from 0 to 1:Point Q0 varies from P0 to P1 and describes a linear Bézier curve. Point Q1 varies from P1 to P2 and describes alinear Bézier curve. Point x(t) varies from Q0 to Q1 and describes a quadratic Bézier curve.

Page 49: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

For higher-order curves one needs correspondingly more intermediate points. For cubic curves onecan construct intermediate points Q0, Q1 & Q2 that describe linear Bézier curves, and points R0 &R1 that describe quadratic Bézier curves. For fourth-order curves one can construct intermediatepoints Q0, Q1, Q2 & Q3 that describe linear Bézier curves, points R0, R1 & R2 that describequadratic Bézier curves, and points S0 & S1 that describe cubic Bézier curves.

Page 50: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 51: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Bernstein Polynomials Properties

Proof left as homework L

Page 52: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Example• The most popular Bézier curves are Bézier curves of degree 3. Let the

control points be given as follows:

Page 53: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

0 0.2 0.4 0.6 0.8 10

0.2

0.4

0.6

0.8

1

t

B3 k

B30 B31 B32 B33

Basis functions for Bézier curves of degree 3.

Page 54: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

• The curve will be defined by;

0 1 2 3 4 5-2

-1

0

1

2

3

4

x

y

Convex hull of the curve

x0

x1

x2

x3

Convex hull of the control points

Bézier curve of four points and its convex hull , control points are shown in read, the convex hull of the control points is shown in dashed-red line while the convex hull of the generated curve (shown in dashed-blue) is inside the convex hull of the control points, hence Bézier curve satisfy the convex hull property.

Page 55: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

In Matlab…

Page 56: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Derivatives of Bézier Curves

Homework L

Differentiate Bézier curve and prove Theorem 4

Thus we have immediate form of the derivative at the end points.These are the tangents to the curve at the end points. This will beuseful in defining curves that are piecewise continuous.

Page 57: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Piecewise Continuous BézierCurves

Page 58: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

• We can construct Bézier curves of arbitrary degree, however it becomes moredifficult to control the curves since the Bézier curve is only guaranteed tointerpolate end points. Instead we can create several Bézier segments that arepiecewise continuous.

• There are different kinds of continuity which can be considered.

Page 59: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 60: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 61: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Recall…

Page 62: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Example

Page 63: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 64: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 65: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

0 0.2 0.4 0.6 0.8 1-15

-10

-5

0

5

10

t

B3 k,1

B30,1 B31,1 B32,1 B33,1

Page 66: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 67: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

0 0.2 0.4 0.6 0.8 1-15

-10

-5

0

5

10

t

B3 k,2

B30,2 B31,2 B32,2 B33,2

Page 68: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

-0.5 0 0.5 1 1.5 2 2.5-1

-0.5

0

0.5

1

1.5

x

y

Piecewise Bézier curve with two pieces, control points are shown in red, the generate curve isshown in blue

Page 69: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

In Matlab…

Page 70: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

In Matlab…

Page 71: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Bézier Curves Rendering

Page 72: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

de Casteljau's Method

Page 73: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 74: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

00x

01x

02x

03x

04x

05x

2.0=t10x

11x

12x

13x

14x2

1x

22x

23x

20x

31x

32x

30x

40x

41x

)(50 txx =

Page 75: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Recursive Subdivision

Although de Casteljau's method can be numerically stable, we still do notknow how many points the Bézier curve needs to be evaluated to obtainacceptable results. Next we will discuss how Bézier curves can besubdivided until a desired level of accuracy is obtained.

Page 76: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 77: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 78: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

00x

01x

02x

03x

04x

05x

2.00 =t

10x

11x

12x

13x

14x2

1x

22x

23x

20x

31x

32x

30x

40x

41x

)(50 txx =

)(1 txControl points of

)(2 txControl points of

Page 79: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Rational Bézier Curves

Page 80: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 81: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

1)1,0(

0

0

==

wx

31)1,2(

1

1

=

=

w

x

31

)1,2(

2

2

=

-=

w

x

1)1,0(

3

3

=-=

wx

Section of a circle, drawn with a rational Bézier curve

Page 82: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Surfaces

Page 83: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 84: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Tensor Product Surfaces

Page 85: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Tensor Product Bézier Surfaces

Page 86: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

• Using the normals, we can definepiece-wise continuous Bézier surfaces,where de Casteljau’s algorithm can beapplied to efficiently render thesesurfaces. (refer to the reading material)

Piecewise Continuous Bézier Surfaces

Page 87: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Triangular Bézier Surfaces

Instead of arranging the initial configuration of the controlpoints in a rectangular fashion as with tensor product Béziersurfaces, we can arrange the control points in a triangle (seethe following figure). If the degree of the Bézier surface is n,then there are n+1 control points on each side.

Page 88: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

003x

300x

030x012x 021x

120x

210x

102x

201x

111x

Page 89: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

The Bézier triangles are affine invariant, the surface interpolates the three corner control pointsand the surface lies within the convex hull of the control points.

Page 90: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Rational Bézier Surfaces

Page 91: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Subdivision SurfacesWe saw before how to subdivide a Bézier curve using de Casteljau’s method.With sufficient subdivision, the Bézier curve segments can be approximatedby lines.

If we proceed to subdivide an infinite number of times, the limit curve is theBézier curve.

However, this is not the only way to subdivide a curve, we can recursivelyintroduce new control points as a function of the given control points toproduce smoother curves, different subdivision methods apply differentsubdivision rules, i.e. how to obtain new points in terms of the points at thecurrent iteration.

In the same way that curves can be recursively subdivided, we can subdivide asurface control mesh. The tensor product Bézier surface can be modeled inthis manner, but subdivision is not limited to rectangular meshes, triangularones can also be subdivided.

Page 92: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 93: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Loop Subdivision

Loop’s subdivision scheme works on triangular meshes. The surface is anapproximating surface, that is it doesn’t interpolate (passes through) its controlpoints. A new vertex is added for each edge, at each subdivision step.

Page 94: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 95: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

kx

kny

k2y

k1y

k3y

ki 1+y

Current vertex/point

kiy

i-th neighbor Neighborhood/valence of the current point

Page 96: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

kx

kny

k2y

k1y

k3y

ki 1+y

Current vertex/point

kiy

i-th neighbor A new vertex introduced at the edge connecting to the i-thneighbor

1+kix

New vertex introduced on the edges connecting neighboring vertices

Page 97: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3
Page 98: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

kx

kny

k2y

k1y

k3y

ki 1+y

Current vertex/point

kiy

i-th

b b

b

b

bb

bn-1

Vertex Mask

Page 99: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

kx

kny

k2y

k1y

ki 1-y

ki 1+y

3/8

1/8

1/8

Current vertex/point

kiy

3/8

i-th neighbor A new vertex introduced at the edge connecting to the i-th neighbor

1+kix

Edge Mask

Page 100: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Edge mask

½½ 1/8 6/8 1/8

Vertex mask

Page 101: Curves and Surfacesshireen/pdfs/tutorials/Elhabian_curves... · 2020-02-05 · • Thecurvewillbedefinedby; 0 1 2 3 4 5-2-1 0 1 2 3 4 x y Convex hull of the curve x 0 x 1 x 2 x 3

Thank You!!!


Recommended