dr. deepak kumar room no: 2, department of mechanical...

122
Computer Aided Design Design of Curve Instructor Dr. Deepak Kumar Room No: 2, Department of Mechanical Engineering NIT Jamshedpur

Upload: others

Post on 26-Sep-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Design of CurveInstructorDr. Deepak KumarRoom No: 2, Department of Mechanical EngineeringNIT Jamshedpur

Page 2: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

PLANE CURVES

1. Analytical Curves2. Synthetic Curves

Page 3: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 4: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 5: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 6: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 7: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 8: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 9: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Parametric Representation of Curves and Surfaces

Two types of equations for curve representation (1) Parametric equation x, y, z coordinates are related by a parametric variable (uor θ) (2) Nonparametric equation x, y, z coordinates are related by a function

Page 10: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Curve Equations

Page 11: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 12: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Parametric Equations –Advantages over nonparametric forms

Page 13: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 14: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 15: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 16: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 17: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 18: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 19: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 20: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 21: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 22: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 23: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 24: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 25: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 26: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 27: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 28: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 29: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 30: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 31: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 32: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

y

x

Curve Fitting

Data point approximated by straight Line

Page 33: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Is a straight line suitable for each of these cases ?

Page 34: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Polynomial Fit

Page 35: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 36: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 37: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Page 38: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignParametric Continuity Conditions

• To represent a curve as a series of piecewise parametric curves, these curves to fit together reasonably

…Continuity!

Page 39: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignContinuity

When two curves are joined, we typically want some degree of continuity across the boundary (the knot)– C0, “C‐zero”, point‐wise continuous, curves share the same point where they join

Let C1(u) and C2(u) , be two parametric Curves. 0 1u

C1(1) = C2(0)

Page 40: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

– C1, “C‐one”, continuous derivatives, curves share the same parametric derivatives where they join

C´1(1)= C´2(0)

Page 41: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

– C2, “C‐two”, continuous second derivatives, curves share the same parametric second derivatives where they join

– Higher orders possible

C˝1(1)= C˝2(0)

Page 42: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Interpolation Splines

• When polynomial sections are fitted so that the curve passes through each control point, the resulting curve is said to interpolate the set of control points.

Page 43: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Approximation Splines• When polynomial sections are fitted to the

general control point path without necessarily passing through any control point, the resulting curve is said to approximate the set if control points.

Page 44: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Types of Spline

Hermite Cubic SplinesNatural Cubic SplinesCardinal Splines

Page 45: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Control Points

How many control points?

Two points define a line (1storder)

Three points define a quadratic curve (2ndorder)

Four points define a cubic curve (3rdorder)

k+1points define a k-order curve

Page 46: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

• A spline is a parametric curve defined by control points– The term spline , taken from engineering drawing, where a spline was a piece of flexible wood used to draw smooth curves

– The control points are adjusted by the user to control the shape of the curve

Hermite Cubic Spline

*Interpolation is the process of defining a function that “connects the dots” between specified (data) points. 

Page 47: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

• A Hermite spline is a curve for which the user provides:– The endpoints of the curve– The parametric derivatives of the curve at the endpoints (tangents with length)

• The parametric derivatives are dx/du, dy/du, dz/du

– That is enough to define a cubic Hermite spline

Hermite Cubic Spline

Page 48: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Hermite Cubic SplineThe parametric equation of a cubic spline segment is given by

3

0( ) ,0 1i

ii

P u C u u

Where u is the parameter and Ci are the polynomial (also called as algebraic ) co-efficients. In scalar form, this equation is written as,

3 23 2 1 0( ) x x x xx u C u C u C u C

3 23 2 1 0( ) y y y yy u C u C u C u C

3 23 2 1 0( ) z z z zz u C u C u C u C

(1)

(2)

In the expanded vector form, Eq. (1) can be written as,3 2

3 2 1 0( )P u C u C u C u C (3)*A cubic spline has degree 3.

Page 49: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Equation can also be written as in matrix form as,

Hermite Cubic Spline

( ) TP u U C

3 2 1T

U u u u

where,and 3 2 1 0

TC C C C C

C is called the co-efficients vectorTangent vector to the curve at any point is given by differentiating Eq. (1), with respect to u give

3' 1

0( ) ,0 1i

ii

