Grasshopper project points to mesh problem

Hello, I have a problem and I need some help.

I have some vertices of multiple polylines that I want to project onto a mesh. I’m not sure if the vertices are above or below the mesh. The idea was to use the Mesh|Ray component twice: once with a positive Z vector and once with a negative Z vector. Each vertex should have only one intersection. So, for each vertex, one Mesh|Ray should return a value while the other returns null. Then, I would add the two lists together to get all the intersections.

The issue arises when a polyline vertex is exactly on a mesh vertex. In that case, both Mesh|Ray components would return values simultaneously, creating complications in the addition process.
Refer to the table. Polyline {329} works as expected, but for polyline {330}, both ray and mesh components yield a solution at vertices 0, 2, and 10, indicating that the addition is clearly incorrect.

Do you have any suggestions on how I can solve this problem?

nobody?

When you don’t know whether the points are above or below, you can move the points away from the mesh first. Then all points can be projected in the same direction