Function S2Shape.chainPosition

Finds the chain containing the given edge, and returns the position of that edge as a (chain_id, offset) pair.

abstract S2Shape.ChainPosition chainPosition (
  int edge_id
) const;

REQUIRES

shape.chain(pos.chain_id).start + pos.offset == edge_id

REQUIRES

shape.chain(pos.chain_id + 1).start > edge_id

where pos == shape.chain_position(edge_id).