m3sh.itertools.

faces_bfs#

faces_bfs(item, stop=None, start=1)#

Breadth-first face neighborhood iterator.

Breadth-first traversal of the face neighborhood of a mesh item. A face and a mesh item (a vertex, a halfedge, or another face) are considered neighbors is they share a vertex or an edge.

Parameters:
itemVertex or Halfedge or Face

The seed item.

stopint, optional

All faces at distance less or equal to stop are visited. If None, the search will continue until all faces of a connected component are visited.

startint, optional

Face reporting starts at the given distance level. Seed faces are not reported by default.

Yields:
Face

The next face in breadth-first search.

int

Distance to item.

Notes

The neighborhood relation used in breadth-first search is different for the one used by faces() where faces are considered neighbors if they share an edge. For instance, the faces at distance 1 to a seed face are all faces that share an edge or a vertex with the seed. This can be imagined as a ring of faces around the seed face. Consequently, the list

>>> [f for f in faces(seed)]

is different from

>>> [f for f in faces_bfs(seed, stop=1)]

Use fdual_bfs() to restrict the neighborhood relation to having a common edge.