How could project a 3D point to a vtkParametricSpline

Hello,

I´ve created a vtkParametricSpline() and after I inserted some vtkPoints():

pts=np.loadtxt(‘evalPts.txt’,delimiter=‘,’)
spl=vtkParametricSpline()
spline_points = vtkPoints()
for pt in pts:
spline_points.InsertNextPoint(pt)
spl.SetPoints(spline_points)

Now, I´d like to project a very close 3Dpoint over this vtkParametricSpline and get the coordinates of this projection.

How can I do it, please?

Thanks!

A trivial way: generate a spline (vtkSplineFilter, a polyline), build a vtkCellLocator, and find the ClosestPoint on the exact line segment with (x,y,z) coordinates rather than parametric coordinates.