L1 Oe6980 PDF
L1 Oe6980 PDF
L1 Oe6980 PDF
R. Sharma
Professor,
Design and Simulation Laboratory,
Department of Ocean Engineering, IIT Madras, Chennai (TN) - 600 036, India.
E-mails: [email protected]
• Lines.
• Polynomials.
• Lagrange curves.
• Hermite curves.
• Bezier curves.
• B-Splines.
• NURBS.
• Subdivision curves.
• No intuitive insight.
• Difficult for piecewise smooth curves.
• Implicit representation
=0
• Sphere
• Ellipsoid
where u [0,1]
• Consider pi is a curve pi(v)
• In particular, if pi is also a bezier curve, where
v [0,1]
• Then we have
• B-Spline curves
c(u) i0 pi Bi,k (u)
n
R. Sharma
Professor,
Design and Simulation Laboratory,
Department of Ocean Engineering, IIT Madras, Chennai (TN) - 600 036, India.
E-mails: [email protected]
Disadvantages:
• Difficult to maintain and manage inter-patch
smoothness constraints.
• Expensive trimming needed to model features.
• Slow rendering for large models.
Disadvantages:
• Heavy weight representation.
• A simplification algorithm is always needed.
Disadvantages:
• Difficult for analysis of properties like
smoothness and continuity.
• Edge point:
the average of two old vertices and two
new face points of the faces adjacent to the
edge.
• Vertex point:(F 2E (n 3)V ) / n
F: the average of the new face points of all faces
adjacent to the old vertex.
R. Sharma
Professor,
Design and Simulation Laboratory,
Department of Ocean Engineering, IIT Madras, Chennai (TN) - 600 036, India.
E-mails: [email protected]
(a) (b)
(c) (d)
R. Sharma
Professor,
Design and Simulation Laboratory,
Department of Ocean Engineering, IIT Madras, Chennai (TN) - 600 036, India.
E-mails: [email protected]
i 1
x x j
n
f n ( x) F [ x0 , x1 ,..., xi ]
i 0 j 0
f n ( xi ) f ( xi ) for i 0,1,..., n
n
Lagrange Interpolation Formula: f n ( x) f xi i ( x)
i 0
x x
n
i ( x) x x
j 0, j i
j
i j
Lecture notes for OE 6980 8
Lagrange Interpolation
G (x = 0) = f
0 = 1= a0
G (x = 1) = f
1 = 6 = a0 + a1 + a2 + a3
G (x = 2) = f
2 = 17 = a0 + 2a1 + 4a2 + 8a3
G (x = 3) = f
3 = 34 = a0 + 3a1 + 9a2 + 27a3
R. Sharma
Professor,
Design and Simulation Laboratory,
Department of Ocean Engineering, IIT Madras, Chennai (TN) - 600 036, India.
E-mails: [email protected]
• Explicit:
y = mx + b z = A x + By + C
• Implicit:
Ax + By + C = 0 (x – x0)2 + (y – y0)2 – r2 = 0
• Parametric:
x = x0 + (x1 – x0)t x = x0 + rcos
y = y0 + (y1 – y0)t y = y0 + rsin
• Control Points:
– A set of points that influence
the curve’s shape.
• Interpolating curve:
– Curve passes through the
control points.
• Control polygon:
– Control points merely
influence shape.
–
x (t ) = i
a t
i =0
n
• A cubic polynomial
• Polynomial can be specified by the position
of, and gradient at, each endpoint of curve.
• Determine: x = X(t) in terms of x0, x0’, x1,
x1’
Now:
X(t) = a3t3 + a2t2 + a1t + a0
and X/(t) = 3a3t2 + 2a2t + a1
Lecture notes for OE 6980 11
Finding Hermite coefficients
2 1 − 2 1 x0
− 3 − 2 3 − 1 x '
X (t ) = t 3 t 2 t 1
0 1
0
0 0 x1
1 0 0 0 x1 '
We can now define a parametric polynomial for each coordinate
required independently, ie. X(t), Y(t) and Z(t)
2 1 − 2 1 x0
− 3 − 2 3 − 1 x '
X (t ) = t t t 1
3 2
0 1 0
0
0 x1
1 0 0 0 x1 '
= (2t 3 − 3t 2 + 1)x0 + (t 3 − 2t 2 + t )x0 '+ (−2t 3 + 3t 2 )x1 + (t 3 − t 2 )x1 '
y(t)
x(t)
P1
P3
P3
P4
P1
P2
• We compute (x,y,z) by
x( s, t ) = t T . M B .q x . M BT . s
q x is 4 4 array of x coords
y ( s, t ) = t T . M B .q y . M BT . s
q y is 4 4 array of y coords
z ( s, t ) = t T . M B .q z . M BT . s
q z is 4 4 array of z coords
t t t
= [3t 2 ,2t ,1,0]T . M .q. M T .s
Q ( s, t ) Q ( s, t ) = ( y s zt − yt z s , z s xt − zt xs , xs yt − xt y s )
s t
R. Sharma
Professor,
Design and Simulation Laboratory,
Department of Ocean Engineering, IIT Madras, Chennai (TN) - 600 036, India.
E-mails: [email protected]
z=1 plane
3D Bézier curve
Moving a control point (left) differs heavily from changing its weight (right)
Rational Bézier curves
Because they are invariant under
projection the projected curve can be
modeled further
E.g. a car designer may change the
projected car body
Bézier curves are a subset of the
rational Bézier curves
Special case: Equal weights
Rational Bezier curves
Consider the projection of a 3D Bezier curve in to 2D space:
(z=1)
We do this by dividing by z(u) to define a 2D curve R(u):
x(u ) y (u )
R(u ) ( , )
z (u ) x(u )
The 3D curve:
3
Q (u ) PiBi (u )
i 0
Pi ( xi, yi, zi )
Rational Bezier curves (cont.)
Now a special notation is used for writing the 3D control points of a
rational curve in 2D space:
Pi w ( wixi, wiyi, wi )
We write our 3D curve as:
wixi
Q(u ) wiyi Bi (u )
3
i 0
wi
wixiBi (u ) wiyiBi (u )
R(u ) ,
wiBi (u ) wiBi (u )
Rational Bezier curves
We project a 4D curve into 3D space
Each control point is now:
R(u )
w P B (u )
i i i
w B (u) i i
Rational Bezier curves
The effect of changing weight wi
Rational Bezier curves
The different effect of control point movement and weight
adjustment
THANK YOU
R. Sharma
Professor,
Design and Simulation Laboratory,
Department of Ocean Engineering, IIT Madras, Chennai (TN) - 600 036, India.
E-mails: [email protected]
- Note that "without changing the curve's shape" is the key point;
otherwise, just increasing the degree of a Bézier curve does not
make any practical sense.
3
Bezier Curves …………….. Degree Elevation
- Following are formulae for each control points from Q1 to Qn.
4
Bezier Curves …………….. Degree Elevation
- Example 1: We show a Bézier curve of degree 4 whose control
points are shown in red rectangles.
i 1 - i/(n+1)
1 0.8
2 0.6
3 0.4
4 0.2
5
Bezier Curves …………….. Degree Elevation
- Example 2: We show a Bézier curve of degree 4 whose degree is
raised continuously.
6
THANK YOU
R. Sharma
Professor,
Design and Simulation Laboratory,
Department of Ocean Engineering, IIT Madras, Chennai (TN) - 600 036, India.
E-mails: [email protected]
1|Page
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
- Furthermore, if ui is a knot of multiplicity k (i.e., ui = ui+1 = ... = ui+k-1), then knot spans [ui,ui+1),
[ui+1,ui+2), ..., [ui+k-2,ui+k-1) do not exist, and, as a result, Ni,0(u), Ni+1,0(u), ..., Ni+k-1,0(u) are all zero
functions.
- U = {0, 0, 0, 1, 1, 1}. Thus, 0 and 1 are of multiplicity 3 (i.e., 0(3) and 1(3)). For three point case,
n =2 and as a result, m = 5 for p =2 and the knot assignments are:
u0 u1 u2 u3 u4 u5
0 0 0 1 1 1
2|Page
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
3|Page
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
- Analyze N0,2(u): Global, partition of unity, Bezier basis function B02 (u).
4|Page
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
Example 2: Minimum possible value for p = 0. Minimum feasible value for p = 1. Minimum value
for a space curve = 2.
Minimum possible value for n = 0. Minimum feasible value for n = 1. Minimum value for a space
curve = 2.
Minimum possible value for m = 1. Minimum feasible value for n = 3. Minimum value for a space
curve = 5.
- U = {0, 0, 0, 0, 1, 1, 1, 1}. Thus, 0 and 1 are of multiplicity 4 (i.e., 0(4) and 1(4)). For four points
case, n =3 and as a result, m = 7 for p = 3 and the knot assignments are:
u0 u1 u2 u3 u4 u5 u6 u7
0 0 0 0 1 1 1 1
5|Page
B-Spline Basis Functions ………………...………….………………...….... Key Properties
______________________________________________________________________________
- Degree 1. Since p is 1, n = 7 - p - 1 = 5.
6|Page
B-Spline Basis Functions ………………...………….………………...….... Key Properties
______________________________________________________________________________
- Compute for degree 3. And, analyze N0,3(u): Global, partition of unity, Bezier basis function B03 (u).
Analyze N1,3(u): Global, partition of unity, Bezier basis function B 13 (u). Analyze N2,3(u): Global,
partition of unity, Bezier basis function B23 (u). Analyze N3,3(u): Global, partition of unity, Bezier basis
function B33 (u).
7|Page
B-Spline Basis Functions ………………...………….………………...….... Key Properties
______________________________________________________________________________
- U = {0, 0, 0, 0, 0, 1, 1, 1, 1, 1}. Thus, 0 and 1 are of multiplicity 5 (i.e., 0(5) and 1(5)). For five points
case, n =4 and as a result, m = 9 for p = 4 and the knot assignments are:
u0 u1 u2 u3 u4 u5 u6 u7 u8 u9
0 0 0 0 0 1 1 1 1 1
- Compute for degree 4. And, analyze N0,4(u): Global, partition of unity, Bezier basis function B04 (u).
Analyze N1,4(u): Global, partition of unity, Bezier basis function B 14 (u). Analyze N2,4(u): Global,
partition of unity, Bezier basis function B24 (u). Analyze N3,4(u): Global, partition of unity, Bezier basis
function B34 (u). Analyze N4,4(u): Global, partition of unity, Bezier basis function B44 (u).
8|Page
B-Spline Basis Functions ………………...………….………………...….... Key Properties
______________________________________________________________________________
Qs and As …
9|Page
Lecture 18 - OE6980
B-Spline Different Forms and Properties - PART 3
___________________________________________________________________
R. Sharma
Professor,
Design and Simulation Laboratory,
Department of Ocean Engineering, IIT Madras, Chennai (TN) - 600 036, India.
E-mails: [email protected]
1|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
- Closed curves: Many ways to generate closed curves. (1) Wrapping control points or (2) Wrapping
knot vectors.
Wrapping Control Points: Suppose we want to construct a closed B-spline curve C(u) of
degree p defined by n+1 control points P0, P1, ..., Pn. The number of knots is m+1,
where m = n + p + 1. Here is the construction procedure:
- Design an uniform knot sequence of m+1 knots: u0 = 0, u1 = 1/m, u1 = 2/m, ..., um = 1. Note that
the domain of the curve is [up, um-p].
- 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. This is shown in the figure below.
2|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
Wraps: Po = Pn-p+1 = P2; P1 = Pn-p+2 = P3; P2 = Pn-p+3 = P4 ….. up to Pp-1 = Pn. So, [P0, P1, P2, P3, and
P4] becomes [P0, P1, P0, P1, and P2] for a closed curve.
Note: Constructed curve is Cp-1 continuous at the joining point C(up) = C(un-p).
Example 2: 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, 1 and 8, and 2 and 9 are placed close to each other to
illustrate the construction.
- Figure (b) shows the result of making control points 0 and 7 identical. The shape of the curve does
not change very much. Then, control points 1 and 8 are made identical as shown in Figure (c). It is
clear that the gap between the first and last points of the curve is closer. Finally, the curve becomes
a closed on when control points 2 and 9 are made identical as shown in Figure (d).
- Wraps: Po = Pn-p+1 = P7; P1 = Pn-p+2 = P8; P2 = Pn-p+3 = P9 ….. up to Pp-1 = Pn. So, [P0, P1, P2, P3, …
and P9] becomes [P0, P1, P2, P3, P4, P5, P6, P0, P1, P2] for a closed curve.
3|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
(a) (b)
(c) (d)
4|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
Wrapping Control Points: Suppose we want to construct a closed B-spline curve C(u) of
degree p defined by n+1 control points P0, P1, ..., Pn. The following is the construction procedure:
Add a new control point Pn+1 = P0. Therefore, the number of control points is n+2.
Find an appropriate knot sequence of n+1 knots u0, u1, ..., un. These knots are not necessarily
uniform, an advantage over the method discussed above.
Add p+2 knots and wrap around the first p+2 knots: un+1 = u0, un+2 = u1, ..., un+p = up-
1, un+p+1 = up, un+p+2 = up+1 as shown in the following diagram. In this way, we have n+p+2 = (n+1)
+ p + 1 knots.
5|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
The open B-spline curve C(u) of degree p defined on the above constructed n+1 control points
and n+p+2 knots is a closed curve with Cp-1 continuity at the joining point C(u0) = C(un+1). Note that
the domain of this closed curve is [u0, un+1].
Design uo, u1, u2, u3, u4, u5. Add p+2 knots, i.e. 5 more knots.
Starting Criteria un+1 = u0; u6 = u0; u7 = u1; u8 = u2; u9 = u3; u10 = u4. un+p+2 = up+1 (Closing Criteria).
6|P a ge
B-Spline Basis Functions ………………...………….………………...….... Key Properties
______________________________________________________________________________
Qs and As …
7|P a ge
Lecture 19 - OE6980
B-Spline Different Forms and Properties - PART 4
___________________________________________________________________
R. Sharma
Professor,
Design and Simulation Laboratory,
Department of Ocean Engineering, IIT Madras, Chennai (TN) - 600 036, India.
E-mails: [email protected]
1|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
Knot insertion is adding a new knot into the existing knot vector without changing the shape of the
curve.
This new knot may be equal to an existing knot and, in this case, the multiplicity of that knot is
increased by one.
Because of the fundamental equality m = n + p + 1, after adding a new knot, the value of m is
increased by one and, consequently, either the number of control points or the degree of the curve
must also be increased by one.
Changing the degree of the curve due to the increase of knots will change the shape of the curve
globally and will not be considered.
Therefore, inserting a new knot causes a new control point to be added. In fact, some existing control
points are removed and replaced with new ones by corner cutting.
Although knot insertion looks like not very interesting, it is one of the most important algorithms for
B-spline curves since many other useful algorithms are based on knot insertion.
2|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
Left figure below shows a clamped B-spline curve of degree 4 with uniform knots, while the right
figure shows the result after a new knot u = 0.5 is inserted.
Left figure also shows the control polylines before and after the insertion. Note shape of the curve
does not change. However, the defining control polyline is changed. In fact, four new control points
in red replace the original control points P4, P5 and P6.
Suppose the new knot t lies in knot span [uk, uk+1). C(t) lies in the convex hull defined by control
points Pk, Pk-1, ..., Pk-p. Basis functions of all other control points are zero.
3|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
Thus, the knot insertion computation can be restricted on control points Pk, Pk-1, ..., Pk-p.
Inserting t is to find p new control points Qk on leg Pk-1Pk, Qk-1 on leg Pk-2Pk-1, ..., and Qk-p+1 on leg Pk-
pPk-p+1 such that the old polyline between Pk-p and Pk (in black below) is replaced by Pk-pQk-
p+1...QkPk (in orange below) by cutting the corners at Pk-p+1, ..., Pk-1.
All other control points are unchanged. Note that p-1 control points of the original control polyline
are removed and replaced with p new control points.
4|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
5|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
- ai:1-ai is the ratio of dividing interval [ui, ui+p) by the value of t as shown below:
There are k ai's, each of which covers p knot spans (i.e., [ui, ui+p)). If we stack these intervals
together and align them at the value of t, we have the following diagram:
Therefore, the position of t divides knot spans [uk, uk+p), [uk-1, uk+p-1), ..., [uk-p+1, uk+1) into ratios ak, ak-
1, ...,, ak-p+1, which, in turn, provide the ratios for dividing legs PkPk-1, Pk-1Pk-2, ... Pk-pPk-p+1.
6|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
u0 to u3 u4 u5 u6 u7 u8 to u11
0 0.2 0.4 0.6 0.8 1
Since t = 0.5 lies in knot span [u5,u6), the affected control points are P5, P4, P3 and P2.
To determine the three new control points Q5, Q4 and Q3, we need to compute a5, a4 and a3 as
follows:
7|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
New control polyline becomes P0, P1, P2, Q3, Q4, Q5, P5, ...., and the new knot vector is:
u0 to u3 u4 u5 u6 u7 u8 u9 to u12
0 0.2 0.4 0.5 0.6 0.8 1
Since the original B-spline curve has p = 3 and m = 11, we have n = m - p - 1 = 11 - 3 - 1 = 7 and
hence 8 control points.
8|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
- Following is a B-spline curve satisfying this condition and its basis functions:
- Three blue rectangles are Q3, Q4 and Q5. After inserting t = 0.5, the corners at P3 and P4 are cut,
yielding the following B-spline curve and its basis functions. Note that the shape of the curve does
not change:
9|P a ge
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
- Relationship between the old and new control points. Note that the new set of control points
contains P0, P1, P2, Q3, Q4, Q5, P5, P6 and P7.
10 | P a g e
B-Spline ………………….…………………………………….... Different Forms and Properties
______________________________________________________________________________
Insert a new knot t = 0.5, which is equal to an existing one (i.e., t = u8 = 0.5). B-spline curve of degree
4 and its basis functions before the new knot t is inserted.
NOTE t is in [u8,u9), the affected control points are P8, P7, P6, P5 and P4.
11 | P a g e
B-Spline ………………….………………………………………. Different Forms and Properties
______________________________________________________________________________
12 | P a g e
B-Spline ………………….………………………………………. Different Forms and Properties
______________________________________________________________________________
NOTE New control point Q8 is equal to the original control point P7. In fact, if t is equal to a knot,
say uk, then:
Consequently, we have
Guideline: If the new knot t to be inserted is equal to an existing simple knot uk, then Qk, the
last new control point, is equal to Pk-1.
Computation scheme:
13 | P a g e
B-Spline ………………….………………………………………. Different Forms and Properties
______________________________________________________________________________
Note that the new control points are P0, P1, P2, P3, P4, Q5, Q6, Q7, Q8 = P7, P8, P9, P10 and P11.
Curve and its basis functions after the new knot t = 0.5 is inserted are shown below.
14 | P a g e
B-Spline ………………….………………………………………. Different Forms and Properties
______________________________________________________________________________
Hence, we have s consecutive equal knots: uk = uk-1 = uk-2 = .... = uk-s+1 and uk-s+1 being not equal
to uk-s.
15 | P a g e
B-Spline ………………….………………………………………. Different Forms and Properties
______________________________________________________________________________
- Hence, coefficients ak, ...., ak-p+1 are all zero and, consequently, we have:
- This shows that if the new knot t is inserted at a knot uk of multiplicity s, then the last s new
control points, Qk, Qk-1, ..., Qk-s+1 are equal to the original control points Pk-1, Pk-2, ..., Pk-s.
- If s = 1 (i.e., simple knot), Qk is equal to Pk-1, which is exactly what is discussed in Example 2.
- If s = 0 (i.e., t is not a knot), then all control points from Pk-p to Pk are involved.
16 | P a g e
B-Spline ………………….………………………………………. Different Forms and Properties
______________________________________________________________________________
- Computation scheme:
17 | P a g e
B-Spline Basis Functions ………………...………….………………...….... Key Properties
______________________________________________________________________________
Qs and As …
18 | P a g e