Split and remove overlapping internal faces of a mesh

Hello,
I am struggling in finding a good way/workflow to remove the internal/overlapping faces of a mesh like the one in the Fig. 1. The mesh represent an urban block where several buildings are touching each other. However many of them share part of walls which I would like to remove.

What I would like to have is just the exterior envelope of the urban block, without the internal faces (or part of faces).

At the moment I’m trying with an approach based on running a quick view-analysis (with LBT) which uses a test point at the center of each mesh-face and, if the result for a mesh-face is 0 (meaning no view to the scene/sky), it culls it out.
It works ok, however, depending on the orientation and the dimension of the triangular face, the center of the face might be inside of the mesh, thus resulting in the cull of the entire face (Fig. 2).

Do you have any solution for how this could be solved?
You find attached a simple file with the internalized geometry of the urban block.


Thank you in advance for your help,
Matteo

Urban_block_mesh.gh (28.8 KB)

Do you have all houses as individual meshes?

Hei, thanks for the quick reply.

Unfortunately I don’t.

You can shrinkwrap everything with a small offset. The only quick way to remove inner walls is by adding terrain and removing it from the shrinkwrapped houses.

How many times have we seen this?

Here is a way that does not work:

In my example, I removed a transformed bounding box. This could also be a twisted box or more accurate terrain.

Urban_block_mesh.gh (38.8 KB)

Hei, thank you all for the suggestions,
is the shinkwrap component only available in Rhino 8? I’m currently working on Rhino 7

Yes shrinkwrap is Rhino 8

Ok, thanks! I could be a good opportunity to test it out