HalfEdge.vertices_where_predicate

HalfEdge.vertices_where_predicate(predicate, data=False)[source]

Get vertices for which a certain condition or set of conditions is true using a lambda function.

Parameters
  • predicate (callable) – The condition you want to evaluate. The callable takes 2 parameters: the vertex identifier and the vertex attributes, and should return True or False.

  • data (bool, optional) – If True, yield the vertex attributes in addition to the vertex identifiers.

Yields

int | tuple[int, dict[str, Any]] – If data is False, the next vertex that matches the condition. If data is True, the next vertex and its attributes.

Examples

>>>