* returns the minimum value of the given WedgeRelation for all such vertices
* (returning immediately if any wedge returns -1). Returns +1 if there are no
* intersections and no shared vertices.
*/
private int checkEdgeCrossings(S2Loop b, S2EdgeUtil.WedgeRelation relation) {
DataEdgeIterator it = getEdgeIterator(b.numVertices);
int result = 1;
// since 'this' usually has many more vertices than 'b', use the index on
// 'this' and loop over 'b'
for (int j = 0; j < b.numVertices(); ++j) {
S2EdgeUtil.EdgeCrosser crosser =
new S2EdgeUtil.EdgeCrosser(b.vertex(j), b.vertex(j + 1), vertex(0));
int previousIndex = -2;
for (it.getCandidates(b.vertex(j), b.vertex(j + 1)); it.hasNext(); it.next()) {
int i = it.index();
if (previousIndex != i - 1) {
crosser.restartAt(vertex(i));
}
previousIndex = i;
int crossing = crosser.robustCrossing(vertex(i + 1));