introduction to curves

Embed Size (px)

Citation preview

  • 7/27/2019 introduction to curves

    1/13

    INTRODUCTION

    A curve segment is a point bounded collection of points whose coordinates are given bycontinuous, one-parameter, single-valued mathematical functions of the form.

    = x(u) y = y(u) z = z(u)

    The parametric value ofu is constrained to the interval u [0, 1]. The curve is boundedbetween two points at u=0 and the other at u=1.

    Any point on the curve can be treated as a component of vectorp (u). Thisp (u) is the

    vector to the pointx(u), y(u), z(u) and pu

    (u) is the tangent vector to the curve at thesame point.

    here

    vector components are:

    and the tangent vector is:

    A simple example of parametric equation of a curve would be a set of linear parametric

    equations above is gives a straight line starting at Pointp(0) = [a b c] and ending at point

    (1) = [(a + l) (b + m) (c + n)] where a, b, c and l, m, n are constants. The directioncosines of the line would be proportional to l, m, n.

  • 7/27/2019 introduction to curves

    2/13

    GEOMETRIC CONTINUITY CONDITIONS

    An alternate method for joining two successive curve sections is to specify conditions for

    geometric continuity. In This case, we only require parametric derivatives of the two sections tobe proportional to each other at their common boundary instead of equal to each other.

    Zero- order geometric continuity, described as G0

    continuity, is the same as zero- order

    parametric continuity. That is, the two curves sections must have the same coordinate position at

    the boundary point. First order geometric continuity, or G1

    continuity, means that the

    parametric first derivatives are proportional at the intersection on two successive sections. If we

    denote the parametric position on the curve as P(u), the direction of the tangent vector P'(u), but

    not necessarily its magnitude, will be the same for two successive curve sections at their joining

    point under G1

    continuity. Second-order geometric continuity, or G2

    continuity, means that

    both the first and second parametric derivatives of the two curve sections are proportional at their

    boundary. Under G

    2

    continuity, curvatures of two curve sections will match at the joiningposition.

    A curve generated with geometric continuity conditions is similar to one generated with

    parametric continuity, but with slight differences in curve shape. Figure below provides a

    comparison of geometric and parametric continuity. With geometric continuity, the curve is

    pulled toward the section with the greater tangent vector.

    Figure 1: Curves with G1

    continuity

    Figure 1: Curves with C1

    continuity

  • 7/27/2019 introduction to curves

    3/13

    Spline Specifications

    There are three equivalent methods for specifying a particular spline representation: (1) We van

    state the set of boundary conditions that are imposed on the spline; or (2) we can state the matrix

    that characterizes the spline; or (3) we can state the set ofblending functions (or basisfunctions) that determine how specified geometric constraints on the curve are calculate

    positions along the curve path.

    To illustrate these three equivalent specifications, suppose we have the following parametric

    cubic polynomial representation for the x coordinate along the path of a cubic spline section:

    Boundary conditions for this curve might be set, for example, on the endpoint coordinates

    x(0)and x(1) and on the parametric first derivatives at the endpoints x'(0) and x'(1). These four

    boundary conditions are sufficient to determine the values of the four coefficients ax,bx,cx and dx.

    From the boundary conditions, we can obtain the matrix that characterizes this spline curve byfirst rewriting Eq. above as the matrix product.

    Where U is the row matrix of powers of parameter u, and C is the coefficient column matrix. If

    x(0), x(1), x'(0) and x'(1) are known using the equation above we can right the boundaryconditions in matrix form and solve for the coefficient matrix C as

  • 7/27/2019 introduction to curves

    4/13

    Where is a four-element column matrix containing the geometric constraint values

    (boundary conditions) on the spline

    and C is the 4-by-4 matrix of the polynomial coefficients given by

    and M is the matrix of the coefficients in the equation.

    the equation x=UC can now be rewritten as follows:

    or as

    Finally, we can expand equation above to obtain a polynomial representation for coordinate x in

    terms of the geometric constraint parameters

    where gk are the constraint parameters, such as the control-point coordinates and slope of the

    curve at the control points, and BFk(u) are the polynomial blending functions. These blending

    functions can be written in a matrix form as

    where Mblend is the set of coefficients of these blending functions. The curve equation can then be

    expressed as

    where B is the matrix of the input points.

    In the following sections, we discuss some commonly used splines and their matrix and

    blending-function specifications.

  • 7/27/2019 introduction to curves

    5/13

    ALGEBRAIC AND GEOMETRIC FORMS

    The Algebraic form of aparametric cubic (pc) curve segment is given by the following threepolynomials

    A set of 12 constant coefficients are called algebraic coefficients. Each unique set ofalgebraic coefficient determines a unique pc curve. If two similar curves occupy differentpositions in space then their algebraic coefficients are different.

    The same set of polynomial equation can be written in a compact for as given below:

    .......................................................(1.1)

    herep(u) is the position vector of any point on the curve, anda0, a1, a2, a3 are the vectorequivalents of the scalar algebraic coefficients. Again the restriction on the parametric

    variable u is expressed as u [0,1].The geometric form of a pc curve is more convenient way of controlling the shape of a curvein typical modeling situations. For a space curve there are several conditions to choosefrom: end points coordinates, tangents, curvature, torsion, plus any number of conditions

    dependent on higher order derivatives.Therefore by using the equation 1.1 we get:

    Wherep(0) andp(1) are simply calculated by substituting u with 0 and 1 respectively andu(0) andp

    u(1) are calculated by differentiatingp(u) with respect to u.

    By solving this set of four equations, we can define the algebraic coefficients in terms of theboundary conditions.

  • 7/27/2019 introduction to curves

    6/13

    On substituting their value in equation 1.1 we get

    From the above equation we obtain:

    Thus equation 1.2 can be written as:

    On dropping the function notation the final equation would look like:

    This is the geometric form, and are called geometric coefficients. The F terms areblending functions.

    This can be written in the "Standard Geometric Form" as

    This form is also the same as the Hermite Splines.

  • 7/27/2019 introduction to curves

    7/13

    CUBIC SPLINE INTERPOLATION METHODS

    This class of spline is most often used to set up paths for object motions or to provide a

    representation for an existing object or drawing, but interpolation splines are also used

    sometimes to design object shapes. Cubic polynomials offer a reasonable compromise betweenflexibility and speed of computation. Compared to higher order polynomials, cubic splines

    require less calculations and memory and they are more stable. Compared to lower-order

    polynomials, cubic splines are more flexible for modeling arbitrary curve shapes.

    Given a set of control points, cubic interpolation splines are obtained by fitting the input points

    with a piecewise cubic polynomial curve that passes through every control point. Suppose we

    have n+1 control points specified with coordinates

    A cubic interpolation fit of these points is illustrated in figure below. We can describe theparametric cubic polynomial that is to be fitted between each pair of control points with the

    following set of equations:

    For each of these three equations, we need to determine the values of the four coefficients a, b, c,

    and d in the polynomial representation for each of the n curve sections between the n+1 control

    points. We do this by setting enough boundary conditions at the joints between curves sections

    so that we can obtain numerical values for all the coefficients. In the following sections, we

    discuss common methods for setting the boundary conditions for cubic interpolation splines.

  • 7/27/2019 introduction to curves

    8/13

    QUADRIC SURFACES

    A frequently used class of objects is the quadric surfaces, which

    are described with second - degree equations (quadratics). They include spheres, ellipsoids, tori,

    paraboloids, and hyperboloids. Quadric surfaces, particularly spheres and ellipsoids, are common

    elements of graphics scenes, and they are often available in graphics packages as primitives from

    which more complex objects can be constructed.

    SphereIn Cartesian coordinates, a spherical surface with radius r centered on the coordinate origin is

    defined as the set of points (x, y, z) that satisfy the equation

    We can also describe the spherical surface in parametric form, using latitude and longitude

    angles Figure below:

    The parametric representation in Equ. Below provide a symmetric range for the angular

    parameters and alternatively, we could write the parametric equations using standard

    spherical coordinates, where angle is specified as the colatitudes fig. below. Then is defined

    over the range , and is often taken in the range . We could also set up the

    representation using parameters u and v defined over the range from 0 to 1 by substituting

    and .

  • 7/27/2019 introduction to curves

    9/13

    Ellipsoid

    An ellipsoidal surface can be described as an extension of a spherical surface where the radii in

    three mutually perpendicular directions can have different values fig. below. The Cartesian

    representation for points over the surface of an ellipsoid centered on the origin is

    And a parametric representation for the ellipsoid in terms of the latitude angle and the

    longitude angle in fig. below

    Torus

    A torus is a doughnut-shaped object, as shown in fig. below. It can be generated by rotating a

    circle or other conic about a specified axis. The Cartesian representation for points over the

    surface of a torus can be written in the form.

    Where r is any given offset value. Parametric representations for a torus are similar to those for

  • 7/27/2019 introduction to curves

    10/13

    an ellipse, except that angle extends over 3600.using latitude and longitude angles and ,

    we can describe the torus surface as the set of points that satisfy

  • 7/27/2019 introduction to curves

    11/13

    Bezier Surfaces

    Two set of orthogonal Bezier curves can be used to design an object surface by specifying by an

    input mesh of control points. The parametric vector function for the Bezier surface is formed as

    the Cartesian product of Bezier blending functions:

    with Pj,kspecifying the location of a point in the array of (m +1) by (n + 1) control points.

    Figure 1 below illustrates two Bezier surface plots. The control points are connected by dashed

    lines, and the solid lines show curves of constant u and constant . Each curve of constant u is

    plotted by varying over the interval from 0 to 1, with u fixed at one of the values in this unit

    interval. Curves of constant are plotted similarly.

    Figure 1: Bezier surfaces

    Bezier surfaces have the same properties as Bezier curves, and they provide a convenient method

    for interactive design applications. For each surface patch, we can select a mesh of control points

    in the xy ground plane, then we choose elevations above the ground plane for the z-coordinate

    values of the control points. Patches can then be pieced together using the boundary constraints.

    Figure 2 below illustrates a surface formed with two Bezier sections. As with curves, a smooth

    transition from one section to the other is assured by establishing both zero and first order

    continuity. Zero-order continuity is obtained by matching control points at the boundary. First-

    order continuity is obtained by choosing control points along a straight line across the boundary

    and by maintaining a constant ratio of collinear line segments for each set of specified control

  • 7/27/2019 introduction to curves

    12/13

    points across section boundaries.

    Figure 2: Two adjacent Bezier patches with C1

    continuity

  • 7/27/2019 introduction to curves

    13/13

    B-Spline Surfaces

    Formulation of a B-spline surface is similar to that for B-splines. We can obtain a vector point

    function over a B-spline surface using the Cartesian product of B-spline blending functions in the

    form

    where vector values for pk1,k2 specify positions of (n1 + 1) by (n2 + 1) control points.

    B-Spline surfaces exhibit the same properties as those of their component B-spline curves. A

    surface can be constructed from selected values for parameters d1 and d2 (which determine the

    polynomial degrees to be used) and from the specified knot vectors in the two directions.