How to find a array

Hi all,
have someone any idea how a array could be found.
I tried rtree to find 2 nearest neighbours but i need also start and end of the array and also diffence between array with different distance.

Any idea how this could work.
Thanks for any idea

Hello,
What do you understand as an “array”? What is your goal? What type of geometry are you operating on? Is this a rhino specific question or rather in the broader scope if programming itself?