[vtkusers] vtkParametricSpline derivatives

Karl Merkley karl at elemtech.com
Fri Mar 21 10:01:39 EDT 2008


I'm trying to compute the derivatives a a spline.  I can evaluate  
points on the spline and get it to display but the derivative values  
always come back as zeros.    I'm using the cvs version of VTK updated  
earlier this week.   Any clues?

   Thanks,
        Karl

     // create a spline interpolating all the points
     vtkSmartPointer<vtkParametricSpline> spline =  
vtkSmartPointer<vtkParametricSpline>::New();

     spline->SetPoints(polydata->GetPoints());
     spline->DerivativesAvailableOn();

     double u[3] = {.5, .5, .5};
     double pt[3];
     double deriv[9];
     spline->Evaluate(u, pt, deriv);
     printf("point : %f %f %f\n", pt[0], pt[1], pt[2]);
     printf("deriv: %f %f %f : %f %f %f : %f %f %f\n",   
deriv[0],deriv[1],deriv[2],deriv[3],deriv[4],deriv[5],
             deriv[6],deriv[7],deriv[8]);



More information about the vtkusers mailing list