[vtkusers] getting curvature

David Doria daviddoria at gmail.com
Tue Oct 19 22:25:12 EDT 2010


On Tue, Oct 19, 2010 at 10:04 PM, Jonathan Morra <jonmorra at gmail.com> wrote:
> I have a vtkPolyData and I would like to get the curvature at every point.
>  I noticed that there is a vtkCurvatures class.  Here's the code that I have
> written so far
>                 vtkCurvatures curvatures = new vtk.vtkCurvatures();
>                 curvatures.SetInput(currentPolyData);
>                 curvatures.SetCurvatureTypeToGaussian();
>                 curvatures.Update();
>                 vtkPolyData curvatureData = curvatures.GetOutput();
> However, I don't know what to do with the curvatureData vtkPolyData, and how
> to extract the curvature at every point.
> Any help would be greatly appreciated.
> Thanks

Does this example help?

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/Curvatures

If you look in Graphics/vtkCurvatures.cxx, you will see the names of
the arrays that you would want to get: "Minimum_Curvature",
"Maximum_Curvature", etc. And you will see that they are stored in the
PointData of the PolyData object:

    mesh->GetPointData()->AddArray(meanCurvature);
    mesh->GetPointData()->SetActiveScalars("Mean_Curvature");

David



More information about the vtkusers mailing list