P u C iu u

(5)

(4)

Page 50: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Hermite Cubic SplineApplying boundary conditions ( , at u=0 and , at u=1)0P '

0P 1P '1P

Eq. (1) and (2) give0 0P C'

0 1P C

1 3 2 1 0P C C C C

1

'3 2 13 2P C C C

Solving these four equations simultaneously for the co-efficients gives0 0C P

'1 0C P

' '2 1 0 0 13( ) 2C P P P P

' '3 0 1 0 12( )C P P P P

(6)

(7)

Page 51: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Substituting Eq. (6) into Eq. (3),

3 2 3 2 3 2 ' 3 2 '0 1 0 1( ) (2 3 1) ( 2 3 ) ( 2 ) ( )P u u u P u u P u u u P u u P

0 1u (8)

The tangent vector becomes, , , and are called geometric co-efficients.0P 1P '

0P '1P

' 2 2 2 ' 2 '0 1 0 1( ) (6 6 ) ( 6 6 ) (3 4 1) (3 2 )P u u u P u u P u u P u u P

0 1u (9)

The function of u in Eq. (1) and (2) are called blending functions.

Equation (8) can be written as in matrix form, ( ) ,T

HP u U M V 0 1u

Page 52: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Where [MH] is the Hermite matrix and V is the geometry vector. Both are given by

2 2 1 13 3 2 1

0 0 1 01 0 0 0

HM

' '0 1 0 1

TV P P P P

Comparing Eq. 4 and  9 show that C=[MH]V  or

1HV M C

where 1

0 0 0 11 1 1 10 0 1 03 2 1 0

HM

Page 53: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Eq. 8 can be written as

' ( ) uTHP u U M V

where                   is given by uHM

0 0 0 06 6 3 36 6 4 2

0 0 1 0

uHM

Page 54: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignBezier Curves

• Different choices of basis functions give different curves– Choice of basis determines how the control points influence the curve

– In Hermite case, two control points define endpoints, and two more define parametric derivatives

• For Bezier curves, two control points define endpoints, and two control the tangents at the endpoints in a geometric way

Page 55: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Control Point Interpretation

Point along start tangent

End Point

Point along end TangentStart Point

2x

0x 2x

3x

Page 56: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignBezier Curves of Varying Degree

Page 57: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignBézier Curves

Bézier splines are: spline approximation method; useful and convenient for curve and surface design; easy to implement; available in Cad system, graphic package, drawing and

painting packages.

Page 58: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignBézier Curves

• In general, a Bézier curve section can be fitted to any number of control points.

• The number of control points to be approximated and their relative position determine the degree of the Bézier polynomial.

Page 59: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

• Coordinate points can be blended to produced the following position vector P(u), which describes the path of an approximating Bézier polynomial function between P0 and Pn.

,0

( ) ( ),0 1n

i i ni

P u PB u u

Where P(u) is any point on the curve and Pi is a control point. Bi,n are the Bernstein Polynomials.  Thus, the Bezier curve has a Bernstein basis. The Bernstein polynomialServes as the blending or basis function for the Bezier curve and given by

, ( ) ( , ) (1 )i n ii nB u C n i u u

Where C (n,i) is the binomial coefficient

!( , )!( )!

nC n ii n i

(10)

Page 60: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

1 2 2 10 1 2 1( ) (1 ) ( ,1) (1 ) ( ,2) (1 ) .... ( , 1) (1 ) ,0 1n n n n n

n nP u P u PC n u u P C n u u P C n n u u P u u

Expanding Eq (10) and utilizing C(n,0)=C(n,n)

30,3( ) (1 )B u u 2

1,3( ) 3 (1 )B u u u 22,3( ) 3 (1 )B u u u

33,3( )B u u

0 0,3 1 1,3 2 2,3 3 3,3( ) ( ) ( ) ( ) ( )P u P B u PB u P B u P B u

3 2 2 30 1 2 3( ) (1 ) 3 (1 ) 3 (1 )P u u P u u P u u P u P

,0

( ) ( ),0 1n

i i ni

P u PB u u

(10)

Page 61: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignThe vertices of the Bezier polygon are numbered from 0 to n.

• Properties of Bezier curve- The basis functions are real.- The degree of the polynomial defining the curve segment is one less than the number of defining polygon points.

