I’m using vtkWindowedSincPolyDataFilter
to smooth surfaces without shrinkage.
I wonder if I can use the same filter to smooth curves without shrinkage too. The doc of the aforementioned filter states that it should be possible in principle. Also this paper by Taubin referred to both surface and line smoothing.
However, the following example segfaults.
import vtk
polygon = vtk.vtkRegularPolygonSource()
polygon.SetNumberOfSides(10)
polygon.GeneratePolylineOn() # No face
polygon.GeneratePolygonOff() # just polyline
polygon.Update()
polygon = polygon.GetOutput()
smoothed = vtk.vtkWindowedSincPolyDataFilter()
smoothed.SetInputData(polygon)
smoothed.SetNumberOfIterations(30)
smoothed.SetPassBand(0.3)
smoothed.SetBoundarySmoothing(False)
smoothed.SetNonManifoldSmoothing(False)
smoothed.SetNormalizeCoordinates(True)
smoothed.Update()
I address this question to @lassoan and @will.schroeder, because there has been recent development in vtkWindowedSincPolyDataFilter
.
Thanks for your hints and clarifications
Update. The segfault was present in vtk version 8.1. It seems fixed in version 9.0.
In version 9.0, however, no smoothing is applied at all for a polyline input, independent of the choice of parameters (iterations, passband, boundary smoothing, etc.).
The question remains: How could non-shrinking line smoothing be achieved?