Graph.getDirectedLoops

Builds loops from a set of directed edges, turning left at each vertex until either a repeated vertex (for LoopType::SIMPLE) or a repeated edge (for LoopType::CIRCUIT) is found. (Use LoopType::SIMPLE if you intend to construct an S2Loop.)

Each loop is represented as a sequence of edges. The edge ordering and loop ordering are automatically canonicalized in order to preserve the input ordering as much as possible. Loops are non-crossing provided that the graph contains no crossing edges. If some edges cannot be turned into loops, returns false and sets "error" appropriately.

If any degenerate edges are present, then each such edge is treated as a separate loop. This is mainly useful in conjunction with options.degenerate_edges() == DISCARD_EXCESS, in order to build polygons that preserve degenerate geometry.

REQUIRES: options.degenerate_edges() == {DISCARD, DISCARD_EXCESS} REQUIRES: options.edge_type() == DIRECTED

class Graph
const
bool
getDirectedLoops

Meta