Spline, Bezier, B-Spline - BCA Galgotias University

Super Quadratic
• This class of objects is a generalization of
the quadric representations. Super-quadrics
are formed by incorporating additional
parameters into the quadric equations to
provide increased flexibility for adjusting
object shapes.
• The number of additional parameters used is
equal to the dimension of the object: one
parameter for curves and two parameters for
surfaces.
• Superellipse
• We obtain a Cartesian representation for a
super ellipse from the corresponding
equation for an ellipse by allowing the
exponent on the x and y terms to be
variable
Superellipsoid
• A Cartesian representation for a
Superellipsoid is obtained from the equation
for an ellipsoid by incorporating two
exponent parameters:
(Spline, Bezier, B-Spline)
Contents
• Today we are going to look at Bézier spline
curves
–
–
–
–
Introduction to splines
Bézier origins
Bézier curves
Bézier cubic splines
Spline
• Drafting terminology
– Spline is a flexible strip that is easily flexed to
pass through a series of design points (control
points) to produce a smooth curve.
• Spline curve – a piecewise polynomial
(cubic) curve whose first and second
derivatives are continuous across the
various curve sections.
• A spline is a smooth curve
defined mathematically
using a set of constraints
• Splines have many uses:
–
–
–
–
2D illustration
Fonts
3D Modelling
Animation
“Manifold Splines”, X. Gu,
Y. He & H. Qin, Solid and
Physics Modeling 2005.
Spline Representations
ACM © 1987 “Principles of
traditional animation applied
to 3D computer animation”
Physical Splines
• Physical splines are used in car/boat design
Pierre Bézier
Big Idea
• User specifies control points
• Defines a smooth curve
Curve
Control
Points
Control
Points
Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)
Interpolation Vs Approximation
• A spline curve is specified using a
set of control points
• There are two ways to fit a curve to
these points:
– Interpolation - the curve passes
through all of the control points
– Approximation - the
curve does not pass
through all of the control
points
– Approximation for structure or shape
– Interpolation for animation
Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)
Convex Hulls
• The boundary formed by the set of control points
for a spline is known as a convex hull
• Think of an elastic band stretched around the
control points
Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)
Control Graphs
• A polyline connecting the control points in
order is known as a control graph
• Usually displayed to help designers keep
track of their splines
Continuity
Continuity
• Parametric (make matching of parametric
derivatives at joining points of two curves)
• Zero order ( points of both curves are same ,
Values of x ,y ,z are same at u1, u2)
• One order ( points are not same but First
Derivative at joining point (tangent) are same
dy/dx or first derivates are same)
• Second order (First & Second order derivates are
same )
Continuity…..
• Geometric
• Zero order- same as parametric (values of
x,y,z for both curves are same at joining
• One order- derivates are proportional at
inter section
• Second order both first & second derivates
are proportional
Bézier Spline Curves
• A spline approximation method developed
by the French engineer Pierre Bézier for use
in the design of Renault car bodies
• A Bézier curve can be fitted to any number
of control points – although usually 4 are
used
Spline specifications
•
•
•
•
•
Three equivallent methods for specify spline representations
Set of boundary conditions
Matrix of spline
Set of blending (basis ) function
Suppose we have parametric cubic polynomial representation
for x coordinate(x(0), x(1), x’(0), x’(1) )
• These four boundary points are used find ax,bx,cx,dx and
matrix
Spline specification
Spline specification
Bezier curve
• Developed by Paul de Casteljau (1959) and
independently by Pierre Bezier (1962).
• French automobil company – Citroen &
Renault.
P1
P0
P2
P3
Bezier curves
• This spline method was developed by P
Bezier
• Bezier spline is useful and convenient for
curves and sufaces(set of curves)
• Used in CAD
• Bezier curves can be fitted to any nmbers of
control points,CP determins the dgree of
bezier polynomials (n points then terms in
poly is n+1 & degree is n
Parametric function
n
• P(u) =  Bn,i(u)pi
i=0
Where
Bn,i(u) = . n!. ui(1-u)n-i
i!(n-i)!
0<= u<= 1
For 3 control points, n = 2
P(u) = (1-u)2p0 + 2u(1-u) p1+ u2p2
For four control points, n = 3
P(u) = (1-u)3p0 + 3u(1-u) 2 p1 + 3u 2 (1-u)p2 + u3p3
algorithm
• De Casteljau
A
– Basic concept
C
B
• To choose a point C in line segment AB such that C
divides the line segment AB in a ratio of u: 1-u
P1
20
00
10
P0
Let u = 0.5
u=0.25
u=0.75
11
01
21
P2
properties
• The curve passes through the first, P0 and last
vertex points, Pn .
• The tangent vector at the starting point P0 must be
given by P1 – P0 and the tangent Pn given by Pn –
Pn-1
• This requirement is generalized for higher
derivatives at the curve’s end points. E.g 2nd
derivative at P0 can be determined by P0 ,P1 ,P2 (to
satisfy continuity)
• The same curve is generated when the order of the
control points is reversed
Properties (continued)
• Convex hull
– Convex polygon formed by connecting the
control points of the curve.
– Curve resides completely inside its convex hull
Bézier Curves (cont…)
• Consider the case of n+1 control points
denoted as pk=(xk, yk, zk) where k varies
from 0 to n
• The coordinate positions are blended to
produce the position vector P(u) which
describes the path of the Bézier polynomial
function between
p
and
p
0
n
n
P(u )   pk BEZ k ,n (u ),
k 0
0  u 1
Bézier Curves (cont…)
• The Bézier blending functions BEZk,n(u)
are the Bernstein polynomials
k
n k
BEZ k ,n (u)  C(n, k )u (1  u)
• where parameters C(n,k) are the binomial
n!
coefficients
C (n, k ) 
k!(n  k )!
Bézier Curves (cont…)
• So, the individual curve coordinates can be
given as follows n
x(u )   xk BEZ k ,n (u )
k 0
n
y (u )   yk BEZ k ,n (u )
k 0
n
z (u )   zk BEZ k ,n (u )
k 0
Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)
Bézier Spline Curves (cont…)
Important Properties Of Bézier
Curves
• The first and last control points are the first
and last point on the curve
– P(0) = p0
– P(1) = pn
• The curve lies within the convex hull as the
Bézier blending functions are all positive
and sum to 1 n
 BEZ
k 0
k ,n
(u )  1
Bezier surface
• TWO Set of orthogonal bezier curves, used to
design surface of objects, parametric vector
function for bezier surface is formed as
Cartesian product of bezier blending functions
for curves
Bezier surface
• with pjk specifying the location of the (m + 1 ) by
(n + 1 ) control points.
• Figure illustrates two bezier surface plots. The
control points are connected by dashed lines, and
the solid lines show curves of constant u and
constant v. Each curve of constant u is plotted by
varying v over the interval from 0 to 1, with u
fixed at one of the values in this unit interval.
Curves of constant v are plotted similarly
Bezier surface
Bezier surface
Bezier surface