gustaf.utils.connec.sequentialize_edges#

gustaf.utils.connec.sequentialize_edges(edges, start=None, return_edges=False, directed=False)[source]#

Organize edge connectivities to describe polygon or a line. This supports edges that describes separated/individual polygons and lines. In other words, it doesn’t support edges of overlapping vertices.

Parameters:
  • edges ((n, 2) list-like)

  • start (int) – (Optional) Specify starting point. It will take minimum index otherwise.

  • return_edges (bool) – (Optional) Default is False. If set True, returns sequences as edges.

  • directed (bool) – (Optional) Default is False. Set True, if given edges are directed. It should return the result faster.

Returns:

  • sequences (list) – list of vertex ids. Or edges iff return_edges is True.

  • is_polygon (list) – Tells if the sequence is a polygon or a line.

Examples

>>> e = gus.Edges(vertices, edges)
>>> ordered_sequence, is_polygon = sequentialize_edges(e.edges)
>>> f = gus.Faces(vertices, faces)
>>> ordered_sequence, is_polygon = sequentialize_edges(
...     f.edges()[f.single_edges()]
... )