Chapter12A
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
5
That passes through 4 points (u 1)(u 2)(u 3) (u 0)(u 2)(u 3) p(u ) P0 P1 (0 1)(0 2)(0 3) (1 0)(1 2)(1 3) (u 0)(u 1)(...) (...) (...) (...) P2 P3 (2 0)(2 1)(...) (...) (...) (...)
First derivative of p(u) (the tangent of the curve)
n 1 dp(u ) p' (u ) n bn1,i (u )(Pi 1 Pi ) du i 0
19
Key steps in the derivation of p(u)
x
g1(u) g0(u)
u0
u1
u2 u 3
...
u ui 1 u ui g i (u ) xi xi 1 ui ui 1 ui 1 ui
Adjacent line segments are continuous, but not the slopes
8
Quadratic splines The curve is approximated with quadratic polynomials. Adjacent segments are continuous. Their slopes (1st derivative) at the junction are equal too.
x = p(u) = a + b u + cu2
3
Lagrange polynomials
that passes through two points (u0, x0), (u1, x1)
u u0 u u1 x x0 x1 u0 u1 u1 u0
that passes through three points (u0, x0), (u1, x1), (u2,ቤተ መጻሕፍቲ ባይዱx2),
qi-1(u)
qi(u)
qi-1(ui) = qi(ui)
ui
qi-1(ui) = qi(ui)
Cubic splines
The curve is approximated with cubic polynomials. Adjacent segments are continuous. Their slopes are continuous too. So are their 2nd derivatives. Cubic splines look smoother than quadratic splines
chapter12a chapter12 curves surfacescurves straightline segments curves defined using functions: ellipses, parabola, cos(u), rationalfunctions, curvesdefined via control points: polynomials passthrough pointspiecewise polynomials (cubic splines), bziercurves b-splines non-uniform rational b-splines (nurbs) 1012 14 16 18 20 -3 -2 -1 polynomialsgiven points,fit thdegree polynomial passesthrough quadraticpolynomial passesthrough givenpoints lagrangepolynomials passesthrough two points passesthrough three points lagrangepolynomials verticestwo points three points passesthrough pointswhen large,say, inefficient.undesirable oscillations often occur highdegree polynomials thdegree polynomial moredesirable curve splines(piecewise polynomials) constant splines goesthrough horizontallines degreepolynomials) discontinuous,ie, linearsplines straightlines (1st degree polynomials) adjacent line segments quadraticsplines quadraticpolynomials. adjacent segments stderivative) equaltoo. cubicsplines cubicpolynomials. adjacent
9
qi-1(u)
qi(u) ui
qi-1(ui) = qi(ui)
qi-1 (ui) = qi (ui) qi-1(ui) = qi(ui)
10
Bé Curves zier
P1 P1
P0
P0
P2
Bé Curve zier
P3 P2
P1
P2
P1
P1
P3 P0 P0 P2 P0 P3
11
P3
18
Characteristics of Bé curves (Continued) zier
bn,i(u) reaches maximum when u = i / n . Find the first derivative of bn,i(u) . Set it to zero. Solve the equation.
1
Chapter 12 Curves and Surfaces
Curves are approximated with straight line segments Curves defined using functions: ellipses, parabola, cos(u), e-u, rational functions, …
Curves defined via control points:
Polynomials that pass through the points Piecewise polynomials (cubic splines), … Bé curves zier B-splines Non-Uniform Rational B-Splines (NURBS)
(u u0 )(u u2 ) (u u0 )(u u1 ) (u u1 )(u u2 ) x x0 x1 x2 (u0 u1 )(u0 u2 ) (u1 u0 )(u1 u2 ) (u2 u0 )(u2 u1 )
4
Lagrange polynomials on vertices
g2(u)
x
g1(u)
g0(u) u0 u1
g3(u)
u2 u3
...
qi(u) = ui . qi(u)s are discontinuous, ie, qi(ui) qi+1(ui).
7
Linear splines The curve is approximated with straight lines (1st degree polynomials)
n 0 n n 1 n1 n i n i n n 0 (a b) a b a b a b a b 0 1 i n
n
bn,i(u) is the ith term of (u + (1-u) )n.
b3, 0 (u ) 1 3u 3u u
2
16
3
b3,1 (u ) 3u 6u 2 3u 3 b3, 2 (u ) 3u 2 3u 3 b3,3 (u ) u 3 In mat rixnot at ion, x0 x b3,3 1 x2 x3 0 3 6 3 y0 y1 y2 y3 0 0 3 3 z0 z1 z2 z3 0 x0 0 x1 0 x2 1 x3 y0 y1 y2 y3 z0 z1 z2 z3
0 0
u
When u 0, b2,0(u) is dominant. When u 1/2, b2,1(u) is dominant. When u 1, b2,2(u) is dominant. For 0 u 1, b2,0(u) + b2,1(u) + b2,2(u) = 1.
2
Polynomials
Given k + 1 points, fit a kth degree polynomial that passes through the points.
x
20 18 16 14 12 10 8 6 4 2 0 0 1 2 3 4 5 6
-3
-2
-1
u
A quadratic polynomial that passes through 3 given points
P2
P1
P 0 P5
P4
Two points p(u) = (1 - u) P0 + u P1 , 0 u 1 p(u) = b1,0(u) P0 + b1,1(u) P1
1 b1,0(u) b1,1(u) P0
12
P1
u=1
u=0
0 0
u
1
When u 0, b1,0(u) is dominant. When u 1, b1,1(u) is dominant. For 0 u 1, b1,0(u) + b1,1(u) = 1.
x
y
z b3, 0
b3,1
b3, 2
x
y
z 1
u
u2
1 3 u3 3 1
17
Characteristics of Bé curves zier
For 0 u 1, bn,0(u) + bn,1(u) + … + bn,n(u) = 1.
Three points p(u) = (1 - u)2 P0 + 2 (1-u) u P1 + u2 P2 , 0 u 1 p(u) = b2,0(u) P0 + b2,1(u) P1+ b2,2(u) P1
1
P1 b2,
0
13
b2,1
b2,2 u = 1/2 P0 1 u=0 P2 u=1
Bernstein polynomials
Eg, for n = 3,
3 0 b3, 0 (u ) u (1 u ) 3 (1 u ) 3 1 3u 3u 2 u 3 0 3 1 b3,1 (u ) u (1 u ) 2 3u (1 u ) 2 3u 6u 2 3u 3 1 3 2 b3, 2 (u ) u (1 u )1 3u 2 (1 u ) 3u 2 3u 3 2 3 3 b3,3 (u ) u (1 u ) 0 u 3 3
Two points
x x0 x1 u 1 u 0 y y0 y1 z 0 1 z 1 0 z 0 1 p(u ) u 1 u 0 P0 P1 0 1 1 0
When k is large, say, 4, 5 or beyond, this approach is inefficient. Undesirable oscillations often occur in high degree polynomials A 5th degree polynomial
P1 P0 u=1
u=0
Three points
p(u) (u 1)(u 2) (u 0)(u 2) (u 0)(u 1) P0 P1 P2 (0 1)(0 2) (1 0)(1 2) (2 0)(2 1)
P1 P2 u=2
u=1
P0 u=0
A more desirable curve
6
Splines (piecewise polynomials)
Constant splines The curve that goes through the points is approximated with horizontal lines (0 degree polynomials)
14
In general, given n+1 points, P0, P1, P2, …, Pn
p(u) = bn,0(u) P0 + bn,1(u) P1+ bn,2(u) P2+ …+ bn,n(u) Pn , 0 u 1
n i bn,i (u) u (1 u ) ni i
15
b3, 0 (u ) 1 3u 3u 2 u 3 b3,1 (u ) 3u 6u 2 3u 3 b3, 2 (u ) 3u 2 3u 3 b3,3 (u ) u 3 In our not at ion, p (u ) b3, 0 P0 b3,1P1 b3, 2 P2 b3,3 P3 p (u ) is appliedt o comput ex, y and z separat ely x(u ) b3, 0 x0 b3,1 x1 b3, 2 x2 b3,3 x3 y (u ) b3, 0 y0 b3,1 y1 b3, 2 y2 b3,3 y3 z (u ) b3, 0 z0 b3,1 z1 b3, 2 z 2 b3,3 z3