HalfEdge

HalfEdge

HalfEdge()

A half-edge in a graph that connects to one vertex, consisting of a direction (or None if undirected) and edge data.

Methods

Name Description
__new__ Create a new half-edge
data Get the data of the half-edge.
direction Get the direction of the half-edge
flip Return a new half-edge with the direction flipped (if it has a direction).

__new__

HalfEdge.__new__(data: Expression | int, direction: Optional[bool] = None)

Create a new half-edge. The data can be any expression, and the direction can be True (outgoing), False (incoming) or None (undirected).

data

HalfEdge.data() -> Expression

Get the data of the half-edge.

direction

HalfEdge.direction() -> Optional[bool]

Get the direction of the half-edge. True means outgoing, False means incoming, and None means undirected.

flip

HalfEdge.flip() -> HalfEdge

Return a new half-edge with the direction flipped (if it has a direction).