Curve design 455
Parametric curves as trajectories We can interpret a parametric equations of a curve as time-trajectory of a point in the plane x=x(t) y=y(t) t=tmiddle t=tend t=tstart
Smoothness of Motion The velocity v(t) characterize the direction and speed of the movement v(t)
Tangent line The tangent line to curve P(t) at t=t0 can be given in parametric form L(u) having parameter u. L(u)= P(t0) + v(t0)u
Normal direction The normal direction to curve P(t) at t=t0 can be expressed as n(t0)= vperp(t0)=(-dy/dt,dx/dt)t=t0
Parametric Continuity P(t) is k-smooth in [a,b] if all derivatives of the curve, up to the kth, exist and are connected. k-th degree polynomials a0 + a1t + a2t2 + ... + aktk are k-smooth
Interactive Curve Design User defines the set of control points to create a curve
The interactive design process Lay down the initial control points Use the algorithm to generate the curve If the curve is satisfactory, stop Adjust some control points Go to step 2
Polynomial Approximation Approximation of points P0, P1,... , Pk Blending polynomials B0(t),B1(t),..., Bk(t) Intermediate points – affine combinations P(t)=P0*B0(t)+P1*B1(t)+...+Pk*Bk(t)
Approximation of points Bezier curves – Bernstein polynomials B-splines – cubic B-spline polynomials
Bezier Curve de Casteljeau Algorithm A(t)=(1-t)P0 + t P1 B(t)=(1-t)P1+ t P2 P(t)=(1-t)A + t B =(1-t)2P0 +2 t(1-t) P1+ t2P2 P B A
Bezier Curve Approximation of 4 points P0, P1, P2, P3 P(t)=(1-t)3P0+3(1-t)2t P1+3(1-t) t2 P2+t3P3
Bezier Curve Approximation of 4 points P0, P1, P2, P3 Bernstein polynomials B0(t)=(1-t)3, B1(t)=3t(1-t)2, B2(t)= 3t2(1-t), B3(t)= t3 Intermediate points – affine combinations P(t)=P0*B0(t)+P1*B1(t)+P2*B2(t)+P3*B3(t)
Bezier Curve Convex hull property B0(t)+B1(t)+B2(t)+B3(t)=1 the curve is inside of the convex hull of control points – convex combination Interpolation P(0)=P0*B0(0)= P0 P(1)=P3*B3(1)= P3 Bezier spline interpolates end points of control polygon
Bezier Curve Matrix form (1, t, t2, t3)Bez(P0, P1, P2, P3)T 1 0 0 0 -3 3 0 0 3 -6 3 0 -1 3 -3 1 Bez =
Tangent to Bezier curve Direction of the tangent vector at point P(t0): d(t0)=[¶x/ ¶t, ¶y/ ¶t, ¶z/ ¶t]t=t0 Equation of the tangent at point P(t0): q(u) = P(t0) + u* d(t0) Tangent at end points q0= P0 + u* (P1 - P0) q3= P3 + u* (P3 – P2)
Example Find Bezier-spline curve that is defined by the control polygon of points P0, ,, P3. P0=(3, -3), P1=(5, -2), P2=(5, 2), P3=(3, 3). a) Find the equations of the curve. b) Find the tangent line to the curve at the point corresponding to the value of parameter t=1.0 .
Example Matrix form (1, t, t2, t3)Bez(P0, P1, P2, P3)T 1 0 0 0 -3 3 0 0 3 -6 3 0 -1 3 -3 1 3 5 (1,t, t2, t3) = 3 + 6t - 6t2= x(t) -3 +3t +9t2 – 6t3 = y(t)
B-spline Approximation of 4 points P0, P1, P2, P3 Basic polynomials B0(t)=1/6* (1-t)3, B1(t)= 1/6* (4-6t2+3t3), B2(t)= 1/6* (1+3t+3t2-3t3), B3(t)= 1/6* t3 Intermediate points P(t)=P0*B0(t)+P1*B1(t)+P2*B2(t)+P3*B3(t)
B-spline Matrix form (1, t, t2, t3)Bspline(P0, P1, P2, P3)T 1 4 1 0 -3 0 3 0 3 -6 3 0 -1 3 -3 1 Bspline = 1/6*
Properties of B-splines Convex hull property – sum of blending functions equal to 1. Not an interpolation ( none of control points lies on the spline curve) Smooth approximation – tangent at point Pi(1) has the same direction as tangent at Pi+1(0).
Knot Vector Multiply knots to force interpolation (0, 0, 0, 1, 2, 3, 4, 5, 5, 5) end points are interpolated. Repeating point in the sequence means its “larger” weight (0, 1, 2, 3, 3, 3, 4, 5) B-spline passes through point P3.