S2PolylineSimplifier.avoidDisc

Requires that the output edge must avoid the given disc. "disc_on_left" specifies whether the disc must be to the left or right of the edge. (This feature allows the simplified edge to preserve the topology of the original polyline with respect to other nearby points.)

If your input is a polyline, you can compute "disc_on_left" as follows. Let the polyline be ABCDE and assume that it already avoids a set of points X_i. Suppose that you have aleady added ABC to the simplifer, and now want to extend the edge chain to D. First find the X_i that are near the edge CD, then discard the ones such that AX_i <= AC or AX_i >= AD (since these points have either already been considered or aren't relevant yet). Now X_i is to the left of the polyline if and only if s2pred::OrderedCCW(A, D, X, C) (in other words, if X_i is to the left of the angle wedge ACD).

class S2PolylineSimplifier
bool
avoidDisc

Meta