1 lecture 13 modeling curved lines and surfaces. 2 types of surfaces ruled surfaces b-splines and...

32
1 Lecture 13 Modeling Curved Lines and Surfaces

Post on 23-Jan-2016

231 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

1

Lecture 13

Modeling Curved Lines and Surfaces

Page 2: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

2

Types of Surfaces

Ruled Surfaces

B-Splines and Bezier Curves

Surfaces of Revolution

Page 3: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

3

Ruled Surfaces

A ruled surface is defined by two “end curves” P0(u) and P1(u), that are connected by a straight line at each different value of u.

– Formula: P(u, v) = (1-v) P0(u) + vP1(u)

Page 4: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

4

Bezier Curves

A Bezier curve was originally developed in the 1960’s by French engineer, Pierre Bezier, who used them for the body design of the Renault car.

Bezier curves are used in computer graphics to produce curves which appear reasonably smooth at all scales.

Page 5: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

5

Bezier Curves

Bezier curves are constructed as a sequence of cubic segment in which the interpolating polynomials depend on certain control point.

This means to each set of four point (P0, P1, P2, P3) we associate a curve with three main properties.

Page 6: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

6

Bezier Curve

1. The curve starts at P0 and ends at P3. 2. When the curve starts from P0 is heads

directly towards P1, and when it arrives at P3 it is coming from direction P2.

3. The entire curve is contained in a quadrilateral whose corners are the four given points (their convex hull).

Page 7: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

7

Bezier Curves

Page 8: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

8

Bezier Curves

Page 9: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

9

Bezier Curves

If there is only one control point P0 then B(u) = P0 for all u.

If there are only two control points P0 and P1 then the formula reduces to a line segment between the two control points.

Page 10: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

10

Bezier Curves

Adding multiple control points at a single position in space will add more weight to that point “pulling” the curve towards it.

Bezier curves have wide applications because they are easy to compute and very stable. There are similar formulations, also called Bezier curves, which may behave differently.

Page 11: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

11

Bezier Curves

The degree of the curve is one less than the number of control points, so it is a quadratic for 3 control point.

Page 12: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

12

Bezier Curves

The curve always passes through the end points and is tangent to the line between the last two and first two control points.

Page 13: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

13

Bezier Curves

The curve always list with the convex hull of the control points.

Page 14: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

14

Bezier Curves

Closed curves are generated by specifying the first point the same as the last point. If the tangent at the first point and last point match the the curve is closed with first order continuity.

Page 15: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

15

Bezier Curves

Bezier curves are used almost exclusively for creating curvilinear shapes in all fields of design, from purely technical plans and blueprints to the most creative artistic genres.

Page 16: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

16

Bezier Splines

Linear Bezier spline is obtained by linear interpolation between two control points P0 and P1.

Quadratic Bezier spline is obtained by de Casteljau algorithm as a linear interpolation between control points P0, P1, and P2.

Page 17: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

17

Bezier Splines

Cubic Bezier spline can also be determined by deCasteljau algorithm to interpolate a curve between (n + 1) control points P0 to P(n).

Page 18: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

18

Bezier Splines

Linear Bezier spline P(t) = (1-t)P0 + tP1 ,    

0 <= t <= 1

Page 19: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

19

Bezier Splines

Quadratic Bezier spline.    

P01 = (1-t)P0 + tP1 ,    

P11 = (1-t)P1 + tP2

P(t) = (1-t)P01 + tP1

1 =

(1-t)[(1-t)P0 + tP1] +

t[(1-t)P1 + tP2] =

(1-t)2P0 + 2(1-t)tP1 + t2P2 ,

 or P(t) = i=0,2 Bi2(t) Pi ,

where Bin(t) are Bernstein polynomials

Page 20: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

20

Bezier Splines

Cubic Bezier spline.

Page 21: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

21

Bezier Splines

To plot a Bezier Spline use the

DeCasteljau iterations:

Pij = (1-t)Pi

j-1 + tPi+1j-1,     j = 1, n     i = 0, n-j

for n = 3

Page 22: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

22

Bezier Curves

Page 23: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

23

Surfaces Of Revolution

This is done with relation to a B-spline curve that represents a profile of the object you are modeling.

The surface is formed when a profile is swept about the z-axis. The resulting surface has the parametric form:– P(u, v) = (X (v) cos(u), X(v) sin(u), Z(v)).

Page 24: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

24

Modeling a Teapot

This model was done by Martin Newell.– He decided to break the teapot body down

into three parts, each a separate Bezier curve based on 10 points.

1st part is points 0,1,2,32nd part is 3, 3, 4, 5, 63rd part 6, 7, 8, 9.

– Last segment of each curve is collinear with the first segment of next curve to ensure the Bezier curves blend together.

Page 25: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

25

Body of a Teapoti X Z

0 1.4 2.25

1 1.33 2.38

2 1.43 2.38

3 1.5 2.25

4 1.75 1.725

5 2 1.2

6 2 .75

7 2 .3

8 1.5 .075

9 1.5 0

Page 26: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

26

Bezier Surface Patches

More complex, replace the u from the original Bezier equation with another Bezier equation, that has four specified control points which define the control polyhedron (which determines the shape of the patch).– This is a tensor product form surface.

Page 27: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

27

Bezier Patch

Page 28: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

28

Matching Bezier Patches

Since the “boundary” Bezier curve is determined by the boundary polygon of the control polyhedron, it can be simple to make two patches meet at points along a common boundary.– Each pair of polyhedron edges that meet at

the boundary must be collinear.

Page 29: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

29

Modeling the rest of the Pot

Both the handle and the spout are composed of four Bezier patches.– Handles surface is symmetrical about the

xz-plane.The handle is then designed like another

object, with an upper positive y section being composed of 16 control points, and a lower positive y section also with 16 control points.

Page 30: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

30

Other Modeling types

B-spline Patches– Alternate technique to be used in the

tensor form surfaces NURBS surfaces

– Nonuniform rational B-splines

Page 31: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

31

NURBS

– A rational spline curve is similar to the normal B-spline counterpart, but adds a slightly different set of blending functions, weights, to add shape and control.

Advantage to NURBS is that with properly chosen points and weights you can get a exact conic section. (non-rational can only approximate)

Page 32: 1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution

32

NURBS

NURBS are invariant among more classes of transformations unlike normal B-spline curves.– This means you can draw a perspective

projection of the NURB curve much easier and more efficiently.