I tried to increase the node density, that didn’t seem to work either:
def project_onto_sphere(pd):
s = vtk.vtkSphereSource()
s.SetThetaResolution(60)
s.SetPhiResolution(30)
s.SetRadius(1)
tf = vtk.vtkTriangleFilter()
tf.SetInputData(pd)
lf = vtk.vtkLoopSubdivisionFilter()
lf.SetInputConnection(tf.GetOutputPort())
lf.SetNumberOfSubdivisions(3)
lf.Update()
pf = vtk.vtkProbeFilter()
pf.SetInputConnection(s.GetOutputPort())
pf.SetSourceConnection(lf.GetOutputPort())
pf.Update()
return pf.GetOutput()