How to split a 3d model to multiple parts if it has multiple isolated parts

Hi,

I am developing a feature of analyzing 3d model files uploaded by users, I have imported them into BufferGeometry successfully.

Now I would like to get the number of isolated parts in the uploaded model. I appreciate if anyone can shed light on how to do it. Thank you very much.

BTW: I reckon I can separate isolated parts by checking if triangles intersect, can someone advise how to check if two triangles intersect?

My thinking is that you firstly create a function to identify vertices connected to a given vertex.
Then use this function to recognize another regions.

Thank you very much for your reply, yes this is a solution by grouping all related vertices to get the number of isolated parts.

This solution doesn’t solve two parts intersect, so if we want to check if there are isolated parts, maybe it better we do triangles intersects check, but this cost more calculation than vertices check. Anyway, you have answered my question, thanks a lot.

1 Like

Just my implementation
isolatedRegions