[vtkusers] Extracting normals from polydata add points ?

kenichiro yoshimi rccm.kyoshimi at gmail.com
Fri Sep 29 07:21:51 EDT 2017


Hi,

Could you try to turn off the option for splitting of sharp edges?
---
normals_generator.SplittingOff()
---

Thanks

2017-09-29 20:00 GMT+09:00 Nicolas Cedilnik <nicolas.cedilnik at inria.fr>:
> Hello,
>
> I'm wondering if I should file a bug for this or if it's a feature I don't
> understand.
>
> I'm computing normals for a triangular mesh and for some reason the new
> polydata (with normals) ends up having more points than the original.
>
> I don't really have time to explore this issue right now but if needed I do
> it later. Here's a quick illustration with my ipython output:
>
> In [58]: polydata.GetPoints().GetNumberOfPoints()
> Out[58]: 11290
>
> In [59]:     normals_generator = vtk.vtkPolyDataNormals()
>     ...:     normals_generator.SetInputData(polydata)
>     ...:     normals_generator.ComputeCellNormalsOff()
>     ...:     normals_generator.ComputePointNormalsOn()
>     ...:     normals_generator.Update()
>     ...:
>     ...:     polydata_with_normals = normals_generator.GetOutput()
>     ...:
>
> In [60]: polydata_with_normals.GetPoints().GetNumberOfPoints()
> Out[60]: 11382
>
> So I have 92 new points, the 11290 first ones being equal:
>
> In [74]: (vtk_to_numpy(polydata_with_normals.GetPoints().GetData())[:11290]
> == vtk_to_numpy(polydata.GetPoints().GetData())).all()
> Out[74]: True
>
> I'm using VTK with python3.6 from conda-forge:
>
> $ conda list | grep vtk
> vtk                       7.1.1                    py36_1 conda-forge
>
> Thoughts?
>
> -- Nicolas
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers


More information about the vtkusers mailing list