vtkPoissonReconstruction (vtkPCANormalEstimation) errors, flipped surface normals

Hi, I’m using vtkPoissonReconstruction to rebuild a mesh, with code that pretty much copies the example in https://lorensen.github.io/VTKExamples/site/Cxx/Points/PoissonExtractSurface/. It works fine on most input meshes, but occasionally it produces horrible results, essentially the mesh bulges outwards in patches. I’m pretty sure this is caused by vtkPCANormalEstimation generating inconsistent normals, with sudden flips inwards, but I can’t find a way to stop it from happening. vtkPoissonReconstruction is not a requirement, all I need is something that takes a mesh as input, a bit irregular and with possible folds, and spits out the outer envelope, smoothed out, disregarding existing edges and interpolating the existing vertices. Any suggestions?