+ All Categories
Home > Documents > 5. Curves and Curve Modeling

5. Curves and Curve Modeling

Date post: 24-Feb-2016
Category:
Upload: diallo
View: 58 times
Download: 0 times
Share this document with a friend
Description:
ME 521 Computer Aided Design. 5. Curves and Curve Modeling. Dr. Ahmet Zafer Şenalp e-mail: [email protected] Makine Mühendisliği Bölümü Gebze Yüksek Teknoloji Enstitüsü. Purpose. 5. Curves and Curve Modeling. Curves are the basics for surfaces - PowerPoint PPT Presentation
Popular Tags:
86
5. Curves and Curve Modeling Assoc.Dr. Ahmet Zafer Şenalp e-mail: [email protected] Mechanical Engineering Department Gebze Technical University ME 521 Computer Aided Design
Transcript
Page 1: 5. Curves and Curve Modeling

5. Curves and Curve Modeling

Assoc.Dr. Ahmet Zafer Şenalpe-mail: [email protected]

Mechanical Engineering DepartmentGebze Technical University

ME 521Computer Aided Design

Page 2: 5. Curves and Curve Modeling

Curves are the basics for surfaces

Before learning surfaces curves have to be known

When asked to modify a particular entity on a CAD system, knowledge of the entities can increase your productivity

Understand how the math presentation of various curve entities relates to a user interface

Understand what is impossible and which way can be more efficient when creating or modifying an entity

Purpose

Dr. Ahmet Zafer Şenalp ME 521 2Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 3: 5. Curves and Curve Modeling

Purpose

Curves are the basics for surfaces

Dr. Ahmet Zafer Şenalp ME 521 3Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 4: 5. Curves and Curve Modeling

Why Not Simply Use a Point Matrix toRepresent a Curve?

Storage issue and limited resolution Computation and transformation Difficulties in calculating the intersections or curves and physical properties of

objects Difficulties in design (e.g. control shapes of an existing object) Poor surface finish of manufactured parts

Dr. Ahmet Zafer Şenalp ME 521 4Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 5: 5. Curves and Curve Modeling

Advantages of AnalyticalRepresentation for Geometric Entities

A few parameters to store Designers know the effect of data points on curve behavior, control, continuity, and

curvature Facilitate calculations of intersections, object properties, etc.

Dr. Ahmet Zafer Şenalp ME 521 5Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 6: 5. Curves and Curve Modeling

Curve Definitions

Explicit form :

Implicit form :

cmxy

0 cbyax

Dr. Ahmet Zafer Şenalp ME 521 6Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 7: 5. Curves and Curve Modeling

Drawbacks of Conventional Representations

Conventional explicit and implicit forms have several drawbacks.

They represent unbounded geometry They may be multi-valued Difficult to evaluate points along the curve Depends on coordinate system

Dr. Ahmet Zafer Şenalp ME 521 7Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 8: 5. Curves and Curve Modeling

Parametric Representation

Curves are defined as a function of a single parameter:

)u(zz),u(yy),u(xxand

P(u)P

Dr. Ahmet Zafer Şenalp ME 521 8Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 9: 5. Curves and Curve Modeling

u

u

v

Curve, P=P(u)Surface, P=P(u,v)

P(u)=[x(u),y(u),z(u)]T

P(u, v)=[x(u, v), y(u, v), z(u, v)]T

Parametric Representation

Dr. Ahmet Zafer Şenalp ME 521 9Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 10: 5. Curves and Curve Modeling

Parametric Representation

Changing curve equation into parametric form:

2xy Let’s use “t” parameter ;

2

2

)(

)()(

ttyy

ttxxtPP

ty

tx

Dr. Ahmet Zafer Şenalp ME 521 10Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 11: 5. Curves and Curve Modeling

Parametric Explicit Form-Implicit Form ConversionExample : Planar 2. degree curve:

How to obtain implicit form?

t is extracted as:

Replacing t in y equation;

Rearranging the above equation;

Rearranging again;

We obtain implicit form.

22y

12

2

tt

tx

1 xt

212 1 2 xxy

22 122)1( xxy

05622 22 yxyxyx

Dr. Ahmet Zafer Şenalp ME 521 11Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 12: 5. Curves and Curve Modeling

Parametric Explicit Form-Implicit Form ConversionExample : Planar 2. degree curve :

22y

12

2

tt

tx

-1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.50

2

4

6

8

10

12Y

X

2,2t plot

Dr. Ahmet Zafer Şenalp ME 521 12Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 13: 5. Curves and Curve Modeling

Curve Classification

Curve Classification:

Analytic Curves

Synthetic curves

Dr. Ahmet Zafer Şenalp ME 521 13Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 14: 5. Curves and Curve Modeling

Analytic Curves

These curves have an analytic equation

point line arc circle fillet Chamfer Conics (ellipse, parabola,and hyperbola))

