I have an obj file mesh and I want to extract connected components from it through OpenMesh. I can find boundary vertices and edges, but is there a way to directly split mesh into connected components in Openmesh ?
This functionality is not provided by OpenMesh (the goal of the library is only to provide a mesh data structure). The OpenFlipper, a mesh processing library built on top of OpenMesh, is a more suitable candidate but also does not provide this functionality. You can however find in the codebase in MeshTools/MeshInfoT.cc a componentCount
function that counts the number of connected components (it simply does a depth-first search on the vertex graph).
Based on this function, you should be able to write code to split a mesh into its connected components: