connected_components#

iskra.topology.connected_components(n_vertices: int, faces: Tensor) tuple[int, Tensor, Tensor][SOURCE]#

Finds the connected components of a mesh.

Tip

The faces can be of arbitrary dimension. Tets, triangles, and edges all work.

Warning

This function is executed on the CPU.

Parameters:
  • n_vertices (int) – Number of vertices in your mesh.

  • faces (Tensor[Int64, [F, FV]]) – Face-vertex indices.

Returns:
  • n_components (int) – Number of connected components in the mesh.

  • vertex_labels (Tensor[Int64, [V]]) – Integer labels signifying the connected component of each vertex.

  • face_labels (Tensor[Int64, [F]]) – Integer labels signifying the connected component of each face.