Upload
collin-poole
View
225
Download
1
Embed Size (px)
Citation preview
INTERPOLATION & APPROXIMATION
Curve algorithm• General curve shape may be generated
using method of– Interpolation (also known as curve fitting)
• Curve will pass through control points
– Approximation• Curve will pass near control points may interpolate
the start and end points.
Curve algorithm
interpolation approximation
Interpolation vs approximation
x
f(x)
x
f(x)
x
f(x)
x
f(x)
curve must pass through control points
curve is influenced by control points
Parametric equation of line = Vector equation of a line
• P(t) = a + ut
a
u
P
u 2u
P
tu
P
a
u
b
•P(t) = a + (b-a)t
•u = (b-a)
t=0t=1
0<=t<=1
P
t=0.25
P
t=0.5
P
t=0.75
X(t) = ax + (bx – ax)tY(t) = ay + (by – ay)tZ(t) = az + (bz – az )t
Linear interpolation
• P(t) = A(1-t) + Bt• In matrix form• P(t) = = A B . .
A
B
t=0
t=1
X(t)Y(t)Z(t)
-1 11 0
t1
in animation : - path , morphing
Interpolation Curves
• Curve is constrained to pass through all control points
• Given points P0, P1, ... Pn, find lowest degree polynomial which passes through the points
x(t) = an-1tn-1 + .... + a2t2 + a1t + a0
y(t) = bn-1tn-1 + .... + b2t2 + b1t + b0
Interpolating curve : piecewise linear
• Curve defined by multiple segments (linear)
• Segments joints known as KNOTS
• Requires too many data points for most shape
• Representation not flexible enough to editing
Interpolating curve : piecewise polynomial
• Segments defined by polynomial functions
• Segments join at KNOTS
• Most common polynomial used is cubic (3rd order)
• Segment shape controlled by two or more adjacent control points.
Knot points
• Location where segments join referred to as knots
• Knots may or may not coincide with control points in interpolating curves.
Curve continuity
• Concern is continuity at knots.
• Continuity conditions– Point continuity (no slope or curvature
restriction / no gap)– Tangent continuity (same slope at knot)– Curvature continuity ( same slope and
curvature at knot)
• Continuity - Cn
– C0 continuity – continuity of endpoint only or continuity of position.
– C1 continuity is tangent continuity or first derivative of position
– C2 continuity is curvature continuity or second derivative of position.
Curve continuity
Curve continuity
C0 C1
C2
Interpolation curves
• Typically possess curvature continuity
• Shape defined by– Endpoint and control point location– Tangent vectors at knots– Curvature at knots
Interpolation vs. Approximation Curves
• Interpolation Curve – over constrained → lots of (undesirable?) oscillations
• Approximation Curve – more reasonable?
Approximation techniques
• Developed to permit greater design flexibility in the generation of free form curves
• Common methods in modern CAD systems, bezier, b-spline, NURBS
• Employ control points (set of vertices that approximate the curve)
• Curves do not pass directly through points (except start and end)
• Intermediate points affect shape as if exerting a “pull” on the curve.
• Allow user to set shape by “pulling” out curve using control point location.
Approximation techniques
Example – bezier curve
Cubic Bézier Curve• 4 control points• Curve passes through first & last control point
• Curve is tangent at P1 to (P1-P2) and at P4 to (P4-P3)