I have generated some random points on the xy plane. I want to connect a spline to the closest pairs but not having more than 1 spline connected any one point. I have used the "Find Close Points" node as it gives a list of all the closest points in order when used in conjunction with "Sort Numbers" node. I know that I should use the two elements of the first tuple at index zero and remove any tuples that had either the two elements in them and then removed tuples that have the either of the two elements at index 1 etc. Been trying all day with no joy hope someone can help. Would be great for loop node and script node example to compare! Thank you! Using animation nodes 2.2 Blender 2.93 beta
Here is the node tree:
The tricky part for me was the "recursion" which AN does with this reassign parameter.
and here is the result in action: https://youtu.be/9Fdx1kxaJgE
Following on from Chris's answer which he got the same result in a different way using the distance option in the "Find close points" node. I used the amount option in that node instead. Here is my node tree,