Page 62: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design- The curve generally follows the shape of the defining

polygon.- The first and last points on the curve are coincident with

the first and last points of the defining polygon.- The tangent vectors at the ends of the curve have the

same direction as the first and last polygon spans, respectively.

- The curve is contained within the convex hull of the defining polygon, i.e., within the largest convex polygon obtainable with the defining polygon vertices

- The curve is invariant under an affine transformation.

Page 63: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

% Bezier curve for n=3. u=0:.01:1;x=[1 2 4 3];y=[1 3 3 1];px=(1‐u).^3*x(1)+3*u.*(1‐u).^2*x(2)+3*u.^2.*(1‐u)*x(3)+u.^3*x(4);py=(1‐u).^3*y(1)+3*u.*(1‐u).^2*y(2)+3*u.^2.*(1‐u)*y(3)+u.^3*y(4);plot(x,y); holdplot(px,py,'r');axis([0 4.2 0 3.2]);

X(u)

Y(u)

Page 64: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Example% Bezier curve for n=3. u=0:.01:1;x=[1 2 4 3];y=[1 1 3 1];px=(1‐u).^3*x(1)+3*u.*(1‐u).^2*x(2)+3*u.^2.*(1‐u)*x(3)+u.^3*x(4);py=(1‐u).^3*y(1)+3*u*(1‐u).^2*y(2)+3*u.^2.*(1‐u)*y(3)+u.^3*y(4);plot(x,y); holdplot(px,py,'r');axis([0 4.2 0 3.2]);

Page 65: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignExample% Bezier curve for n=3. u=0:.01:1;x=[1 2 4 1];y=[1 3 3 1];px=(1‐u).^3*x(1)+3*u.*(1‐t).^2*x(2)+3*u.^2.*(1‐u)*x(3)+u.^3*x(4);py=(1‐u).^3*y(1)+3*u.*(1‐u).^2*y(2)+3*u.^2.*(1‐u)*y(3)+u.^3*y(4);plot(x,y); holdplot(px,py,'r');axis([0 4.2 0 3.2]);

Page 66: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignMatrix formulation of Bezier Curve

Consider a cubic Bezier curve

( ) [ ][ ] [ ][ ][ ]P u F G U N G

Where [F] is the blending matrix  given by

0, 1, 1, ,[ ] [ , ,..... , ]n n n n n nF B B B B

3 2 2 30 1 2 3[ ][ ] (1 ) 3 (1 ) 3 (1 ) [ ]TF G u u u u u u P P P P

0

13 2

2

3

1 3 3 13 6 3 0

( ) [ ][ ] [ ][ ][ ] 13 3 0 0

1 0 0 0

PP

P u F G U N G u u uPP

Page 67: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignMatrix formulation of Bezier Curve

We can extend this now to a quadratic, for n=4, Bezier curve

( ) [ ][ ] [ ][ ][ ]P u F G U N G

0

14 3 2

2

3

4

1 4 6 4 14 12 12 4 0

( ) [ ][ ] [ ][ ][ ] 1 6 12 6 0 04 4 0 0 0

1 0 0 0 0

PPPP u F G U N G u u u uPP

Page 68: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis: Motivation

Consider designing the profile of a vase.• The left figure below is a Bézier curve of degree 11; but, it is difficult to bend the "neck" toward the line segment

P4P5. • The middle figure below uses this idea. It has three Bézier curve segments of degree 3 with joining points marked

with yellow rectangles.• The right figure below is a B-spline curve of degree 3 defined by 8 control points .

Page 69: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis: Motivation

• Those little dots subdivide the B-spline curve into curve segments. • One can move control points for modifying the shape of the curve just like what we do to Bézier

curves. • We can also modify the subdivision of the curve. Therefore, B-spline curves have higher degree of

freedom for curve design.

Page 70: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis: Motivation

• Subdividing the curve directly is difficult to do. Instead, we subdivide the domain of the curve.

• The domain of a curve is [0,1], this closed interval is subdivided by points called knots. • These knots be 0 <= u0 <= u1 <= ... <= um <= 1.• Modifying the subdivision of [0,1] changes the shape of the curve.

Page 71: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis: Motivation

