Function 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:

abstract S2Shape.Chain chain (
  int chain_id
) const;

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