Is there a way to avoid overlapping or intersection for randomly distributed objects with Animation Nodes? I distrubuted objects with instancer and the loop function see below:



As we can see the problem is they are overlapping occasionally. Of course, the more object I distribute the more likely they overlap. My first idea was to use the Intersect Plane Plane node but I didn't know how to incorporate it into the graph. To avoid overlapping we should also measure distance between objects to limit the calculations (only adjacent objects matters) because otherwise the node graph could be very slow. So the soulution might be very comlex.

The current graph can be seen below:
I don't have a solution that is not computationally expensive. But if performance is not a big factor in your node tree, here is method you can use.

Append Condition

You create an empty vector list, at each iteration, you construct a KD tree from this list, generate a a random vector, check if there are any vectors in the vicinity of radius equal to circles diameter, if there are, don't append it, otherwise, append the random vector:



Blend File: