Logo Search packages:      
Sourcecode: inkscape version File versions

static void reparameterize ( NR::Point const   d[],
unsigned const   len,
double  u[],
BezierCurve const   bezCurve 
) [static]

Given set of points and their parameterization, try to find a better assignment of parameter values for the points.

d Array of digitized points.
u Current parameter values.
bezCurve Current fitted curve.
len Number of values in both d and u arrays. Also the size of the array that is allocated for return.

Definition at line 518 of file bezier-utils.cpp.

References NewtonRaphsonRootFind().

    g_assert( 2 <= len );

    unsigned const last = len - 1;
    g_assert( bezCurve[0] == d[0] );
    g_assert( bezCurve[3] == d[last] );
    g_assert( u[0] == 0.0 );
    g_assert( u[last] == 1.0 );
    /* Otherwise, consider including 0 and last in the below loop. */

    for (unsigned i = 1; i < last; i++) {
        u[i] = NewtonRaphsonRootFind(bezCurve, d[i], u[i]);

Generated by  Doxygen 1.6.0   Back to index