# Why would \`vtkPolyDataNormals\` change the number of nodes?

**URL:** https://discourse.vtk.org/t/why-would-vtkpolydatanormals-change-the-number-of-nodes/12458
**Category:** Support
**Created:** [October 9, 2023, 8:10pm UTC](https://discourse.vtk.org/t/why-would-vtkpolydatanormals-change-the-number-of-nodes/12458 "2023-10-09T20:10:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [October 9, 2023, 8:10pm UTC](https://discourse.vtk.org/t/why-would-vtkpolydatanormals-change-the-number-of-nodes/12458/1 "2023-10-09T20:10:57Z")

</div>

I have a `*.vtp` file that does not have normals (but needs them for what I am doing next). I wanted to use `vtkPolyDataNormals` to add them … but it changes the number of nodes??

```python
rd = vtk.vtkXMLPolyDataReader()
rd.SetFileName("input.vtp")
rd.Update()
pd = rd.GetOutput()

print(pd.GetNumberOfPoints())
104923

nf = vtk.vtkPolyDataNormals()
nf.SetInputData(pd)
nf.Update()
print(nf.GetOutput().GetPointData().GetNormals().GetNumberOfTuples())
104670

```

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.vtk.org/user_avatar/discourse.vtk.org/christos_tsolakis/32/2076_2.png) [@Christos\_Tsolakis](https://discourse.vtk.org/u/Christos_Tsolakis)
#### Post date: [October 9, 2023, 8:33pm UTC](https://discourse.vtk.org/t/why-would-vtkpolydatanormals-change-the-number-of-nodes/12458/2 "2023-10-09T20:33:20Z")

</div>

From `vtkPolyDataNormals` [documentation](https://vtk.org/doc/nightly/html/classvtkPolyDataNormals.html#details)

> The filter can reorder polygons to ensure 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.

Experiment with _Splitting_ property as well as the _FeatureAngle_

---

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [October 9, 2023, 8:57pm UTC](https://discourse.vtk.org/t/why-would-vtkpolydatanormals-change-the-number-of-nodes/12458/3 "2023-10-09T20:57:55Z")

</div>

Ah, forgot that, thanks
