Feature request: Mesh smoothing filter in vtkjs

I didn’t realized the vtkPolyDataNormals were already available

Solution

const smoother = vtk.Filters.Core.vtkPolyDataNormals.newInstance();
smoother.setInputData(vtkPolyData); // Smooth
mapper.setInputConnection(smoother.getOutputPort());

Then to add scalars, add them to the vtkPolyDataNormals directly, not to the original vtkPolyData

smoother.getOutputData().getPointData().setScalars(PDscalars);

1 Like