3 Parametric Polynomials For interpolating n point we need a polynomial of degree n-1.
4 Parametric Polynomials Polynomial interpolation has several disadvantages:If the polynomial degree is high, unwanted wiggles are introduced.If the polynomial degree is law, it gives too little flexibility.No local operations.
17 Shape of the Curve Interpolation Splines Approximation Splines Control points are fitted with piecewise continuous parametric polynomial function in one of two way:Interpolation SplinesApproximation Splines
18 Interpolation Splines When polynomial sections are fitted so that the curve passes through each control point, the resulting curve is said to interpolate the set of control points.
19 Interpolation Splines Interpolation curves are commonly used to digitize drawing or to specify animation paths.
20 Approximation Splines When polynomial sections are fitted to the general control point path without necessarily passing through any control point, the resulting curve is said to approximate the set if control points.
21 Approximation Splines Approximation curves are uses as design tools to structure object surfaces.
23 Parametric Continuity Conditions To represent a curve as a series of piecewise parametric curves, these curves to fit together reasonably …Continuity!
24 Parametric Continuity Conditions Each section of a spline is described with a set of parametric coordinate functions of the form:
25 Parametric Continuity Conditions Let C1(u) and C2(u) , be two parametric Curves.We set parametric continuity by matching the parametric derivation of adjoining curve sections at their common boundary.
26 Parametric Continuity Conditions Zero order parametric (C0): Simply the curves meet, C1(1) = C2(0) .First order parametric (C1): The first parametric derivations for two successive curve sections are equal at their joining point, C´1(1)= C´2(0)
27 Parametric Continuity Conditions Second order parametric (C2): Both the first and second parametric derivatives of the two curve sections are the same at the intersection, C˝1(1)= C˝2(0)
28 Parametric Continuity Conditions Simple Example:The curve consists of two parabolas, domains [-1,0] and [0,1], respectivelyf(u) = ( u, -u2, 0 )g(v) = ( v, v2, 0 )f'(u) = ( 1, -2u, 0 ) ,f''(u) = ( 0, -2, 0 )g'(u) = ( 1, 2v, 0 ) ,g''(v) = ( 0, 2, 0 )Two curves are C1 continuous at the origin.f''(0) = ( 0, -2, 0 ) is not equal to g''(v) = ( 0, 2, 0 ), they are not C2 continuous at the origin.Curvature of f(u) = 2/(1 + 4u2)1.5 Curvature of g(v) = 2/(1 + 4v2)1.5Two curve segments may be C1 continuous and even curvature continuous, but not C2 continuous
30 Problems with Parametric Continuity Two line segments:f(u) = A + u(B - A)g(v) = B + v(C - B)f'(u) = B - Ag'(v) = C - BThus, f'(u) = B - A is, in general, not equal to g'(v) = C - B and consequently these two line segments are not C1 continuous at the joining point B!Is it strange?Re-parameterizing the curve segments may overcome the problemF(u) = A + u(B - A)/ | B - A |G(v) = B + v(C - B)/ | C - B |u is in the range of 0 and | B - A | and v is in the range of 0 and | C – B|
32 Problems with Parametric Continuity Semi circle:Let u2 = p in f(u) and let v2 = q in g(v). The new equations are:f(p) = ( -cos(p PI/2), sin(p PI/2), 0 )g(q) = ( sin(q PI/2), cos(q PI/2), 0)Their derivatives aref'(p) = ( (PI/2) sin(p PI/2), (PI/2) cos(p PI/2), 0 )f''(p) = ( (PI/2)2 cos(p PI/2), -(PI/2)2 sin(p PI/2), 0 )g'(q) = ( (PI/2) cos(q PI/2), -(PI/2) sin(q PI/2), 0 )g''(q) = ( -(PI/2)2 sin(q PI/2), -(PI/2)2 cos(q PI/2), 0 )Therefore, after changing variables, both f'(1) and g'(0) are equal to ( PI/2, 0, 0 ) and hence they are C1 continuous. Moreover, both f''(1) and g''(0) are equal to ( 0, -(PI/2)2, 0 ) and hence they are C2 continuous! They are also curvature continuous because they have curvature 1 everywhere (remember they are circles).
34 Geometric Continuity Conditions Two curve segments are said Gk geometric continuous at the joining point if and only if there exists two parameterizations, one for each curve segment, such that all i-th derivatives, i less than or equal to k, computed with these new parameterizations agree at the joining point.
35 Geometric Continuity Conditions Two C0 curve segments are said G1 geometric continuous at the joining point if and only if vectors f'(u) and g'(v) are in the same direction at the joining point. Note that f'(u) and g'(v) are evaluated at the joining point.The tangent vectors point to the opposite directions, and, as a result, they are not G1 at the joining point
36 Geometric Continuity Conditions Two C1 curve segments are said G2 geometric continuous at the joining point if and only if vector f''(u) - g''(v) is parallel to the tangent vector at the joining point. Note that f''(u) and g''(v) are evaluated at the joining point.
38 Geometric Continuity Conditions From f'(1) = g'(0) = ( 2, 0, 0 ), we know that these two curve segments are C1 at the joining point. Since f''(1) = ( 2, -2, 0 ) is not equal to g''(0) = ( -2, -2, 0 ), they are not C2.Since the curves are C1, checking for G2 is meaningful. Since f''(1) - g''(0) = ( 4, 0, 0 ) is parallel to the tangent vector ( 2, 0, 0 ) at the joining point, these two curve segments are G2 continuous at the joining point ( 0, 1, 0 ).
39 Geometric Continuity Conditions Geometric Continuity Conditions: Only require parametric derivatives of the two sections to be proportional to each other at their common boundary instead of equal to each other.
40 Geometric Continuity Conditions Zero order geometric (G0): Same as C0C1(1) = C2(0)First order geometric (G1): The parametric first derivatives are proportional at the intersection of two successive sections.C´1(1)= αC´2(0)Second order geometric (G2): Both the first and second parametric derivatives of the two curve sections are proportional at their boundary,C˝1(1)= αC˝2(0)
41 Parametric & Geometric Continuity A curve generated with geometric continuity condition is similar to one generated with parametric continuity , but with slight differences in curve shape.With geometric continuity, the curve is pulled toward the section with the greater tangent vector.
44 Linear Spline Interpolation Given a set of control points, linear interpolation spline is obtained by fitting the input points with a piecewise linear polynomial curve that passes through every control points.
45 Linear Spline Interpolation A linear polynomial:
46 Linear Spline Interpolation We need to determine the values of a and b in the linear polynomial for each of the n curve section.Substituting endpoint values 0 and 1 for parameter u:Linear Spline Interpolation
47 Linear Spline Interpolation Solving this equation for the polynomial coefficients:P(u) can be written in terms of the boundary conditions:MsplineMgeometryU
48 Linear Spline Interpolation The matrix representation for linear spline representation:Mgeometry is the matrix containing the geometry constraint values (boundary condition) on the spline.Mspline is the matrix that transform the geometric constraint values to the polynomial coefficients and provides a characterization for the spline curve (Basis Matrix).
49 Linear Spline Interpolation We can expand the matrix representation:Blending Functions
50 Linear Spline Interpolation The Linear spline blending function:
51 Linear Spline Interpolation The curve is linear combination of the blending functions.The piecewise linear interpolation is C0 continuous.For a linear polynomial, 2 constraints are required for each segment.A polynomial of degree k has k+1 coefficients and thus requires k+1 independent constraints to uniquely determine it.
53 Cubic Spline Interpolation Cubic splines are used to:Set up paths for object motionA representation for an existing object or drawingDesign object shapeCubic splines are more flexible for modeling arbitrary curve shapes.
54 Cubic Spline Interpolation Given a set of control points:Cubic interpolation spline is obtained by fitting the input points with a piecewise cubic polynomial curve that passes through every control points.
56 Linear Spline Interpolation We need to determine the values of a , b, c and d in the linear polynomial for each of the n curve section.By setting enough boundary conditions at the “joints” between curve sections we can obtain numerical values for all the coefficients.Linear Spline Interpolation
57 Cubic Spline Interpolation Methods for setting the boundary conditions for cubic interpolation splines:Natural Cubic SplinesHermit SplinesCardinal SplinesKochanek-Bartels Splines
59 Natural Cubic SplinesNatural cubic splines are developed for graphics application.Natural cubic splines have C2 continuity.
60 Natural Cubic Splines We have n curve sections If we have n+1 control points to fit, then:We have n curve sections4n polynomial coefficients to be determined.3 control points (n=2)2 curve sections4×2 polynomial coefficients to be determined.
61 Natural Cubic SplinesAt each n-1 interior control points, we have 4 boundary condition:The two curve sections on either side of a control point must first and second parametric derivatives at that control point, and each curve must pass through that control point.At P1 interior control:1. C´1(1)=C'2(0)2. C˝1(1)=C˝2(0)3. C1(1)=P14. C2(0)=P1
62 Natural Cubic Splines Additional equation: First control point P0 End control points Pn5. C1(0)=P06. C2(1)=P2
63 Natural Cubic Splines We still need two more conditions to be able to determine values for all coefficients.
64 Natural Cubic Splines Method 1: Set the second derivatives at p0 and pn to 07. C˝1(0)=08. C˝2(1)=0
65 Natural Cubic Splines Method 2: Add a control point P-1 and a control point Pn+1.P-1P37. P-18. P3
66 Natural Cubic SplinesNatural cubic splines are a mathematical model for the drafting spline.Disadvantage:No “Local Control”: we cannot reconstruct part of the curve without specifying an entirely new set of control points.
68 Hermit SplinesGiven a set of control points:Hermit splines is an interpolating piecewise cubic polynomial with a specified tangent at each control point.
69 Hermit SplinesHermit splines can be adjusted locally because each curve section is only dependent on its endpoint constraints (unlike the natural cubic splines).
70 Hermit SplinesExample: Change in Magnitude of T0
71 Hermit SplinesExample: Change in Direction of T0
72 Hermit SplinesP(u) represents a parametric cubic point function for the section between pk and pk+1.The boundary conditions are:Dpk and Dpk+1 are the values for the parametric derivations (slope of the curve) at control points Pk and Pk+1
73 We can write the constraints Hermit SplinesBoundary conditionsThe derivative of the point function:We can write the constraintsin a matrix form:
74 Hermit SplinesSolving this equation for the polynomial coefficients:MH, the Hermit matrix, is the inverse of the boundary constraint matrix.
77 Hermit SplinesHermit polynomials can be useful for some digitizing applications where it may not be too difficult to specify or approximate the curve slopes.For most problems in modeling, it is more useful to generate spline curve without requiring input values for curve slopes.But…
79 Cardinal SplinesCardinal splines are interpolating piecewise cubics with specified endpoint tangents at the boundary of each curve section.The difference is that we do not have to give the values for the endpoint tangents.For a cardinal spline, the value for the slope at a control point is calculated from the coordinates of the two adjacent control points.
80 Cardinal SplinesA cardinal spline section is completely specified with four consecutive control points.The middle two control points are the section endpoints, and the other two points are used in the calculation of the endpoint slopes.
81 Cardinal Splines The boundary conditions: Thus, the slopes at control points pk and pk+1 are taken to be proportional to the chords and