Union Multiple Cuboids

Hi everyone!!

I would like to combine multiple intersecting solids into one solid. (I have thousands of solids created by wall-duct intersections. In some cases would like to combine them)

1 intersects with 2
2 intersects with both 1 and 3
3 intersects with 4
4 intersects with 3

5
6
7 does not intersect anything.

I’ve checked a lot but couldn’t find a algorithm or a node for this kind of workflow.

Solid.ByUnion node

Hi Jacob,

Actually I was asking help for filtering and merging them.
I need to combine only intersecting solids. and if use only intersection I will get 4 intersections, and it will create 4 solids.

1st solid 1 and 2
2nd solid 1,2 and 3
3rd solid 2 and 3
4th solid 3 and 4

but I need only 1 solid.

in some cases maybe there will be 8 boxes side by side and intersecting each other, I want to get 1 solid.

I’ve tried list chop and does intersect nodes etc. but I couldn’t get the correct result

Here is one possible way…

1 Like

Hi kulkul thanks for your answer,

but I couldn’t figure it out.

I am trying to get;

a big solid for the first ones,
and 3 other solids.

If you have time could you please help me.

test.dyn (10.3 KB)

hi guys can you help me about this issue? this is a part of my script, I couldn’t figure out this part.

test1.dyn (20.9 KB)

Hi marcel thanks for your answer, but I am looking for a solution for finding intersecting elements, and merging them each other.

as shown in test.dyn file. I need to filter intersecting elements and combine them as 1 solid.

Whats wrong with @Kulkul 's method?
Do you need more information?

1 Like

for example I have 9 solids, some of them intersects each other and i am trying to get (combine intersecting ones) 5 solids as a results. kulkul’s methods is not working for this.

example.dyn (9.9 KB)

Are you sure? I just tested your example .dyn and it worked. After Geometry.Intersection you need to group solids which is closest and replace Empty.Lists with the ones which doesn’t intersect in your example above (2,3,4).

Good Luck!

what do you mean “you need to group solids which is closest” I couln’t find a way to do this. I will try it.