MrPedru22
MrPedru22

Reputation: 1344

Smoothing poly data in VTK

I have a poly data that looks like this:

enter image description here

What I want to obtain is something that would be smoother, something like this (edited in paint for demonstration purpose):

enter image description here

So far I've tried the following filters:

However, the closest I got was with the first one, with a result like this:

enter image description here

Is there any filter or strategy in VTK that would allow me to reach something really close to the second picture?

Thanks in advance.

Upvotes: 4

Views: 1923

Answers (2)

Simon Esneault
Simon Esneault

Reputation: 66

One other solution could be to generate a binary vtkImageData from this polydata, using vtkPolyDataToImageStencil, then smooth the image using something like vtkImageGaussianSmooth and then go back to the polydata world using vtkMarchingCubes

You'll need to tweak some parameters for each filter, but that should work and give you more control other the smoothing

Upvotes: 1

jhoepken
jhoepken

Reputation: 1858

I suggest you play with the convergence and iterations parameter of vtkSmoothPolyDataFilter to achieve the optimal result for a single application of that filter. If this is not satisfying, why don't you go ahead and apply it multiple times, one after the other? This is what I would do if I had this problem at my hands.

Upvotes: 3

Related Questions