Mesh.face_adjacency

Mesh.face_adjacency()[source]

Build a face adjacency dict.

Parameters:
meshcompas.datastructures.Mesh

A mesh object.

Returns:
dict[int, list[int]]

A dictionary mapping face identifiers (keys) to lists of neighboring faces.

Notes

This algorithm is used primarily to unify the cycle directions of a given mesh. Therefore, the premise is that the topological information of the mesh is corrupt and cannot be used to construct the adjacency structure. The algorithm is thus purely geometrical, but uses a spatial indexing tree to speed up the search.