[vtkusers] Extract normals from this file?

David Doria daviddoria at gmail.com
Thu Apr 23 12:07:08 EDT 2009


2009/4/16 "Björn Zehner" <bjoern.zehner at ufz.de>

> Hello David,
> are you sure that your polydata have normals?
>
> Two hints:
> 1.) You read your data from file, don't you? Call for your reader:
> vtkPolyDataReader->ReadAllNormals() before you actually read your data.
> This function comes from the readers base class (vtkDataReader)
>
> 2.) May be you can try to apply the vtkPolyDataNormals filter to generate
> some normals and then try these lines below again if you get normals then?
>
> Regards,
> Bjoern
>


 Bjoern,
I am using vtkXMLPolyDataReader. There doesn't seem to be any normal reading
functions in that class. I looked into vtkPolyDataNormals, and it seems to
do the trick:

    vtkSmartPointer<vtkPolyDataNormals> normalGenerator =
vtkSmartPointer<vtkPolyDataNormals>::New();

    normalGenerator->SetInput(polydata);
    normalGenerator->Update();
    polydata = normalGenerator->GetOutput();

Thanks,

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090423/b44e6264/attachment.htm>


More information about the vtkusers mailing list