Mesh.vertex_neighbors

Mesh.vertex_neighbors(key, ordered=False)[source]

Return the neighbors of a vertex.

Parameters
  • key (int) – The identifier of the vertex.

  • ordered (bool, optional) – If True, return the neighbors in the cycling order of the faces.

Returns

list[int] – The list of neighboring vertices. If the vertex lies on the boundary of the mesh, an ordered list always starts and ends with with boundary vertices.

Notes

Due to the nature of the ordering algorithm, the neighbors cycle around the node in the opposite direction as the cycling direction of the faces. For some algorithms this produces the expected results. For others it doesn’t. For example, a dual mesh constructed relying on these conventions will have oposite face cycle directions compared to the original.