[vtkusers] vtkParametricSpline derivatives
Karl Merkley
karl at elemtech.com
Fri Mar 21 10:18:03 EDT 2008
OK, so I just should have gone and looked at the source first. The
Evaluate function for vtkParametricSpline doesn't even attempt to
compute derivatives. Looks like I do this myself.
Karl
On Mar 21, 2008, at 8:01 AM, Karl Merkley wrote:
> 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]);
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list