[vtkusers] Help for using vtkCurvatures

Jana Sefcikova neollie at gmail.com
Thu Aug 9 08:45:27 EDT 2012


Hi Rong,

On 9 August 2012 14:27, Rong Xu <xurong1981 at gmail.com> wrote:

> Hi, Jana Sefcikova :
>
> Thank you for your advice !
>
> But I need to get the exact Gauss or Mean curvature. what do you think if
> I convert point cloud to a mesh, then use vtkCurvatures to get the
> curvature for each point ?
>

It could work, but I do not know method to convert point cloud to polydata.
Someone else could help you.


> Also, I have another question. If I can get the curvatures, but how to get
> the curvature value for each point from vtkCurvatures ? Though I know some
> method like "curv->GetOutput()->GetPointData()->GetScalars()" to get the
> curvature values, but how can I know the coordinate (x, y, z) of that
> curvature value at the same time ?


 // Get the number of points in the polydata
vtkIdType idNumPointsInFile = polydata->GetNumberOfPoints();


vtkSmartPointer<vtkDoubleArray> arrMean =
    vtkDoubleArray::SafeDownCast(polydata->GetPointData()->GetArray("Mean_Curvature"));

vtkSmartPointer<vtkDoubleArray> arrGauss =
    vtkDoubleArray::SafeDownCast(polydata->GetPointData()->GetArray("Gauss_Curvature"));



for(int i = 0; i < idNumPointsInFile; i++)
 {
   double mean, gauss;

   double coords[3];

      mean = arrMean->GetValue(i);
      gauss= arrGauss->GetValue(i);
      polydata->GetPoint(i,coords);
  }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120809/4550c5e6/attachment.htm>


More information about the vtkusers mailing list