Find closest point in 2 directions from a given point


I have been trying to find solve this issue for some time - I know there is a way not too complicated - But have I been stuck for a while now.
So the idea is to find the closest point - it can be the point before or after - from a given point. If the point is not placed in the same “row” (since they are not in the same row actually) it should be ignored and not taken into consideration.
From there I need to create a line segment between them.

I have managed to find the “closest point” by using “points contained in a curve”, but sort them has been a pain.

Any ideas?
Thank you in advance.

GH -Closest start point in both (2.1 MB)

Upload GH?

1 Like

attached! Thanks for the reminder.

GH -Closest start point in both directions Edied (2.7 MB)

in the same “row”

What does this mean?
Not sure I understand your question.

GH -Closest start point in both (2.1 MB)

1 Like

Thank you for your feedback @Quan_Li.

I was having some issues trying to formulate my intentions. When I mention row - I meant similar Z values.

This is a great approach @Thomas!! Thank you for taking yout time to look at it.