[vtkusers] vtkPolyDataNormals adds points??

Amy Squillacote amylists at gmail.com
Wed Apr 29 14:07:14 EDT 2009


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
>



More information about the vtkusers mailing list