S2Shape.chain

Returns the range of edge ids corresponding to the given edge chain. The edge chains must form contiguous, non-overlapping ranges that cover the entire range of edge ids. This is spelled out more formally below:

REQUIRES: 0 <= i < num_chains() REQUIRES: chain(i).length >= 0, for all i REQUIRES: chain(0).start == 0 REQUIRES: chain(i).start + chain(i).length == chain(i+1).start, for i < num_chains() - 1 REQUIRES: chain(i).start + chain(i).length == num_edges(), for i == num_chains() - 1

class S2Shape
abstract const
chain
()
out (c) { assert (c.length >= 0); if (chain_id == numChains() - 1) { assert (c.start + c.length == numEdges()); } }

Meta