[vtk-developers] Generated normals not present in the polydata from unknown reason.

Jana Sefcikova neollie at gmail.com
Fri Apr 20 10:30:47 EDT 2012


Dear Users,
I tested vtk example PolyDataExtractNormals (
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataExtractNormals)
code that tries to detect whether normals are present in input polydata
structure and if not it will generate them. I made small change to code  at
the end of the main function in order to run TestPointNormal twice so I
have :

  std::cout << "PolyData address: " << polydata << std::endl;
  TestPointNormals(polydata);

  TestPointNormals(polydata);

I expected that after first round the polydata will be changed and will
contain new array for "Normals"  because output of normal generator is
assigned to input polydata in the first round / polydata =
normalGenerator->GetOutput(); /
so second  test round should pass directly without normal generation.
But after the firt test, polydata normals are not present any more so
second Test generate them  again .
So my question is : Why normals dissapeared ?
The same confusion for me occured when I enabled splitting on normal
generator (normalGenerator->SetSplitting(1);).  Inside first
TestPointNormals polydata had more points as before at the end (due to
splitting), but second test again work on likely unchanged polydata.

Why two functions working on the same pointer that is changed inside each
call looks unchanged ?

Thanks for any advice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20120420/87d798c9/attachment.html>


More information about the vtk-developers mailing list