[vtkusers] vtkSmoothPolyDataFilter doesn't smooth much

Fernando Pérez-García fepegar at gmail.com
Fri Nov 27 09:54:45 EST 2015


Hi David,

Thanks for your response. I just tried that and I got the same result. Any
other ideas?


Fernando

2015-11-27 15:09 GMT+01:00 David Cole <DLRdave at aol.com>:

> 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/943c9263/attachment.html>


More information about the vtkusers mailing list