Separating a single mesh into several parts

Hi everyone, I have a model with many meshes in it, and I need to convert everything in it to just boxes and cylinders. However, I have several meshes that need to be split up into separate parts before they can be converted to boxes/cylinders, such as the one in the attached file. These are single meshes where lots of different box parts are all joined together.

I wonder if anyone can advise if there’s a way to do this with Grasshopper? I’ve tried separating the mesh by angle using Pufferfish, but this separated each face, whereas I need to have each box part of the mesh separated out. So in the attached file, the u-shape part would be converted to 2 vertical parts and 1 horizontal part. If anyone could help I would be very grateful. Thanks in advance!


mesh_test.3dm (157.3 KB)

Later you can use Galapagos to classify the vertical and horizontal elements.

Thanks a lot for your reply. I’ve not used Galapagos before - is there a particular component or method within Galapagos that I can use to classify the vertical and horizontal elements? If you have an example file that would be really helpful. Thanks again!