ME/MF F342:
Computer Aided Design
M4-4-Synthetic Surfaces
Patches: Bezier & B-spline
patches
BITS Pilani Dr. Srinivasa Prakash Regalla
Hyderabad Campus Department of Mechanical Engineering
Different Synthetic Surface
Patches
Bezier rectangular patch
Bezier triangular patch
BITS Pilani, Hyderabad Campus
TENSOR PRODUCT BEZIER
SURFACE PATCH Control •TOPOLOGICALLY
polyhedron or RECTANGULAR SURFACE
Control surface PATCH
•Different degrees are
possible in u and v
directions
For example:
(n+1) = 4: Cubic in
u-direction
(m+1) = 5:
Quadric in v-
Notation for control points
direction
is now different from
bicubic Hermite patch
n m
P(u, v) Pij Bi ,n (u )B j ,m (v), 0 u 1, 0 v 1
i 0 j 0
Special Case:
Same degree in both
directions:
(n+1) = (m+1) = 4
I/C, Regalla Srinivasa Prakash 4
AERO-FOIL MODEL USING TENSOR
PRODUCT BEZIER SURFACE PATCH
Delaunay triangulated net of Bezier curves
The control surface or polyhedron
The surface patch
EDGES
(BEZIER
CURVES)
I/C, Regalla Srinivasa Prakash 5
PARAMETRIC EQUATION OF BEZIER SURFACE PATCH
n m
P(u, v) Pij Bi ,n (u )B j ,m (v), 0 u 1, 0 v 1
i 0 j 0
•The surface interpolates the four corner
control points. Verify by substituting (u, v)
as (0, 0), (0, 1), (1, 0) and (1, 1).
•The surface is tangent to the corner
segments of the control polyhedron.
•As is true for the Bezier curve segment, the
tangent vectors at the corners become
specific values as below.
•patch, the suffixes mean the number of
control points only .
Pu 00 nP10 P00 Pun 0 nPn 0 Pn 10 Along v 0 edge
Pu 0 m nP1m P0 m Punm nPnm Pn 1m Along v 1 edge
Pv 00 mP01 P00 Pv 0 m mP0 m P0m 1 Along u 0 edge
mRegalla
Pvn 0 mPn1 Pn 0 Pvnm I/C, Pn m1 Prakash
Pnm Srinivasa Along u 1 edge 6
A closed Bezier surface patch is obtained by closing either u=0 &
u=1 edges or v=0 & v=1 edges.
CLOSED BEZIER CURVE (CLOSED
ALONG THE V-EDGES)
CLOSED BEZIER CURVE (CLOSED
ALONG THE U-EDGES)
I/C, Regalla Srinivasa Prakash 7
•The Bezier surface has convex hull property.
•The convex hull is the polyhedron formed by
connecting all control points to all control
points.
•The shape of the Bezier patch can be
modified by either moving the control points
or providing multiple control points at the
same coordinate location.
•The normal vector can be obtained by: N = PuPv
n m Bi ,n (u ) n m Bl ,m (v)
N (u, v) Pij B j ,m (v) Pkl Bk ,n (u )
i 0 j 0 u k 0 l 0 v
n m n m Bi ,n (u ) Bl ,m (v)
B j ,m (v)Bk ,n (u ) Pij Pkl
i 0 j 0 k 0 l 0 u v
I/C, Regalla Srinivasa Prakash 8
C0 CONTINUITY
C1 CONTINUITY
CONTINUITY
REQUIREMENTS OF
BEZIER PATCHES AT
BLENT EDGES
I/C, Regalla Srinivasa Prakash 9
It is possible to express the Bezier patch equation in matrix
form for generic situation of (n+1) by (m+1) control points.
P00 P01 P0 m B0,m (u )
P
P11 P1m B1,m (u )
P(u, v) B0,n (u ) B1,n (u ) Bn ,n (u ) 10
Pn 0 Pn1 Pnm Bm,m (u )
P (u, v) U M B P M B V
T T
Review question:
WHAT IS THE [B] MATRIX OF THE BICUBIC BEZIER PATCH
EQUIVALENT TO THE HERMITE BICUBIC PATCH?
Hint: use the tangent vector information required for Bicubic Hermite patch
from the control point information of the Bezier curve.
I/C, Regalla Srinivasa Prakash 10
Availab;e: Bicubic Bezier patch: P00 P01 P02 P03
P10 P11 P12 P13
P(u,v)=[U]T[MB][P][[MB]T[V] [ P]
P 20
Required: P30 P33
P(u, v) [U ]T [ M H ][ B][ M H ]T [V ], 0 u 1, 0 v 1
P00 P01 Pv 00 Pv 01
P P11 Pv10 Pv11 [ P] [ Pv ]
[ B]
10
Pu 00 Pu 01 Puv 00 Puv 01 [ Pu ] [ Puv ]
Pu10 Pu11 Puv10 Puv11
[U]T[MH][B][[MH]T[V]= [U]T[MB][P][[MB]T[V]
[B] =[MH]-1[MB][P][[MB]T[[MH]T]-1
BITS Pilani, Hyderabad Campus
TRIANGULAR PATCHES
• Necessary when:
– The given surface data points form triangle
– Given surface cannot be modeled entirely by rectangular patches and may
required some triangular patches also
• Three parameters u, v, and w are used, of which only two are independent
• The parametric domain is defined by a symmetric unit triangle of 0u1,
0v1, 0w1
• The parameters u, v and w are called barycentric coordinates:
u+v+w=1 at any point on the patch
• Thus, w is not independent; used only to maintain the symmetry of
barycentric coodinates
Z
P(0,1,0)
w
u
(0,1,0)
u=0 w=0
u=0 w=0
P(ui, vj, wk)
v
v
(1,0,0)
v=0
w (0,0,1) v=0
u P(1,0,0)
P(0,0,1)
Each point in u-v-w space defines
Y one and only one point on the
triangular Bezier surface patch
X
13
Z
Formulation of Triangular Patches
Similar to the tensor product rectangular patches
For example, a triangular Bezier patch is defined as:
P(u, v, w) Pijk Bi, j ,k ,n (u, v, w), 0 u 1, 0 v 1, 0 w 1
i , j ,k
where i, j , k 0, and i j k n and n degree of the patch.
The Bi,j,k,n are the Bernstein polynomials of degree n:
P031 P040
n! i j k
Bi , j ,k ,n uv w v=1
i! j!k! P022 P130
Pi , j ,k Control points P121
P112 P220
The Pi,j,k define the P013
P211
control polyhedron
P103 P310
P004 P202 P301 P u=1
w=1 400
Number of control points for Triangular Patches
The number of control points required for an nth degree
triangular Bezier patch is: (n 1)(n 2)
2
The triangular Bezier patch must have the same degree in
all u, v and w directions, unlike the rectangular Bezier
patch P(0,1,0)
w
u
u=0 w=0
P(ui, vj, wk)
v
v
v=0
w
u P(1,0,0)
P(0,0,1)
Exercise:
How many control points are required to define (a) quadratic,
(b) cubic, and (c) quartic Bezier surface patches?
Solution :
(a) Quadratic : n 2; (n 1)(n 2)/2
(2 1)(2 2)/2 6
(b) Cubic : n 3; (3 1)(3 2)/2 10
(c) Quartic : n 4; (4 1)(4 2)/2 15
Quartic triangular Bezier patch
BITS Pilani, Hyderabad Campus
FINDING THE BASIS POLYNOMIAL
FUNCTIONS IN THE TRINGULAR BEZIER
PATCH BY MEANS OF PASCAL’S TRIANGLE
Degree n=4 v4
4uv3
4v3w
12uv2w
6v2w2 6u2v2
n! i j k
Bi , j ,k ,n uv w
i! j!k! 12uvw2 12u2vw
4vw3 4u3v
Pi , j ,k Control points
Rule : i j k n
w4 6u2w2 4u3w u4
4uw3
PASCAL’S TRIANGLE FOR QUARTIC (n=4) PATCH
Exercise:
Find the parametric equation of a quadratic Bezier
triangular patch for the following control points in that
order. Find the point at u=0.3 and v=0.6.
Control points: [8,6,5]; [7,74,6];[6,8,8];[4,3,3];[[1,1,1]; [3,3,4]
Solution: Quadratic means n=2. Number of control points
required = (n+1)*(n+2)/2 = (2+1)*(2+2)/2=6.
P(u, v, w) Pijk Bi, j ,k ,n (u, v, w), 0 u 1, 0 v 1, 0 w 1
i , j ,k
P200 B2,0,0, 2 P110 B1,1,0, 2 P020 B0, 2,0, 2 P101B1,0,1, 2 P002 B0,0, 2, 2 P011B0,1,1, 2
n! i j k
Bi , j ,k ,n uv w
i! j!k!
BITS Pilani, Hyderabad Campus
Contd.
P(u, v, w) Pijk Bi, j ,k ,n (u, v, w), 0 u 1, 0 v 1, 0 w 1
i , j ,k
P200 B2,0,0, 2 P110 B1,1,0, 2 P020 B0, 2,0, 2 P101B1,0,1, 2 P002 B0,0, 2, 2 P011B0,1,1, 2
B2,0,0,2={2!/(2!0!0!)}*u^2*v^0*w^0 = u2. n! i j k
Bi , j ,k ,n uv w
B1,1,0,2={2!/(1!1!0!)}*u^1*v^1*w^0 = 2uv. i! j!k!
P020
B0,2,0,2={2!/(0!2!0!)}*u^0*v^2*w^0 = v2.
P011
B1,0,1,2={2!/(1!0!1!)}*u^1*v^0*w^1 = 2uw. P110
B0,0,2,2={2!/(0!0!2!)}*u^0*v^0*w^2 = w2.
P101
B0,1,1,2={2!/(0!1!1!)}*u^0*v^1*w^1 = 2vw. P002 P200
P(u,v,w)=u^2*[8,6,5]+2*u*v*[7,74,6]+v^2*[6,8,8]+2*u*w*[4,3,3]+w^2*[[1,1,1]+2*v*w*[3,3,4]
P(0.3,0.6,0.1)=0.3^2*[8,6,5]+2*0.3*0.6*[7,74,6]+0.6^2*[6,8,8]+2*0.3*0.1*[4,3,3]+0.1^2*[1,1,
1]+2*0.6*0.1*[3,3,4] = [6.01, 30.61, 6.16]
BITS Pilani, Hyderabad Campus
B-SPLINE SURFACE PATCH
n m
P(u, v) Pij N i ,k (u )N j ,l (v),
i 0 j 0
0 u umax , 0 v vmax
•LOCAL CONTROL IS POSSIBLE
•ALL OTHER PROPERTIES OF B-SPLINE CURVES APPLY
•KNOT VECTORS IN THE TWO PARAMETRIC DIRECTIONS CAN
DIFFER
•COMPOSITE B-SPLINE SURFACES CAN BE OBTAINED BY
BLENDING PATCHES WITH C0 AND C1 CONTINUITY IN THE SAME
WAY AS BEZIER PATCHES
I/C, Regalla Srinivasa Prakash 20
COONS surface patch
I/C, Regalla Srinivasa Prakash 21
Linear Coons Surface
• The linear Coons surface is
the simlest of all Coons
surfaces; a more general P(u,1)
Coons surface is possible P(1,v)
• The linear Coons surface is P(0,v)
obtained from four boundary
curves, P(u,0), P(u,1), P(0,v) P(u,0)
and P(1,v)
• The above four boundary
curves are blended by a
bilinear blending function for
interior of surface patch
I/C, Regalla Srinivasa Prakash 22
• The linear Coons surface is normally said
to be obtained by
* Summing up of two ruled surfaces in the u
and v directions.
P(u,1)
• Is this correct? P(1,v)
P(0,v)
• No…Why?
P(u,0)
• Let us see.
I/C, Regalla Srinivasa Prakash 23
Consider the linear Coons surface patch being obtained by
simple summing up of two ruled surfaces obtained by using
the opposite boundary curves as rails. Indeed,
P(u , v) P(u ,0)(1 v) P(u ,1)v P(0, v)(1 u ) P(1, v)u
if we substitute the boundary conditions, we should get
the corner points and boundary curves from this parametric
form.
Will we obtain P00 if we substitute u 0 and v 0?
P(0,0) P(0,0) P(0,0) 2 P00 .......... so No.
also at the edge u 0,
P(0, v) P(0,0)(1 v) P(0,1)v P(0, v)
which is not P(0, v).
Neither result correspond s to the original data. Why?
I/C, Regalla Srinivasa Prakash 24
• Because, the corner points are counted
twice, as P(0,0) is contained in both the
P(u,0) and P(0,v) boundary curves.
• The correct result is obtained by
subtracting the excess contribution to the
surface due to duplication of the corner
points.
P(0,v)
Or
u=0
P00 P(u,0) Or v=0
I/C, Regalla Srinivasa Prakash 25
• The correct result is obtained by subtracting the
excess contribution to the surface due to duplicatio
of the corner points. Indeed, this yields,
P(u , v) P(u,0)(1 v) P(u ,1)v P(0, v)(1 u ) P(1, v)u
P(0,0)(1 u )(1 v) P(0,1)(1 u )v
P(1,0)u (1 v) P(1,1)uv
Now, if we substitute the boundary conditions at the corner points
and boundary edges we get the original data.
At u 0 and v 0, P(0,0) P00 , etc.
At u 0 and v 1, the edges will become P(0, v) and P(u,1),
respectively.
In matrix form,
P(0, v) 1 v
P(u, v) [1 u u ] P(u,0) P(u,1)
P (1, v ) v
P(0,0) P(0,1) 1 w
[1 u u ] w
P (1 ,0 ) P (1,1)
or more compactly as
P(0,0) P(0,1) P(0, v) 1 v
P(u, v) [1 u u 1] P(1,0) P(1,1) P(1, v) v
P(u,0) P(u,1) 0 1
The functions (1- u), u, (1- v) and v are called blending functions
because they blend the boundary curves to produce the internal
shape of the surface.
I/C, Regalla Srinivasa Prakash 27
Example on Linear Coons Surface
• Find the point a linear Coons surface at u=v=0.5 when
the four boundary curves P(u,0), P(u,1), P(0,v) and
P(1,v) are given by open quadratic (k=3) B-spline curves
defined as follows.
• P(u,0): B1[ 0 0 0], B2[1 1 0], B3[2 1 0], B4[3 0 0], B5[3 0 3]
• P(u,1): B1[0 0 3], B2[1 1 3], B3[2 1 3], B4[3 0 0]
• P(0,v): C1[0 0 3], C2[0 1 2], C3[0 1 1], C4[0 0 0]
• P(1,v): C1[3 0 3], C2[3 1 2], C3[3 1 2], C4[3 1 1], C5[3 0 0]
I/C, Regalla Srinivasa Prakash 28
Solution :
The knot vector for P(u,0) and P(1, v) is t [0 0 0 1 2 3 3 3]
The knot vector for P(u,1) and P(0, v) is s [0 0 0 1 2 2 2]
P(u,0) P(t ) B1 N1,3 (t ) B2 N 2,3 (t ) B3 N 3,3 (t ) B4 N 4,3 (t ) B5 N 5,3 (t )
P(0.5,0) P(1.5) (0) B1 0.125B2 0.75B3 0.125B4 (0) B5
0.1251 1 3 0.752 1 3 0.1252 1 3
[1.875 1 3]
P(u,1) P( s ) B1 N1,3 ( s ) B2 N 2,3 ( s ) B3 N 3,3 ( s ) B4 N 4,3 ( s )
P(0.5,1) P(1.0) (0) B1 0.5B2 0.5B3 (0) B4
0.51 1 0 0.52 1 0 1.5 1 0
P(0, v) P( s ) C1 N1,3 ( s ) C2 N 2,3 ( s ) C3 N 3,3 ( s ) C4 N 4,3 ( s )
P(0,0.5) P(1.0) (0)C1 0.5C2 0.5C3 (0)C4
0.50 1 2 0.50 1 1 0 1 1.5
P(1, v) P(t ) C1 N1,3 (t ) C2 N 2,3 (t ) C3 N 3,3 (t ) C4 N 4,3 (t ) C5 N 5,3 (t )
P(1,0.5) P(1.5) (0)C1 0.125C2 0.75C3 0.125C4 (0)C5
0.1253 1 2 0.753 1 2 0.1253 1 1 3 1 1.875
I/C, Regalla Srinivasa Prakash 29
Now we can find the matrix form of linear Coons surface patch.
P(0,0) P(0,1) P(0, v) 1 v
P(u, v) [1 u u 1] P(1,0) P(1,1) P(1, v) v
P(u,0) P(u,1) 0 1
0 0 3 0 0 0 0 1 1.5 0.5
P(0.5,0.5) [0.5 0.5 1] 3 0 3 3 0 0
3 1 1.875 0.5
1.875 1 3 1.5 1 0 0 1
1.6375 2.25 1.6375
I/C, Regalla Srinivasa Prakash 30
Sculptured surface
• A single patch alone can not build the practically found
complex surfaces in design and manufacturing
• These complex surfaces are called as sculptured or free-
form surfaces
• Typical applications are automotive die and mold
making, aerospace, glass, cameras, shoes, appliance
industries
• Sculptured surface is a colletion of interconnected and
bounded parametric patches together with blending and
interpolation formulas
• The surfaces must be amenable to APT for NC m/c tools
• The sculpturing surface can be divided into the proper
patches which can be created to produce a C0 or C1
continuous surface using the modeling techniques
described till now
I/C, Regalla Srinivasa Prakash 31
Rational parametric surface
• Just like the rational parametric curve, the
rational parametric surface is obtained by
algebraic ratio of two polynomials and using
weight functions. A rational tensor product
surface can be described as
n m
P h F (u) F (v)
i 0 j 0
ij ij i j
P(u, v) n m
h F (u) F (v)
i 0 j 0
ij i j
Rational bicubic, Bezier, and B - Spline surfaces are available
I/C, Regalla Srinivasa Prakash 32
Surface Manipulations: Segmentation
• The process is identical to that of the curve
• Segmentation is essentially a problem of
reparametrization of the surface while keeping
the degree of its polynomial in u and v
unchanged.
• Different requirements of segmentation of a
given surface defined for u=0 to u=um and v=0 to
v=vm exist:
– Four patches at a point P1(u1, v1)
– Two patches by segmentation along u=u1 curve
– Two patches by segmentation along v=v1 curve
I/C, Regalla Srinivasa Prakash 33
Segmentation into four sub-patches
• For sub-patch 1:
u1=u0+(u1-u0)u
v1=v0+(v1-v0)v
• Similar equations can be written for other
sub patches also.
• u1=0 to 1 and v1=0 to 1 correspond to the
proper values
I/C, Regalla Srinivasa Prakash 34
I/C, Regalla Srinivasa Prakash 35
Segmentation into two sub-patches
• Along the u=u1 curve, for the first sub
patch 1:
u1=u0+(u1-u0)u
v1=v0+(vm-v0)v
• Along the v=v1 curve, for the first sub
patch 1:
u1=u0+(um-u0)u
v1=v0+(v1-v0)v
I/C, Regalla Srinivasa Prakash 36
Intersection
• Intersection of surface with curve:
P(u,v) – P(w) = 0
• Three scalar equations in three unknows u, v
and w
• Intersection of surface with surface:
P(u, v) – P(t, w) = 0
Three scalar equation with four unknowns, u, v, t
and w.
One parameter is kept constant and others are
found out.
Newton-Raphson iteration method is very useful.
I/C, Regalla Srinivasa Prakash 37
Projection
• This is projecting an entity onto a plane or
surface
• When we project a point P0 along r on a
planar surface defined as
P(u,v) = a + ub + vc
• We need to solve the above equation and
the equation of the projection line given by
P(w)=P0+wr. That is P(u,v) – P(w) =0.
• Further derivation takes the following form.
I/C, Regalla Srinivasa Prakash 38
P(u, v) P( w) 0
a ub vc P0 wr
Dot multiply both sides of the above equation by (b c) to get
(b c).a (b c).(P0 wr ), since (b c) is perpendicular to both b and c.
Therefore
(b c).(a - P0 )
w
(b c).r
Similarly, we can write for the other parameters,
(c r).(P0 - a)
u
(c r).b
(b r ).(P0 - a)
v
(b r ).c
Similarly, projectionof curves and surfaces onto a given surface can also be solved.
I/C, Regalla Srinivasa Prakash 39
Application of Intersection problem
• Pipeline design needs the knowledge of
intersection of surfaces
Analytical Solution to find area and
perimeter after A and B are found:
Ellipse area a A B
A Half major axis
B Half minor axis
A 2 B2
Ellipse perimeter p 2 4aE
2
where
E the complete elliptic integral at k A 2 B 2 / A.
E can be obtained from the tables I/C,
of complete elliptic
Regalla Srinivasa integrals available
Prakash 40
in standard mathematical tables.