How to use `vtkprojectPointsToPlane` to project to a 3D object to a special plane?
I want to use the vtkProjectPointsToPlane
to project this object onto a specific plane, but encountered this problem:
the 3D object in 3D Slicer:
def pd2plaPj(mod, cp= [0,0,0], norm=[0,1,0]):
norm = norm/np.dot(norm,norm)
pd = Helper.getPd(mod)
p2plaFilter = vtk.vtkProjectPointsToPlane()
p2plaFilter.SetInputData(pd)
p2plaFilter.SetProjectionTypeToSpecifiedPlane()
p2plaFilter.SetOrigin(cp)
p2plaFilter.SetNormal(norm)
p2plaFilter.Update()
return p2plaFilter.GetOutput()
pd2plaPj(mod) # Or norm is [1,0,0] Or [0,0,1]
get
It’s very good!
but …
pd2plaPj(mod, norm=[0,1,1))
what’s wrong?