{
final PolygonWithHolesXZ polygon = area.getPolygon();
if (!line.isConnectedTo(area)) {
intersects = polygon.intersects(segmentXZ);
contains = !intersects && polygon.contains(segmentXZ);
} else {
/* check whether the line intersects the area somewhere