[vtkusers] Extract normals from this file?

David Doria daviddoria at gmail.com
Thu Apr 16 07:10:26 EDT 2009


For some reason I separated these posts, but here all of the ways I tried
(which I've had to use on occasion before, but none of which work with this
file):

1) in a named array
polydata->GetPointData()->GetArray("Normals")

2) associated with the points
polydata->GetPointData()->GetNormals()

3) associated with the cells
polydata->GetCellData()->GetNormals()

4) associated with the cells, but in a named array
polydata->GetCellData()->GetNormals("cellNormals")


Thanks,

David


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

> Hello,
>
> if they are there, I think you can obtain them as following:
> 1.) obtain the dataset vtkDataSet *someDataSet
> = someVtkReader->GetDataSet();
> 2.) vtkPointData *somePointData = someDataSet->getPointData();
> 3.) check if somePointData != NULL;
> 4.) vtkDataArray *someDataArray = somePointData->GetNormals(). This
> function is from the base class of vtkPointData (vtkDataSetAttributes) and
> will return NULL if no normals are there.
>
> Alternativly the same should be available for vtkCellData if normals are
> defined on the cells (flat shading).
>
> Hope that helps.
> Kind regards,
> Björn
>
> ----- Ursprüngliche Nachricht -----
> Von: David Doria <daviddoria at gmail.com>
> Datum: Donnerstag, 16. April 2009, 1:08
> Betreff: Re: [vtkusers] Extract normals from this file?
> Cc: vtk <vtkusers at vtk.org>
>
>
> > Sure, it has colors, but in Paraview if you run the Normal Glyphs
> filter, it displays normals, so they are clearly there somewhere, but how
> would you get at them in VTK in c++?
>
> > Thanks,
>
> > David
>
>
>
> > On Wed, Apr 15, 2009 at 6:44 PM, Andrew Maclean <
> andrew.amaclean at gmail.com> wrote:
>
>> > Definitely rgb colours. ParaView displays it nicely.
>>
>>
>> > On Thu, Apr 16, 2009 at 4:29 AM, Kevin H. Hobbs <hobbsk at ohiou.edu>
>> wrote:
>> > > On Wed, 2009-03-25 at 13:51 -0400, David Doria wrote:
>> > >> This is an example of a file that stemmed my question about how to
>> > >> read normals from a file. Can someone tell me how you would go about
>> > >> figuring out how to read these normals?
>> > >> http://engineeringnotes.net/parkinglot2.vtp
>> > >>
>> > >> Thanks,
>> > >>
>> > >> David
>> >
>> > > I don't think it has normals. It has rgb colors.
>> >
>>
>>
>> > > _______________________________________________
>> > > Powered by www.kitware.com
>> >
>> > > Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> >
>> > > Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > > Follow this link to subscribe/unsubscribe:
>> > > http://www.vtk.org/mailman/listinfo/vtkusers
>> >
>> >
>>
>>
>>
>> > --
>> > ___________________________________________
>> > Andrew J. P. Maclean
>> > Centre for Autonomous Systems
>> > The Rose Street Building J04
>> > The University of Sydney  2006  NSW
>> > AUSTRALIA
>> > Ph: +61 2 9351 3283
>> > Fax: +61 2 9351 7474
>> > URL: http://www.acfr.usyd.edu.au/
>> > ___________________________________________
>>
>
>
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
>
> -------------------------------------------------------------------------
> Dr. Bjoern Zehner
> UFZ Centre for Environmental Research Leipzig-Halle
> Permoserstrasse 15
> 04318 Leipzig
> Germany
> http://www.ufz.de/index.php?en=5673
> Tel: ++49 (341) 235 1979
> Fax: ++49 (341) 235 1939
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090416/f47c6bbb/attachment.htm>


More information about the vtkusers mailing list