• In summary : to design a B-spline curve, we need a set of control points, a set of knots and a set of coefficients, one for each control point, so that all curve segments are joined together satisfying certain continuity condition.

Page 72: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

B-Spline Basis: Motivation

• The computation of the coefficients is perhaps the most complex step because they must ensure certain continuity conditions.

Page 73: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

B-Spline Curves

Page 74: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

B-Spline Curves(Two Advantages)

1. The degree of a B-spline polynmial can be set independently of the number of control points.

2. B-splines allow local control over the shape of a spline curve (or surface)

Page 75: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Curves(Two Advantages)

A B‐spline curve that is defined by 6 control point, and shows the effect of varying the degree of the polynomials (2,3, and 4)

Q3 is defined by P0,P1,P2,P3

Q4  is defined by P1,P2,P3,P4

Q5  is defined by P2,P3,P4,P5

Each curve segment 

shares control points.

Page 76: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Curves

(Two Advantages) The effect of changing the position of control 

point P4 (locality property).

Page 77: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Curves

Bézier Curve B‐Spline Curve

Page 78: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Two Major Limitations of the Bezier Curves1. Dependence on the number of defining polygon vertices– Hence the degree of the basis function is fixed by this– To increase or decrease the order we need to increase or decrease the no. of polygon vertices2. No local control – only global control

3 2 2 30 1 2 3( ) (1 ) 3 (1 ) 3 (1 )P u u P u u P u u P u P

Page 79: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

B-Spline• How it is like the Bezier– Approximates control points– Possesses Convex Hull Property• How it differs– Degree of polynomial is for the most part independent of the control points– Local control over spline shape• Local control achieved by defining blending functionsover subintervals of the total range– Stronger Convex Hull Property• More complex than Bezier• Generally non-globa

Page 80: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignDescription of B‐Spline

– k=degree

• Can be 2 to the number of control points

– If k set to 1, then only a plot of the control points

• Bi is the input set of n+1 control points (polygon vertices)

• Parameter t now depends on how we choose the other 

parameters (no longer locked to 0‐1)

• N i,k blending functions

Polynomials of degree k‐1at each interval xi

, max0

( ) ( ),0n

i i ki

P u PN u u u

Page 81: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

B-Spline Basis Functions(Knots, Knot Vector)

• Let U be a set of m + 1 non-decreasing numbers, u0 <= u2 <= u3 <= ... <= um. The ui'sare called knots,

• The set U is the knot vector.

Page 82: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

B-Spline Basis Functions(Knots, Knot Vector)

muuuuU ,,,, 210 K

• The half-open interval [ui, ui+1) is the i-th knot span.

• Some ui's may be equal, some knot spans may not exist.

Page 83: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

B-Spline Basis Functions(Knots)

muuuuU ,,,, 210 K

• If a knot ui appears k times (i.e., ui = ui+1 = ... = ui+k-1), where k > 1, ui is a multiple knot of multiplicity k, written as ui(k).

• If ui appears only once, it is a simple knot.• If the knots are equally spaced (i.e., ui+1 - ui is a constant for 0

<= i <= m - 1), the knot vector or the knot sequence is saiduniform; otherwise, it is non-uniform.

Page 84: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions

All B-spline basis functions are supposed to have their domain on [u0, um].

We use u0 = 0 and um = 1 frequently so that the domain is the closed interval [0,1]. 

Page 85: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions

To define B‐spline basis functions, we need one more parameter.

