Group colliding objects into seperate branches

Hello, I would like to “group” all objects, that are colliding with each other into individual branches.

{0;0}: Object A, B, C
{0;1}: Object D,E,F
{0;2}: Object G,H,I

I tried it using the Collision Many|Many component, giving me the indices that are connected to each other. But I don´t know how to transfer this list into the structure given above. Thanks in advance!

If you will only deal with cases shown in your example the simplest way to do it is:

  1. Find centroids (Volume component)
  2. Project them to XY plane
  3. Group points by distance
  4. Use indices with List item component to get the proper branching.
1 Like

Thanks Jakinta, it works for me. There might be situations where the objects are not perfectly stacked on top of each other…Alternatives are welcome :slight_smile:

you can also use Clash to get something like item at index [current branch] clashes with items at index [items in that particular branch] (502.9 KB)

for instance at branch {7} : item at index 7 clashes with items at index 7 (itself), index 8 and index 11

In that case you can increase the group points radius until it meets your requirement.
But as I mentioned in previous post this is just the specific solution, far from general…

1 Like

The point-group component works well if I have mulitple groups. In the case shown above all projected points are absolutely equal but the point-group component returns two branches - why?!?

I came up with a better solution that fit my needs very well: