[vtkusers] vtkPolyDataNormals adds points??

David Doria daviddoria at gmail.com
Wed Apr 29 14:12:05 EDT 2009


Thanks Amy - I saw that initially but I thought it would only apply to the
getCellNormals because it was dealing with edges and polygons and such, but
it seems that it applies even to the getPointNormals.

Thanks,

David


On Wed, Apr 29, 2009 at 2:07 PM, Amy Squillacote <amylists at gmail.com> wrote:

> Yes. From the vtkPolyDataNormals.h:
>
> // vtkPolyDataNormals is a filter that computes point normals for a
> polygonal
> // mesh. The filter can reorder polygons to insure consistent orientation
> // across polygon neighbors. Sharp edges can be split and points duplicated
> // with separate normals to give crisp (rendered) surface definition. It is
> // also possible to globally flip the normal orientation.
> //
> // The algorithm works by determining normals for each polygon and then
> // averaging them at shared points. When sharp edges are present, the edges
> // are split and new points generated to prevent blurry edges (due to
> // Gouraud shading).
>
> If there is a sharp angle between two adjacent faces, then the points
> they share will be duplicated so that the point normals are in the
> correct direction for the corresponding face.
>
> If you don't want duplicated points, you can call
> normalGenerator->SplittingOff();
>
> - Amy
>
>
> On Thu, Apr 23, 2009 at 11:20 AM, David Doria <daviddoria at gmail.com>
> wrote:
> >
> > Is there any reason points would be added in the following code?
> >         cout << "Points before filter: " << polydata->GetNumberOfPoints()
> << endl;
> >         vtkSmartPointer<vtkPolyDataNormals> normalGenerator =
> vtkSmartPointer<vtkPolyDataNormals>::New();
> >         normalGenerator->SetInput(polydata);
> >         normalGenerator->SetComputePointNormals(1);
> >         normalGenerator->SetComputeCellNormals(0);
> >         normalGenerator->Update();
> >         polydata = normalGenerator->GetOutput();
> >         cout << "Points after filter: " << polydata->GetNumberOfPoints()
> << endl;
> >
> > The output is:
> > Points before filter: 502
> > Points after filter: 872
> >
> > Thanks,
> >
> > David
> >
> > _______________________________________________
> > 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
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090429/89b34390/attachment.htm>


More information about the vtkusers mailing list