trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

Connected components takes hours in edge case

Open ElHouas opened this issue 2 years ago • 1 comments

Hello Mike,

Thanks for your fantastic work with Trimesh, it's a pleasure to work with it.

I've found myself in an edge case that I've been unable to solve and I'd like your input on that.

After a segmentation task, I get different plane regions that I post-process using trimesh. One of the steps is to get the connected components for each region through the unique edges.

ccos = trimesh.graph.connected_components(unique_edges, engine = 'scipy')

In this case, the algorithm took 2.5 h to finish due to it got stuck in this step when it couldn't resolve the connected components for each region.

Those regions are noise and I'd like to get rid of them. What would be your case to deal with this type of cases?

I attach a picture of the corrupted regions. corrupted_regions

Thanks for your time, Ismael

ElHouas avatar Jun 22 '23 13:06 ElHouas

Oh that's interesting, how many faces are there? Have you tried it with the networkx backend? I wonder if something about the topology is causing the sparse graph to explode.

mikedh avatar Jun 28 '23 19:06 mikedh