compas.topology.face_adjacency

compas.topology.face_adjacency(xyz, faces)[source]

Construct an adjacency dictionary of the given faces, assuming that the faces have arbitrary orientation.

Parameters
  • xyz (list) – The coordinates of the face vertices.

  • faces (list) – The indices of the face vertices in the coordinates list.

Returns

dict – For every face a list of neighbouring faces.

Examples

>>> vertices = [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [1.0, 1.0, 0.0], [0.0, 1.0, 1.0]]
>>> faces = [[0, 1, 2], [0, 3, 2]]
>>> face_adjacency(vertices, faces)
{0: [1], 1: [0]}