[vtkusers] vtkPolyDataNormals: acces normal values

Sylvain Gouttard sylvain_gouttard at yahoo.fr
Thu Mar 22 16:28:50 EDT 2007


Hey,

I'm working on a project where i need to compute the normals of a mesh 
at each point. (and not at each cell)
So i read my mesh from a meta file and then i convert it to a 
vtkPolyData structure.
Once i have this vtkPolyData structure and use the vtkPolyDataNormals 
filter to compute the normals as follow:

    vtkPolyDataNormals *MeshNormals = vtkPolyDataNormals::New();
    MeshNormals->SetComputePointNormals(1);
    MeshNormals->SetInput(vtkMesh);
    vtkPolyData * vtkMeshNormals = MeshNormals->GetOutput();

Is there something wrong in the previous lines?
I would like to know how to have acces to the normal vector values 
themselves (X,Y,Z) and the index?
Thanks for you help.
Sylvain





More information about the vtkusers mailing list