 # 1 Introduction Curve Modelling Jack van Wijk TU Eindhoven.

## Presentation on theme: "1 Introduction Curve Modelling Jack van Wijk TU Eindhoven."— Presentation transcript:

1 Introduction Curve Modelling Jack van Wijk TU Eindhoven

2 Overview curve modelling Parametric curves Requirements Concepts Lagrangian interpolation Bézier curve B-spline Cubic splines

3 Parametric curves t p(t)p(t)p’(t)

4 Tangent line to curve t p(t)p(t)p’(t) s q(s)q(s)

5 Example t p(t)p(t) p’(t) s q(s)q(s)

6 Curve modelling Problem: How to define a smooth curve? Solution: –Specify a sequence of points p i, i = 1,…, N, (control-points); –Generate a smooth curve that interpolates or approximates these control-points.

7 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?

8 Parametric interpolation

9 Linear interpolation of two points p1p1 p2p2 t

10 Linear interpolation of N points p1p1 p2p2 t p3p3 p4p4 p5p5 t wiwi 1 2345 1 0

11 Linear interpolation Not Smooth Local control Intuitive and easy to use Interpolate

12 Lagrangian interpolation - 1

13 Lagrangian interpolation - 2

14 Lagrangian interpolation - 3

15 Lagrangian interpolation - 4 Smooth –no discontinuities in direction and curvature; NO local control Wild oscillations, not variation diminishing! Interpolating

16 Bézier curve - 1 Puzzle: Define a smooth curve that interpolates the first and last point and approximates the others. p1p1 p2p2 p3p3 p4p4

17 Bézier curve - 2 Solution for N=3: p1p1 p2p2 p3p3 q2q2 q1q1 p(t)

18 Bézier curve - 3 Solution for N=4: p1p1 p2p2 p3p3 p(t) p4p4

19 Bézier curve - 4

20 Bézier curve - 5

21 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

22 Convex hull property

23 Convex hull property example Curve outside convex hull Curve inside convex hull

24 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

26 Cubic B-spline

27 B-splines - 3 General B-spline: Degree: from 1 to N-1 Smooth (if degree > 1) Local control Variation diminishing, convex hull property Approximating

28 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,...

29 Cubic splines - 2

30 Cubic splines - 2

31 Cubic splines - 3

32 Tangent vector t p’(t) p(t)

33 Significant values p(0) : startpoint segment p’(0) : tangent through startpoint p(1) : endpoint segment p’(1) : tangent through endpoint t p(0) p(1) p’(0) p’(1)

34 Cubic Bézier curve p0p0 p1p1 p2p2 p3p3

35 Joining two Bezier segments p0p0 p2p2 p3p3 q0q0 q2q2 q3q3 Positional continuity: p 3 = q 0 Tangential continuity: p 3 - p 2 // q 1 - q 0 p1p1 q1q1

36 Cubic B-spline curve p0p0 p3p3 p1p1 p2p2

37 Conversion - 1

38 Conversion - 2

39 Puzzle 1: Hermite spline

40 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.

41 Puzzle 3: Split Bezier curve Find a recipe to split a cubic Bezier curve segment into two segments: p0p0 p2p2 p3p3 q0q0 q1q1 q6q6 p1p1 q2q2 q3q3 q4q4 q5q5

42 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

43 B-splines - 2