public SectorLinearCrossingEdgeIterator(final GeoPoint testPoint, final Plane plane, final Plane abovePlane, final Plane belowPlane, final double thePointX, final double thePointY, final double thePointZ) { assert plane.evaluateIsZero(thePointX, thePointY, thePointZ) : "Check point is not on travel plane"; assert plane.evaluateIsZero(testPoint) : "Test point is not on travel plane"; this.testPoint = testPoint; this.plane = plane; this.abovePlane = abovePlane; this.belowPlane = belowPlane; // We have to be sure we don't accidently create two bounds that would exclude all points. // Not sure this can happen but... final SidedPlane bound1Plane = new SidedPlane(thePointX, thePointY, thePointZ, plane, testPoint); final SidedPlane bound2Plane = new SidedPlane(testPoint, plane, thePointX, thePointY, thePointZ); if (bound1Plane.isNumericallyIdentical(bound2Plane)) { throw new IllegalArgumentException("Sector iterator unreliable when bounds planes are numerically identical"); } this.bound1 = bound1Plane; this.bound2 = bound2Plane; this.thePointX = thePointX; this.thePointY = thePointY; this.thePointZ = thePointZ; //System.out.println(" Constructing sector linear crossing edge iterator"); //debugIntersectAllEdges(plane, bound1, bound2); }
final SidedPlane edge = edges[edgeIndex]; int bound1Index = legalIndex(edgeIndex+1); while (edges[bound1Index].isNumericallyIdentical(edge)) { if (bound1Index == edgeIndex) { throw new IllegalArgumentException("Constructed planes are all coplanar: "+points); while (edges[bound2Index].isNumericallyIdentical(edge)) { if (bound2Index == edgeIndex) { throw new IllegalArgumentException("Constructed planes are all coplanar: "+points);
final SidedPlane invertedEdge = invertedEdges[edgeIndex]; int bound1Index = legalIndex(edgeIndex+1); while (invertedEdges[bound1Index].isNumericallyIdentical(invertedEdge)) { if (bound1Index == edgeIndex) { throw new IllegalArgumentException("Constructed planes are all coplanar: "+points); while (invertedEdges[bound2Index].isNumericallyIdentical(invertedEdge)) { if (bound2Index == edgeIndex) { throw new IllegalArgumentException("Constructed planes are all coplanar: "+points);