Dr. Ahmet Zafer Şenalp ME 521 14Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 15: 5. Curves and Curve Modeling

line arc

circle

Forming Geometry withAnalytic Curves

Dr. Ahmet Zafer Şenalp ME 521 15Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 16: 5. Curves and Curve Modeling

Analytic CurvesLine

Line definition in cartesian coordinate system:

Here;m: slope of the line b: point that intersects y axisx: independent varaible of y function.

Parametric form;

Dr. Ahmet Zafer Şenalp ME 521 16Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 17: 5. Curves and Curve Modeling

Analytic CurvesLineExample:implicit-explicit form change

Line equation:

Parametric line equation is obtained. To turn back to implicit or explicit nonparametric form t is replaced in x and y equalities

12 xy

012 yx implicit form

explicit form

12)1(1

tytytx

Changing to parametric form. In this case )();( tyytxx

Let . Replacing this value into y equation.

is obtained.

As a result;

121

tytx

1)1(21

xy

xt

From here the form at the beginning is obtained.Dr. Ahmet Zafer Şenalp ME 521 17Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 18: 5. Curves and Curve Modeling

Analytic Curves Circle

Circle definition in Cartesian coordinate system:

Here;a,b: x,y coordinates of center pointr: circle radius

Parametric form

Dr. Ahmet Zafer Şenalp ME 521 18Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 19: 5. Curves and Curve Modeling

Analytic Curves Ellipse

Ellipse definition in Cartesian coordinate system:

Here;h,k: x,y coordinates of center pointa: radius of major axisb: radius of minör exis

Parametric form

Dr. Ahmet Zafer Şenalp ME 521 19Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 20: 5. Curves and Curve Modeling

Analytic Curves Parabola

Parabola definition in Cartesian coordinate system:

Usual form;

y = ax2 + bx + c

-5 -4 -3 -2 -1 0 1 2 3 4 50

2

4

6

8

10

12

14

16

18Y

X

Dr. Ahmet Zafer Şenalp ME 521 20Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 21: 5. Curves and Curve Modeling

Analytic Curves Hyperbola

Hyperbola definition in Cartesian coordinate system:

Dr. Ahmet Zafer Şenalp ME 521 21Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 22: 5. Curves and Curve Modeling

Synthetic Curves

As the name implies these are artificial curves Lagrange interpolation curves Hermite interpolation curves Bezier B-Spline NURBS etc.

Analytic curves are usually not sufficient to meet geometric design requirements of mechanical parts.

Many products need free-form, or synthetic curved surfaces These curves use a series of control points either interploated or aproximatedIt is the definition method for complex curves.It should be controllable by the designer.Calculation and storage should be easy.At the same time called as free form curves.

Dr. Ahmet Zafer Şenalp ME 521 22Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 23: 5. Curves and Curve Modeling

Synthetic Curves

open curve

closed curve

Dr. Ahmet Zafer Şenalp ME 521 23Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 24: 5. Curves and Curve Modeling

interpolated

approximated

control points

Synthetic Curves

Dr. Ahmet Zafer Şenalp ME 521 24Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 25: 5. Curves and Curve Modeling

Composite Curves

Curves can be represented by connected segments to form a composite curve

There must be continuity at the mid-points

1 2 34

Dr. Ahmet Zafer Şenalp ME 521 25Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 26: 5. Curves and Curve Modeling

Degrees of Continuity

Position continuity

Slope continuity 1st derivative

Curvature continuity 2nd derivative

• Higher derivatives as necessary

Dr. Ahmet Zafer Şenalp ME 521 26Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 27: 5. Curves and Curve Modeling

Position Continuity

1 2

3

Connected (C0 continuity)

Mid-points are connected

Dr. Ahmet Zafer Şenalp ME 521 27Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 28: 5. Curves and Curve Modeling

Slope Continuity

1

2

Continuous tangent

Tangent continuity (C1 continuity)

Both curves have the same 1. derivative value at the connection point. At the same time position continuity is also attained.

Dr. Ahmet Zafer Şenalp ME 521 28Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 29: 5. Curves and Curve Modeling

Continuous curvature

Curvature continuity (C2 continuity)

12

Curvature Continuity

Both curves have the same 2.derivative value at the connection point.At the same time position and slope continuity is also attained.

Dr. Ahmet Zafer Şenalp ME 521 29Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 30: 5. Curves and Curve Modeling

Composite Curves

A cubic spline has C2 continuity at intermediate points Cubic splines do not allow local control

1 2 3

4

Cubic polynomials

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 30Mechanical Engineering Department,

GTU

Page 31: 5. Curves and Curve Modeling

Linear Interpolation

General Linear Interpolation:One of the simplest method is linear interpolation.

Dr. Ahmet Zafer Şenalp ME 521 31Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 32: 5. Curves and Curve Modeling

Parametric Cubic Polynomial Curves

Cubic polynomials are the lowest-order polynomials that can represent a non-planar curve

The curve can be defined by 4 boundary conditions

33

2210)(P uuuu kkkk

Dr. Ahmet Zafer Şenalp ME 521 32Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 33: 5. Curves and Curve Modeling

Cubic Polynomials

Lagrange interpolation - 4 points Hermite interpolation - 2 points, 2 slopes

p0

p3

p2

p1

Lagrangep0

p1

P1’P0’

Hermite

Dr. Ahmet Zafer Şenalp ME 521 33Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 34: 5. Curves and Curve Modeling

Lagrange Interpolation

2 xi terms should not be the same,For N+1 data points ; (x0,y0),...,(xN,yN) için Lagrange interpolation form is in the form of linear combination:

j (x) =

N

ji0i ij

i

xxxx =

Nj2j1j0j

N210

xx.............xxxxxxxx.............xxxxxx

L(x)= 1 (x) y1+ 2 (x) y2+...................... N (x) yN = j

N

0jj y)x(

Below polynomial is called Lagrange base polynomial;

Dr. Ahmet Zafer Şenalp ME 521 34Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 35: 5. Curves and Curve Modeling

Lagrange Interpolation

This image shows, for four points ((−9, 5), (−4, 2), (−1, −2), (7, 9)), the (cubic) interpolation polynomial L(x) (in black), which is the sum of the scaled basis polynomials y0ℓ0(x), y1ℓ1(x), y2ℓ2(x) and y3ℓ3(x). The interpolation polynomial passes through all four control points, and each scaled basis polynomial passes through its respective control point and is 0 where x corresponds to the other three control points

Dr. Ahmet Zafer Şenalp ME 521 35Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 36: 5. Curves and Curve Modeling

Lagrange Interpolation Example:

A 3. degree L(x) function has the following x and corresponding y values;

x= 0 1 2 3 4 y= 8 6 -6 -9 -1

403020104x3x2x1x

2424x50x35x10x 234

413121014x3x2x0x

6x24x26x9x 234

423212024x3x1x0x

4x12x19x8x 234

432313034x2x1x0x

6x8x14x7x 234

342414043x2x1x0x

24x6x11x6x 234

The polynomial corresponding to the above values can be determined by Lagrange interpolation method:

Dr. Ahmet Zafer Şenalp ME 521 36Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

)x(1

)x(2

)x(3

)x(4

)x(5

)x()x(9)x(6)x(6)x(8)x(L 54321

Page 37: 5. Curves and Curve Modeling

Lagrange Interpolation Example:

obtained.

L(x)= -0,7083x4+7,4167x3-22,2917x2+13,5833x+8

Dr. Ahmet Zafer Şenalp ME 521 37Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 38: 5. Curves and Curve Modeling

Cubic Hermite Interpolation

There are no algebraic coefficints but there are geometric coefficints

Position vector at the starting point

Position vector at the end point

Tangent vector at the starting point

Tangent vector at the end point

General form of Cubic Hermite interpolation:

Also known as cubic splines.Enables up to C1 continuity.

Dr. Ahmet Zafer Şenalp ME 521 38Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Page 39: 5. Curves and Curve Modeling

Cubic Hermite Interpolation

Hermite base functions

5. Curves and Curve Modeling

Hermite form is obtained by the linear summation of this 4 function at each interval.

Dr. Ahmet Zafer Şenalp ME 521 39Mechanical Engineering Department,

GTU

Page 40: 5. Curves and Curve Modeling

Cubic Hermite Interpolation

The effect of tangent vector to the curve shape

5. Curves and Curve Modeling

Geometrik katsayı matrisi

Geometric coefficient matrix controls the shape of the curve.

Dr. Ahmet Zafer Şenalp ME 521 40Mechanical Engineering Department,

GTU

Page 41: 5. Curves and Curve Modeling

Cubic Hermite Interpolation

Hermite curve set with same end points (P0 ve P1), Tangent vectors P0’ and P1’ have the same directions but P0’ have different magnitude P1’ is constant

5. Curves and Curve Modeling

P0

P0’

P2

T2

Dr. Ahmet Zafer Şenalp ME 521 41Mechanical Engineering Department,

GTU

Page 42: 5. Curves and Curve Modeling

Cubic Hermite Interpolation

All tangent vector magnitudes are equal but the direction of left tangent vector changes.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 42Mechanical Engineering Department,

GTU

Page 43: 5. Curves and Curve Modeling

Cubic Hermite Interpolation

There are no algebraic coefficints but there are geometric coefficints

Cubic Hermite interpolation form:

Dr. Ahmet Zafer Şenalp ME 521 43Mechanical Engineering Department,

GTU

5. Curves and Curve Modeling

Can also be written as:

1

0

1

0

23

000101001233

1122

1)(

PPPP

uuuuP

Page 44: 5. Curves and Curve Modeling

Approximated Curves

Bezier B-Spline NURBS etc.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 44Mechanical Engineering Department,

GTU

Page 45: 5. Curves and Curve Modeling

Bezier Curves

P. Bezier of the French automobile company of Renault first introduced the Bezier curve (1962).

Bezier curves were developed to allow more convenient manipulation of curves

A system for designing sculptured surfaces of automobile bodies (based on the Bezier curve)

A Bezier curve is a polynomial curve approximating a control polygon

Quadratic and cubic Bézier curves are most common

Higher degree curves are more expensive to evaluate.

When more complex shapes are needed, low order Bézier curves are patched together.

Bézier curves are easily programmable. Bezier curves are widely used in computer graphics.

Enables up to C1 continuity.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 45Mechanical Engineering Department,

GTU

Page 46: 5. Curves and Curve Modeling

Control polygon

Bezier Curves5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 46Mechanical Engineering Department,

GTU

Page 47: 5. Curves and Curve Modeling

Bezier Curves5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 47Mechanical Engineering Department,

GTU

Page 48: 5. Curves and Curve Modeling

Bezier Curves

where the polynomials

are known as Bernstein basis polynomials of degree n, defining t0 = 1 and (1 - t)0 = 1.

General Bezier curve form which is controlled by n+1 Pi control points;

: binomial coefficient.

5. Curves and Curve Modeling

Degree of polynomial is one less than the control points used.Dr. Ahmet Zafer Şenalp ME 521 48Mechanical Engineering Department,

GTU

Page 49: 5. Curves and Curve Modeling

The points Pi are called control points for the Bézier curve

The polygon formed by connecting the Bézier points with lines, starting with P0 and finishing with Pn, is called the Bézier polygon (or control polygon). The convex hull of the Bézier polygon contains the Bézier curve.

The curve begins at P0 and ends at Pn; this is the so-called endpoint interpolation property.

The curve is a straight line if and only if all the control points are collinear.

The start (end) of the curve is tangent to the first (last) section of the Bézier polygon.

A curve can be split at any point into 2 subcurves, or into arbitrarily many subcurves, each of which is also a Bézier curve.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 49Mechanical Engineering Department,

GTU

Page 50: 5. Curves and Curve Modeling

Bezier CurvesLinear Curves

t= [0,1] form of a linear Bézier curve turns out to be linear interpollation form.

Curve passes through points P0 ve P1. Animation of a linear Bézier curve, t in [0,1]. The t in the function for a linear Bézier

curve can be thought of as describing how far B(t) is from P0 to P1.

For example when t=0.25, B(t) is one quarter of the way from point P0 to P1. As t varies from 0 to 1, B(t) describes a curved line from P0 to P1.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 50Mechanical Engineering Department,

GTU

Page 51: 5. Curves and Curve Modeling

Bezier CurvesQuadratic Curves

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 a linear Bézier curve.

Point B(t) varies from Q0 to Q1 and describes a quadratic Bézier curve.

5. Curves and Curve Modeling

Curve passes through P0 , P1 & P2 points.

Dr. Ahmet Zafer Şenalp ME 521 51Mechanical Engineering Department,

GTU

Page 52: 5. Curves and Curve Modeling

Bezier CurvesHigher Order Curves

For higher-order curves one needs correspondingly more intermediate points.

Cubic Bezier CurveCurve passes through P0 , P1, P2 & P3 points.

For cubic curves one can construct intermediate points Q0, Q1 & Q2 that describe linear Bézier curves, and points R0 & R1 that describe quadratic Bézier curves

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 52Mechanical Engineering Department,

GTU

Page 53: 5. Curves and Curve Modeling

Bezier CurvesBernstein Polynomials

5. Curves and Curve Modeling

Most of the graphics packages confine Bézier curve with only 4 control points. Hence n = 3 .

43

323

223

123

Pt

P)t3t3(

P)t3t6t3(

P)1t3t3t()t(Q

Bernstein polinomials

t

f(t)1

1

BB1 BB4

BB2 BB3

2B )t1(t3B

2

3B tB

4

3B )t1(B

1

)t1(t3B 2B3

Dr. Ahmet Zafer Şenalp ME 521 53Mechanical Engineering Department,

GTU

Page 54: 5. Curves and Curve Modeling

Bezier Curves Higher Order Curves

Fourth Order Bezier CurveCurve passes through P0 , P1, P2, P3 & P4 points.

For fourth-order curves one can construct intermediate points Q0, Q1, Q2 & Q3 that describe linear Bézier curves, points R0, R1 & R2 that describe quadratic Bézier curves, and points S0 & S1 that describe cubic Bézier curves:

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 54Mechanical Engineering Department,

GTU

Page 55: 5. Curves and Curve Modeling

Bezier Curves Polinomial Form

Sometimes it is desirable to express the Bézier curve as a polynomial instead of a sum of less straightforward Bernstein polynomials.

Application of the binomial theorem to the definition of the curve followed by some rearrangement will yield:

and

This could be practical if Cj can be computed prior to many evaluations of B(t); however one should use caution as high order curves may lack numeric stability (de Casteljau's algorithm should be used if this occurs).

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 55Mechanical Engineering Department,

GTU

Page 56: 5. Curves and Curve Modeling

Bezier Curves Example:

Coordinatess of 4 control poits are given as:

5. Curves and Curve Modeling

What is the equation of Bezier curve that will be obtained by using above points? What are the coordinate values on the curve corresponding to t=0,1/4,2/4,3/4,1 ?Solution: For 4 points 3. order Bezier form is used:

1,0,)1(3)1(3)1()( 33

22

12

03 tPtPttPttPttB

ToPB 022)0(

TPPPPB 056,215,2641

649

6427

6427)

41( 3210

TPPPPB 075,250,281

83

83

81)

42( 3210

TPPPPB 056,284,26427

6427

649

641)

43( 3210

TPB 023)1( 3

Points on B(t) curve

: Bezier curve equation

Dr. Ahmet Zafer Şenalp ME 521 56Mechanical Engineering Department,

GTU

Page 57: 5. Curves and Curve Modeling

Bezier Curves Example:

Equation of Bezier curve:

5. Curves and Curve Modeling

023

033

)1(3032

)1(3022

)1()( 3223 tttttttB

Control pointsPoints on B(t) curve

Dr. Ahmet Zafer Şenalp ME 521 57Mechanical Engineering Department,

GTU

Page 58: 5. Curves and Curve Modeling

Bezier Curves Disadvantages

Difficult to interpolate points Cannot locally modify a Bezier curve

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 58Mechanical Engineering Department,

GTU

Page 59: 5. Curves and Curve Modeling

Bezier Curves Global Change

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 59Mechanical Engineering Department,

GTU

Page 60: 5. Curves and Curve Modeling

Bezier Curves Local Change

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 60Mechanical Engineering Department,

GTU

Page 61: 5. Curves and Curve Modeling

Bezier Curves Example

5. Curves and Curve Modeling

2 cubic composite Bézier curve - 6. order Bézier curvecomparisson

Dr. Ahmet Zafer Şenalp ME 521 61Mechanical Engineering Department,

GTU

Page 62: 5. Curves and Curve Modeling

Bezier Curves Modeling Example

5. Curves and Curve Modeling

Contains 32 curve

Polygon representation

Dr. Ahmet Zafer Şenalp ME 521 62Mechanical Engineering Department,

GTU

Page 63: 5. Curves and Curve Modeling

B-Spline Curves

B-splines are generalizations of Bezier curves A major advantage is that they allow local control B-spline is a spline function that has minimal support with respect to a given degree,

smoothness, and domain partition. A fundamental theorem states that every spline function of a given degree, smoothness, and

domain partition, can be represented as a linear combination of B-splines of that same degree and smoothness, and over that same partition.

The term B-spline was coined by Isaac Jacob Schoenberg and is short for basis spline. B-splines can be evaluated in a numerically stable way by the de Boor algorithm.

A B-spline is simply a generalisation of a Bézier curve, and it can avoid the Runge phenomenon without increasing the degree of the B-spline.

The degree of curve obtained is independent of number of control points. Enables up to C2 continuity.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 63Mechanical Engineering Department,

GTU

Page 64: 5. Curves and Curve Modeling

B-Spline Curves

Pi defines B-Spline curve with given n+1 control points:

5. Curves and Curve Modeling

Here Ni,k(u) is B-Spline functions are proposed by Cox and de Boor in 1972.

k parameter controls B-Spline curve degree (k-1) and generally independent of number of control points.

ui is called parametric knots or (knot vales) for an open curve B-Spline:

aksi durumda

Dr. Ahmet Zafer Şenalp ME 521 64Mechanical Engineering Department,

GTU

Page 65: 5. Curves and Curve Modeling

This inequality shows that; for linear curve at least 2 for 2. degree curve at least 3 for cubic curve at least 4 control points are necessary.

B-Spline Curves5. Curves and Curve Modeling

if a curve with (k-1) degree and ( n+1) control points is to be developed, (n+k+1) knots then are required.

Dr. Ahmet Zafer Şenalp ME 521 65Mechanical Engineering Department,

GTU

Page 66: 5. Curves and Curve Modeling

Linear functionk=2

B-Spline Curves5. Curves and Curve Modeling

Below figures show B-Spline functions:

2. degree functionk=3

cubic functionk=4

Dr. Ahmet Zafer Şenalp ME 521 66Mechanical Engineering Department,

GTU

Page 67: 5. Curves and Curve Modeling

Number of control points is independent than the degree of the polynomial.

B-Spline CurvesProperties

5. Curves and Curve Modeling

The higher the order of the B-Spline, the less the influence the closecontrol point

Lineark=2

vertex

Quadratic B-Spline; k=3Cubic B-Spline; k=4

Fourth Order B-Spline; k=5

n=3

vertex

vertex

vertex

Dr. Ahmet Zafer Şenalp ME 521 67Mechanical Engineering Department,

GTU

Page 68: 5. Curves and Curve Modeling

B-spline allows better local control. Shape of the curvecan be adjusted by moving the control points. Local control: a control point only influences k segments.

B-Spline CurvesProperties

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 68Mechanical Engineering Department,

GTU

Page 69: 5. Curves and Curve Modeling

B-Spline Curves Example:

Cubic Spline; k=4, n=38 knots are required.

5. Curves and Curve Modeling

Limits of u parameter:Bezier curve equality;

reminder :

Equation results 8 knots

reminder : To define a (k-1) degree curve with (n+1) control points (n+k+1) knots are required.

B-Spline vector can be calculated together with knot vector;

*Dr. Ahmet Zafer Şenalp ME 521 69Mechanical Engineering Department,

GTU

Page 70: 5. Curves and Curve Modeling

B-Spline Curves Example:

5. Curves and Curve Modeling

aksi durumda

aksi durumda

aksi durumda

else

else

else

Dr. Ahmet Zafer Şenalp ME 521 70Mechanical Engineering Department,

GTU

Page 71: 5. Curves and Curve Modeling

B-Spline Curves Example:

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 71Mechanical Engineering Department,

GTU

Page 72: 5. Curves and Curve Modeling

B-Spline Curves Example:

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 72Mechanical Engineering Department,

GTU

Page 73: 5. Curves and Curve Modeling

B-Spline Curves Example:

5. Curves and Curve Modeling

Replacing into Ni,4 * equality;

By replacing Ni,3 into the above equality the B-Spline curve equation given below is obtained.

This equation is the same with Bezier curve with the same control points.Hence cubic B-Spline curve with 4 control points is the same with cubic Bezier curve with the same control points.

Dr. Ahmet Zafer Şenalp ME 521 73Mechanical Engineering Department,

GTU

Page 74: 5. Curves and Curve Modeling

Bezier Blending Functions; Bi,n

B-spline Blending Functions; Ni,k

Bezier /B-Spline Curves5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 74Mechanical Engineering Department,

GTU

Page 75: 5. Curves and Curve Modeling

Bezier /B-Spline Curves5. Curves and Curve Modeling

Point that is moved

This point is moving

This point is not moving

Dr. Ahmet Zafer Şenalp ME 521 75Mechanical Engineering Department,

GTU

Page 76: 5. Curves and Curve Modeling

When B-spline is uniform B-spline functions with n degrees are just shifted copies of each other.Knots are equally spaced along the curve.

Uniform B-Spline Curves5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 76Mechanical Engineering Department,

GTU

Page 77: 5. Curves and Curve Modeling

Rational Curves and NURBS

• Rational polynomials can represent both analytic and polynomial curves in a uniform way

• Curves can be modified by changing the weighting of the control points

• A commonly used form is the Non-Uniform Rational B-spline (NURBS)

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 77Mechanical Engineering Department,

GTU

Page 78: 5. Curves and Curve Modeling

Rational Bezier Curves

The rational Bézier adds adjustable weights to provide closer approximations to arbitrary shapes. The numerator is a weighted Bernstein-form Bézier curve and the denominator is a weighted sum of Bernstein polynomials.Given n + 1 control points Pi, the rational Bézier curve can be described by:

5. Curves and Curve Modeling

or simply

Dr. Ahmet Zafer Şenalp ME 521 78Mechanical Engineering Department,

GTU

Page 79: 5. Curves and Curve Modeling

Rational B-Spline Curves

One rational curve is defined by ratios of 2 polynomials. In rational curve control points are defined in homogenous coordinates.

Then rational B-Spline curve can be obtained in the following form:

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 79Mechanical Engineering Department,

GTU

Page 80: 5. Curves and Curve Modeling

Rational B-Spline Curves

Ri,k(u) is the rational B-Spline basis functions.

The above equality show that; Ri,k(u) basis functions are the generelized form of Ni,k(u).When hi=1 is replaced in Ri,k(u) equality shows the same properties with the nonrational form.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 80Mechanical Engineering Department,

GTU

Page 81: 5. Curves and Curve Modeling

NURBS

It is non uniform rational B-Spline formulation. This mathematical model is generally used for constructing curves and surfaces in computer graphics.

NURBS curve is defined by its degree, control points with weights and knot vector. NURBS curves and surfaces are the generalized form of both B-spline and Bézier curves and

surfaces. Most important difference is the weights in the control points which makes NURBS rational

curve. NURBS curves have only one parametric direction (generally named as s or u). NURBS

surfaces have 2 parametric directions. NURBS curves enables the complete modeling of conic curves.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 81Mechanical Engineering Department,

GTU

Page 82: 5. Curves and Curve Modeling

NURBS

General form of a NURBS curve;

k: is the number of control points (Pi) wi: weigthsThe denominator is a normalizing factor that evaluates to one if all weights are one. This can be seen from the partition of unity property of the basis functions. It is customary to write this as

Rin: are known as the rational basis functions.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 82Mechanical Engineering Department,

GTU

Page 83: 5. Curves and Curve Modeling

NURBSExamples

Uniform knot vector

5. Curves and Curve Modeling

Nonuniform knot vector

Dr. Ahmet Zafer Şenalp ME 521 83Mechanical Engineering Department,

GTU

Page 84: 5. Curves and Curve Modeling

NURBSDevelopment of NURBS

Boeing: Tiger System in 1979 SDRC: Geomod in 1993 University of Utah: Alpha-1 in 1981 Industry Standard: IGES, PHIGS, PDES,Pro/E, etc.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 84Mechanical Engineering Department,

GTU

Page 85: 5. Curves and Curve Modeling

NURBSAdvantages

Serve as a genuine generalizations of non-rational B-spline forms as well as rational and non-rational Bezier curves and surfaces

Offer a common mathematical form for representing both standard analytic shapes (conics, quadratics, surface of revolution, etc) and free-from curves and surfaces precisely. B-splines can only approximate conic curves.

By evaluating a NURBS curve at various values of the parameter, the curve can be represented in cartesian two- or three-dimensional space. Likewise, by evaluating a NURBS surface at various values of the two parameters, the surface can be represented in cartesian space.

Provide the flexibility to design a large variety of shapes by using control points and weights. increasing the weights has the effect of drawing a curve toward the control point.

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 85Mechanical Engineering Department,

GTU

Page 86: 5. Curves and Curve Modeling

NURBSAdvantages

Have a powerful tool kit (knot insertion/refinement/removal, degree elevation, splitting, etc.)

They are invariant under affine as well as perspective transformations: operations like rotations and translations can be applied to NURBS curves and surfaces by applying them to their control points.

Reasonably fast and computationally stable. They reduce the memory consumption when storing shapes (compared to simpler methods).

They can be evaluated reasonably quickly by numerically stable and accurate algorithms.

Clear geometric interpretations

5. Curves and Curve Modeling

Dr. Ahmet Zafer Şenalp ME 521 86Mechanical Engineering Department,

GTU


Recommended