if (isDone) return;
}
}
private Coordinate intersection(PlanarPolygon3D poly,LineString line) {
CoordinateSequence seq = line.getCoordinateSequence();
if (seq.size() == 0)
return null;
// start point of line
Coordinate p0 = new Coordinate();
seq.getCoordinate(0, p0);
double d0 = poly.getPlane().orientedDistance(p0);
// for each segment in the line
Coordinate p1 = new Coordinate();
for (int i = 0; i < seq.size() - 1; i++) {
seq.getCoordinate(i, p0);
seq.getCoordinate(i + 1, p1);
double d1 = poly.getPlane().orientedDistance(p1);
/**
* If the oriented distances of the segment endpoints have the same sign,
* the segment does not cross the plane, and is skipped.