checkInteriorIntersectionsWithIndex method

void checkInteriorIntersectionsWithIndex(
  1. SegmentString e0,
  2. int segIndex0,
  3. SegmentString e1,
  4. int segIndex1,
)

Implementation

void checkInteriorIntersectionsWithIndex(
    SegmentString e0, int segIndex0, SegmentString e1, int segIndex1) {
  if (e0 == e1 && segIndex0 == segIndex1) return;
//numTests++;
  Coordinate p00 = e0.getCoordinates()[segIndex0];
  Coordinate p01 = e0.getCoordinates()[segIndex0 + 1];
  Coordinate p10 = e1.getCoordinates()[segIndex1];
  Coordinate p11 = e1.getCoordinates()[segIndex1 + 1];

  li.computeIntersection(p00, p01, p10, p11);
  if (li.hasIntersection()) {
    if (li.isProper() ||
        hasInteriorIntersection(li, p00, p01) ||
        hasInteriorIntersection(li, p10, p11)) {
      throw new RuntimeException("found non-noded intersection at " +
          p00.toString() +
          "-" +
          p01.toString() +
          " and " +
          p10.toString() +
          "-" +
          p11.toString());
    }
  }
}