The degree of these basis functions, p. The i‐th B‐spline basis function of degree p, written as Ni,p(u), is defined recursively as follows:

)()()(

otherwise0 if1

)0(

1,111

11,,

10,

uNuuuu

uNuu

uuuN

uuuN

piipi

pipi

ipi

ipi

iii

Page 86: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions

)()()(

otherwise0 if1

)0(

1,111

11,,

10,

uNuuuu

uNuu

uuuN

uuuN

piipi

pipi

ipi

ipi

iii

The above is usually referred to as the Cox-de Boor recursion formula. If the degree is zero (i.e., p = 0), these basis functions are all step functions . basis function Ni,0(u) is 1 if u is in the i-th knot span [ui, ui+1).

We have four knots u0 = 0, u1 = 1, u2 = 2 and u3 = 3, knot spans 0, 1 and 2 are [0,1), [1,2), [2,3) and the basis functions of degree 0 are N0,0(u) = 1 on [0,1) and 0 elsewhere, N1,0(u) = 1 on [1,2) and 0 elsewhere, and N2,0(u) = 1 on [2,3) and 0 elsewhere. 

Page 87: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions

To understand the way of computing Ni,p(u) for p greater than 0, we use the triangular computation scheme. 

Page 88: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions

To compute Ni,1(u), Ni,0(u) and Ni+1,0(u) are required. Therefore, we can compute N0,1(u), N1,1(u), N2,1(u), N3,1(u) and so on. All of these Ni,1(u)'s are written on the third column. Once all Ni,1(u)'s have been computed, we can compute Ni,2(u)'s and put them on the fourth column. This process continues until all required Ni,p(u)'s are computed. 

Page 89: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions

Since u0 = 0, u1 = 1 and u2 = 2, the above becomes 

Page 90: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

Two Important Observation

Page 91: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignTwo Important Observation

• Basis function Ni,p(u) is non-zero on [ui, ui+p+1). Or, equivalently, Ni,p(u) is non-zero on p+1 knot spans [ui, ui+1), [ui+1, ui+2), ..., [ui+p, ui+p+1).

Page 92: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignTwo Important Observation

• On any knot span [ui, ui+1), at most p+1 degree p basis functions are non-zero, namely: Ni-p,p(u), Ni-p+1,p(u), Ni-p+2,p(u), ..., Ni-1,p(u) and Ni,p(u),

Page 93: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

B-Spline Basis Functions(Important Properties )

Page 94: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions(Important Properties )

)()()(

otherwise0 if1

)0(

1,111

11,,

10,

uNuuuu

uNuu

uuuN

uuuN

piipi

pipi

ipi

ipi

iii

1. Ni,p(u) is a degree p polynomial in u.

2. Non‐negativity ‐‐ For all i, p and u, Ni,p(u) is non‐negative

3. Local Support ‐‐ Ni,p(u) is a non‐zero polynomial on [ui,ui+p+1) 

Page 95: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions(Important Properties )

4. On any span [ui, ui+1), at most p+1 degree p basis functions are non‐zero, namely: Ni‐p,p(u), Ni‐p+1,p(u), Ni‐

p+2,p(u), ..., and Ni,p(u) .

5. The sum of all non‐zero degree p basis functions on span [ui, ui+1) is 1.

6. If the number of knots is m+1, the degree of the basis functions is p, and the number of degree pbasis functions is n+1, then m = n + p + 1

Page 96: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions(Important Properties )

7. Basis function Ni,p(u) is a composite curve of degree p polynomials with joining points at knots in [ui, ui+p+1 ) 

8. At a knot of multiplicity k, basis function Ni,p(u) is Cp‐k continuous. 

Increasing multiplicity decreases the level of continuity, and increasing 

degree increases continuity. 

Page 97: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions(Computation Examples)

Simple Knots Suppose the knot vector is U = { 0, 0.25, 0.5, 0.75, 1 }. 

Basis functions of degree 0: N0,0(u), N1,0(u), N2,0(u) and N3,0(u) defined on knot span [0,0.25,), [0.25,0.5), [0.5,0.75) and [0.75,1), respectively.

Page 98: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions(Computation Examples)

All Ni,1(u)'s (U = { 0, 0.25, 0.5, 0.75, 1 }):

5.025.0)21(2

25.004)(1,0 uu

uuuN

for for

75.05.0for 3

5.025.0for 14)(1,1 uu

uuuN

175.0for )1(475.05.0for )12(2

)(1,2 uuuu

uN

Since the internal knots 0.25, 0.5 and 0.75 are all simple (i.e., k = 1) and p = 1, there are p ‐ k + 1 = 1 non‐zero basis function and three 

knots. Moreover, N0,1(u), N1,1(u) and N2,1(u) are C0 continuous at knots 0.25, 0.5 and 0.75, respectively.

Page 99: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions(Computation Examples)

From Ni,1(u)'s, one can compute the basis functions of degree 2. Since m = 4, p = 2, and m = n + p + 1, we have n = 1 and there are only two basis functions of degree 2: N0,2(u) and N1,2(u). (U = { 0, 0.25, 0.5, 0.75, 1 }):

75.05.0for 8125.45.025.0for 16125.1

25.00for 8)(

2

2

2

2,0

uuuuuu

uuuN

175.0for )1(875.05.0for 885.1

5.025.0for 845.0)(

2

2

2

2,1

uuuuu

uuuuN

each basis function is a composite curve of three degree 2 curve segments.

composite curve is of C1 continuity

Page 100: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Basis Functions (Computation Examples)

Knots with Positive Multiplicity :Suppose the knot vector is U = { 0, 0, 0, 0.3, 0.5, 0.5, 0.6, 1, 1, 1} Since m = 9 and p = 0 (degree 0 basis functions), we have n = m ‐ p ‐ 1 = 8. there are only 

four non‐zero basis functions of degree 0: N2,0(u), N3,0(u), N5,0(u) and N6,0(u). 

Page 101: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

B-Spline Basis Functions(Computation Examples)

Basis functions of degree 1: Since p is 1, n = m - p - 1 = 7. The following table shows the result

Basis Function Range EquationN0,1(u) all u 0 N1,1(u) [0, 0.3) 1 - (10/3)u

N2,1(u) [0, 0.3) (10/3)u[0.3, 0.5) 2.5(1 - 2u)

N3,1(u) [0.3, 0.5) 5u - 1.5 N4,1(u) [0.5, 0.6) 6 - 10u

N5,1(u) [0.5, 0.6) 10u - 5 [0.6, 1) 2.5(1 - u)

N6,1(u) [0.6, 1) 2.5u - 1.5 N7,1(u) all u 0

Page 102: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

B-Spline Basis Functions(Computation Examples)

Basis functions of degree 1:

Page 103: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

B-Spline Basis Functions(Computation Examples)

Since p = 2, we have n = m - p - 1 = 6. The following table contains all Ni,2(u)'s:

Function Range EquationN0,2(u) [0, 0.3) (1 - (10/3)u)2

N1,2(u) [0, 0.3) (20/3)(u - (8/3)u2) [0.3, 0.5) 2.5(1 - 2u)2

N2,2(u) [0, 0.3) (20/3)u2

[0.3, 0.5) -3.75 + 25u - 35u2

N3,2(u) [0.3, 0.5) (5u - 1.5)2

[0.5, 0.6) (6 - 10u)2

N4,2(u) [0.5, 0.6) 20(-2 + 7u - 6u2) [0.6, 1) 5(1 - u)2

N5,2(u) [0.5, 0.6) 12.5(2u - 1)2

[0.6, 1) 2.5(-4 + 11.5u - 7.5u2) N6,2(u) [0.6, 1) 2.5(9 - 30u + 25u2)

Page 104: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

B-Spline Basis Functions(Computation Examples)

Basis functions of degree 2:

Since its multiplicity is 2 and the degree of these basis functions is 2, basis function N3,2(u) is C0 continuous at 0.5(2). This is why N3,2(u) has a sharp angle at 0.5(2).

For knots not at the two ends, say 0.3 and 0.6, C1 continuity is maintained since all of them are simple knots.

U = { 0, 0, 0, 0.3, 0.5, 0.5, 0.6, 1, 1, 1}

Page 105: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided Design

B-SplineCurves

Page 106: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Curves

(Definition) Given n + 1 control points P0, P1, ..., Pn and a knot vector  U = { u0, u1, ..., um }, the B‐

spline curve of degree p defined by these control points and knot vector U is 

1,)()( 00

,

nmpuuuuNu m

n

iipi pC

The point on the curve that corresponds to a knot ui, C(ui), is referred to as a knot point. 

The knot points divide a B‐spline curve into curve segments, each of which is defined on a knot span. 

Page 107: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Computer Aided DesignB-Spline Curves

(Definition)

1,)()( 00

,

nmpuuuuNu m

n

iipi pC

The degree of a B‐spline basis function is an input.

To change the shape of a B‐spline curve, one can modify one or more of these control parameters: 

1. The positions of control points2. The positions of knots3. The degree of the curve

Page 108: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

(Open, Clamped & Closed B-Spline Curves) Open B-spline curves: If the knot vector does not have any particular

structure, the generated curve will not touch the first and last legs of the control polyline.

Clamped B-spline curve: If the first knot and the last knot multiplicity p+1, curve is tangent to the first and the last legs at the first and last control polyline, as a Bézier curve does.

Closed B-spline curves: By repeating some knots and control points, the generated curve can be a closed one. In this case, the start and the end of the generated curve join together forming a closed loop.

Open B‐Spline Clamped B‐Spline Closed B‐Spline

Page 109: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

OpenB-Spline Curves

Page 110: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Open B-Spline Curves Recall from the B-spline basis function

property that on a knot span [ui, ui+1), there are at most p+1 non-zero basis functions of degree p.

For open B-spline curves, the domain is [up, um-p].

Page 111: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Open B-Spline CurvesExample 1: knot vector U = { 0, 0.25, 0.5, 0.75, 1 }, where m = 4. If the

basis functions are of degree 1 (i.e., p = 1), there are three basis functions N0,1(u), N1,1(u) and N2,1(u).

Since this knot vector is not clamped, the first and the last knot spans (i.e., [0, 0.25) and [0.75, 1)) have only one non-zero basis functions while the second and third knot spans (i.e., [0.25, 0.5) and [0.5, 0.75)) have two non-zero basis functions.

Page 112: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Open B-Spline CurvesExample 2:

Page 113: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Open B-Spline CurvesExample 3: A B-spline curve of degree 6 (i.e., p = 6) defined by 14

control points (i.e., n = 13). The number of knots is 21 (i.e., m= n + p + 1 = 20).

If the knot vector is uniform, the knot vector is {0, 0.05, 0.10, 0.15, ..., 0.90, 0.95,10}. The open curve is defined on [up, um-

p] = [u6, u14] = [0.3, 0.7] and is not tangent to the first and last legs.

Page 114: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

ClampedB-Spline Curves

Page 115: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Closed B-Spline Curves To construct a closed B-spline curve P(u) of degree p defined

by n+1 control points ,the number of knots is m+1, We must: 1. Design an uniform knot sequence of m+1 knots: u0 = 0, u1 =

1/m, u2 = 2/m, ..., um = 1. Note that the domain of the curve is [up, un-p].

2. Wrap the first p and last p control points. More precisely, let P0 = Pn-p+1, P1 = Pn-p+2, ..., Pp-2 = Pn-1 and Pp-1 = Pn.

Page 116: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Closed B-Spline Curves Example. Figure (a) shows an open B-spline curve of degree

3 defined by 10 (n = 9) control points and a uniform knot vector.

In the figure, control point pairs 0 and 7, Figure (b), 1 and 8, Figure (c), and 2 and 9, Figure (d) are placed close to each other to illustrate the construction.

a

Page 117: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

Closed B-Spline Curves

a b

c d

Page 118: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

B-Spline CurvesImportant Properties

Page 119: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

B-Spline Curves Important Properties1. B-spline curve C(u) is a piecewise curve with each component a curve of degree p.

◌Example: where n = 10, m = 14 and p = 3, the first four knots and last four knots are clamped and the 7 internal knots are uniformly spaced. There are 8 knot spans, each of which corresponds to a curve segment.

Clamped B‐Spline Curve Bézier Curve (degree 10!)

Page 120: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

B-Spline Curves Important Properties2. Equality m = n + p + 1 must be satisfied.

3. Clamped B-spline curve C(u) passes through the two end control points P0 and Pn.

4. Strong Convex Hull Property: A B-spline curve is contained in the convex hull of its control polyline.

Page 121: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

B-Spline Curves Important Properties5. Local Modification Scheme: changing the position of

control point Pi only affects the curve C(u) on interval [ui, ui+p+1).

The right figure shows the result of moving P2 to the lower right corner. Only the first, second and third curve segments change their shapes and all remaining curve segments stay in their original place without any change.

Page 122: Dr. Deepak Kumar Room No: 2, Department of Mechanical ...nitjsr.ac.in/course_assignment/ME28ME4607Design of Curves.pdf–The term spline, taken from engineering drawing, where a spline

B-Spline Curves Important Properties A B-spline curve of degree 4 defined by 13 control points and 18 knots . Move P6. The coefficient of P6 is N6,4(u), which is non-zero on [u6, u11). Thus, moving

P6 affects curve segments 3, 4, 5, 6 and 7. Curve segments 1, 2, 8 and 9 are not affected.