[vtkusers] vtkSmoothPolyDataFilter doesn't smooth much

David Cole DLRdave at aol.com
Fri Nov 27 09:09:10 EST 2015


Try applying a vtkPolyDataNormals filter after smoothing, as demonstrated
in this example:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/SmoothPolyDataFilter

This was a months-long frustration for my team, before we finally realized
it simply needed recomputed normals to render properly.


Hope this helps,
David C.


On Friday, November 27, 2015, Fernando Pérez-García <fepegar at gmail.com>
wrote:

> Dear VTK experts,
>
> This is my first post here. I'm trying to smooth a mesh created from a
> mask. I've tried different parameters but I don't get the result I want,
> some vertices don't move at all!
>
> I attach
> ​snaps from the
>  original
> ​ mesh​
> , the poor result I get from VTK and the one that's looks good, which I
> got using the Laplacian filter in MeshLab.
>
>
> This is my code:
>
> reader = vtk.vtkPolyDataReader()
>
> reader.SetFileName(meshInputPath)
>
> reader.Update()
>
>
> mesh = reader.GetOutput()
>
>
> smoothFilter = vtk.vtkSmoothPolyDataFilter()
>
> smoothFilter.SetNumberOfIterations(500)
>
> smoothFilter.SetInput(mesh)
>
> smoothFilter.Update()
>
>
> writer = vtk.vtkPolyDataWriter()
>
> writer.SetInput(smoothFilter.GetOutput())
>
> writer.SetFileName(meshOutputPath)
>
> writer.Write()
>
>
> Do you know what I'm doing wrong?
>
>
> Thank you,
>
> Fernando
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151127/7605d72f/attachment.html>


More information about the vtkusers mailing list