1 Dr. Scott Schaefer Smooth Curves
2/109 Smooth Curves Interpolation Interpolation through Linear Algebra Lagrange interpolation Bezier curves B-spline curves
3/109 Smooth Curves How do we create smooth curves?
4/109 Smooth Curves How do we create smooth curves? Parametric curves with polynomials
5/109 Smooth Curves Controlling the shape of the curve
6/109 Smooth Curves Controlling the shape of the curve
7/109 Smooth Curves Controlling the shape of the curve
8/109 Smooth Curves Controlling the shape of the curve
9/109 Smooth Curves Controlling the shape of the curve
10/109 Smooth Curves Controlling the shape of the curve
11/109 Smooth Curves Controlling the shape of the curve
12/109 Smooth Curves Controlling the shape of the curve
13/109 Smooth Curves Controlling the shape of the curve
14/109 Smooth Curves Controlling the shape of the curve Power-basis coefficients not intuitive for controlling shape of curve!!!
15/109 Interpolation Find a polynomial that passes through specified values
16/109 Interpolation Find a polynomial that passes through specified values
17/109 Interpolation Find a polynomial that passes through specified values
18/109 Interpolation Find a polynomial that passes through specified values
19/109 Interpolation Find a polynomial that passes through specified values Intuitive control of curve using “control points”!!!
20/109 Interpolation Perform interpolation for each component separately Combine result to obtain parametric curve
21/109 Interpolation Perform interpolation for each component separately Combine result to obtain parametric curve
22/109 Interpolation Perform interpolation for each component separately Combine result to obtain parametric curve
23/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
24/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
25/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
26/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
27/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
28/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
29/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
30/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
31/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
32/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
33/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
34/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
35/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
36/109 Uniform Lagrange Interpolation Base Case Linear interpolation between two points Inductive Step Assume we have points y i, …, y n+1+i Build interpolating polynomials f(t), g(t) of degree n for y i, …, y n+i and y i+1, …, y n+1+i h(t) interpolates all points y i, …, y n+1+i and is of degree n+1 Moreover, h(t) is unique
37/109 Lagrange Evaluation Pseudocode Lagrange(pts, i, t) n = length(pts)-2 if n is 0 return pts[0](i+1-t)+pts[1](t-i) f=Lagrange(pts without last element, i, t) g=Lagrange(pts without first element, i+1, t) return ((n+1+i-t)f+(t-i)g)/(n+1)
38/109 Problems with Interpolation
39/109 Problems with Interpolation
40/109 Bezier Curves Polynomial curves that seek to approximate rather than to interpolate
41/109 Bernstein Polynomials Degree 1: (1-t), t Degree 2: (1-t) 2, 2(1-t)t, t 2 Degree 3: (1-t) 3, 3(1-t) 2 t, 3(1-t)t 2, t 3
42/109 Bernstein Polynomials Degree 1: (1-t), t Degree 2: (1-t) 2, 2(1-t)t, t 2 Degree 3: (1-t) 3, 3(1-t) 2 t, 3(1-t)t 2, t 3 Degree 4: (1-t) 4, 4(1-t) 3 t, 6(1-t) 2 t 2, 4(1-t)t 3,t 4
43/109 Bernstein Polynomials Degree 1: (1-t), t Degree 2: (1-t) 2, 2(1-t)t, t 2 Degree 3: (1-t) 3, 3(1-t) 2 t, 3(1-t)t 2, t 3 Degree 4: (1-t) 4, 4(1-t) 3 t, 6(1-t) 2 t 2, 4(1-t)t 3,t 4 Degree 5: (1-t) 5, 5(1-t) 4 t, 10(1-t) 3 t 2, 10(1-t) 2 t 3,5(1-t)t 4,t 5 … Degree n: for
44/109 Bezier Curves
45/109 Bezier Curves
46/109 Bezier Curves
47/109 Bezier Curve Properties Interpolate end-points
48/109 Bezier Curve Properties Interpolate end-points
49/109 Bezier Curve Properties Interpolate end-points
50/109 Bezier Curve Properties Interpolate end-points
51/109 Bezier Curve Properties Interpolate end-points Tangent at end-points in direction of first/last edge
52/109 Bezier Curve Properties Interpolate end-points Tangent at end-points in direction of first/last edge
53/109 Bezier Curve Properties Interpolate end-points Tangent at end-points in direction of first/last edge
54/109 Bezier Curve Properties Interpolate end-points Tangent at end-points in direction of first/last edge Curve lies within the convex hull of the control points
55/109 Convex Hull The smallest convex set containing all points p i
56/109 Convex Hull The smallest convex set containing all points p i
57/109 Bezier Curve Properties Interpolate end-points Tangent at end-points in direction of first/last edge Curve lies within the convex hull of the control points Bezier Lagrange
58/109 Pyramid Algorithms for Bezier Curves Polynomials aren’t pretty Is there an easier way to evaluate the equation of a Bezier curve?
59/109 Pyramid Algorithms for Bezier Curves
60/109 Pyramid Algorithms for Bezier Curves
61/109 Pyramid Algorithms for Bezier Curves
62/109 Bezier Evaluation Pseudocode Bezier(pts, t) if ( length(pts) is 1) return pts[0] newPts={} For ( i = 0, i < length(pts) – 1, i++ ) Add to newPts (1-t)pts[i] + t pts[i+1] return Bezier ( newPts, t )
63/109 Subdividing Bezier Curves Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve
64/109 Subdividing Bezier Curves Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve
65/109 Subdividing Bezier Curves Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve
66/109 Subdividing Bezier Curves Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve
67/109 Subdividing Bezier Curves Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve
68/109 Subdividing Bezier Curves Control points for left curve!!!
69/109 Subdividing Bezier Curves Control points for right curve!!!
70/109 Subdividing Bezier Curves
71/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
72/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
73/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
74/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
75/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
76/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
77/109 Applications: Intersection Given two Bezier curves, determine if and where they intersect
78/109 Applications: Intersection Check if convex hulls intersect If not, return no intersection If both convex hulls can be approximated with a straight line, intersect lines and return intersection Otherwise subdivide and recur on subdivided pieces
79/109 Applications: Intersection
80/109 Applications: Intersection
81/109 Applications: Intersection
82/109 Applications: Intersection
83/109 Applications: Intersection
84/109 Applications: Intersection
85/109 Applications: Intersection
86/109 Applications: Intersection
87/109 Applications: Intersection
88/109 Applications: Intersection
89/109 Applications: Intersection
90/109 Application: Font Rendering
91/109 Application: Font Rendering
92/109 Problems with Bezier Curves More control points means higher degree Moving one control point affects the entire curve
93/109 Problems with Bezier Curves More control points means higher degree Moving one control point affects the entire curve
94/109 B-spline Curves Not a single polynomial, but lots of polynomials that meet together smoothly Local control
95/109 B-spline Curves Not a single polynomial, but lots of polynomials that meet together smoothly Local control
96/109 Rendering B-spline Curves Lane-Reisenfeld subdivision algorithm Linearly subdivide the curve by inserting the midpoint on each edge Perform averaging by replacing each edge by its midpoint d times Subdivide the curve repeatedly
97/109 Rendering B-spline Curves
98/109 Rendering B-spline Curves
99/109 Rendering B-spline Curves
100/109 Rendering B-spline Curves
101/109 Rendering B-spline Curves
102/109 Rendering B-spline Curves
103/109 Rendering B-spline Curves
104/109 Rendering B-spline Curves
105/109 Rendering B-spline Curves
106/109 B-spline Properties Curve lies within convex hull of control points Variation Diminishing: Curve wiggles no more than control polygon Influence of one control point is bounded Degree of curve increases by one with each averaging step Smoothness increases by one with each averaging step
107/109 B-spline Curve Example
108/109 B-spline Curve Example
109/109 B-spline Curve Example