430 likes | 650 Views
Introduction Curve Modelling. Jack van Wijk TU Eindhoven. Overview curve modelling. Parametric curves Requirements Concepts Lagrangian interpolation Bézier curve B-spline Cubic splines. Parametric curves. t. p ( t ). p ’( t ). Tangent line to curve. t. s. q ( s ). p ( t ).
E N D
Introduction Curve Modelling Jack van Wijk TU Eindhoven
Overview curve modelling • Parametric curves • Requirements • Concepts • Lagrangian interpolation • Bézier curve • B-spline • Cubic splines
Parametric curves t p(t) p’(t)
Tangent line to curve t s q(s) p(t) p’(t)
Example q(s) s p’(t) t p(t)
Curve modelling • Problem: How to define a smooth curve? • Solution: • Specify a sequence of points pi , i = 1,…, N, (control-points); • Generate a smooth curve that interpolates or approximates these control-points.
Requirements • Smooth • no discontinuities in direction and curvature; • Local control • Change of a point should have only local effect; • Intuitive and easy to use • no oscillations, variation diminishing • Approximate or interpolate?
Linear interpolation of N points p5 p4 p3 p1 p2 t 1 wi 0 1 2 3 4 5 t
Linear interpolation • Not Smooth • Local control • Intuitive and easy to use • Interpolate
Lagrangian interpolation - 4 • Smooth • no discontinuities in direction and curvature; • NO local control • Wild oscillations, not variation diminishing! • Interpolating
Bézier curve - 1 • Puzzle: Define a smooth curve that interpolates the first and last point and approximates the others. p4 p3 p1 p2
q1 q2 p(t) Bézier curve - 2 • Solution for N=3: p2 p1 p3
p(t) Bézier curve - 3 • Solution for N=4: p2 p3 p1 p4
Bézier curve - 6 General Bézier curve: • Degree = #points-1 • Smooth • no discontinuities in direction and curvature; • NO local control • Variation diminishing, convex hull property • Interpolates first and last, further approximating
Convex hull property example Curve outside convex hull Curve inside convex hull
B-splines • Piecewise polynomial, locally non-zero • Degree: user definable • Continuity: degree-1 • first degree: continuous in position • second degree: continuous in tangent • third degree: continuous in curvature
B-splines - 3 General B-spline: • Degree: from 1 to N-1 • Smooth (if degree > 1) • Local control • Variation diminishing, convex hull property • Approximating
Cubic splines - 1 Most popular in Computer Graphics: • powerful • inflection points, continuity • simple • low degree polynomials • local control • Many versions: • Bézier, B-spline, Catmull-Rom,...
Tangent vector p’(t) p(t) t
Significant values • p(0) : startpoint segment • p’(0) : tangent through startpoint • p(1) : endpoint segment • p’(1) : tangent through endpoint p’(0) p(1) t p’(1) p(0)
Cubic Bézier curve p1 p2 p0 p3
Joining two Bezier segments Positional continuity: p3= q0 Tangential continuity: p3- p2 // q1- q0 p1 p2 p3 q0 p0 q3 q1 q2
Cubic B-spline curve p1 p2 p0 p3
Puzzle 2: Limit on interpolation Find out why a curve that • interpolates the control points, • stays within the convex hull, • and is smooth cannot exist, both graphically and mathematically.
Puzzle 3: Split Bezier curve • Find a recipe to split a cubic Bezier curve segment into two segments: p1 p2 q2 q3 q4 q1 q5 q6 p0 p3 q0
Finally... • Curves: interpolation of points • Interpolation is generally applicable, f.i. surfaces: interpolation of curves • Demo program: www.win.tue.nl/~vanwijk/2M050/spline.exe