[vtkusers] vtkSmoothPolyDataFilter doesn't smooth much

Alexandre Dufour adufour at pasteur.fr
Mon Nov 30 05:33:14 EST 2015


Hi,

I actually had the same impression myself, but noticed that the normals are also ok. What changed things *dramatically* were the options on the smoother, notably these 3:

    smoothFilter->SetRelaxationFactor(0.1);
    smoothFilter->FeatureEdgeSmoothingOff();
    smoothFilter->BoundarySmoothingOn();

Now, only a dozen iterations are enough where I needed a few hundreds!
This could be something to check…

Alexandre 


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

> 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
> 
> 
> 
> _______________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151130/ee0538a4/attachment.html>


More information about the vtkusers mailing list