docs: private static boolean polylineCrossesEnvelope_(Polyline polyline_a,
  			Envelope envelope_b, double tolerance,
  			ProgressTracker progress_tracker) {
  		Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();
  		polyline_a.queryEnvelope2D(env_a);
  		envelope_b.queryEnvelope2D(env_b);
  
  		if (envelopeInfContainsEnvelope_(env_b, env_a, tolerance))
  			return false;
  
  		if (env_b.getHeight() <= tolerance && env_b.getWidth() <= tolerance)
  			return false; // when treated as a point, lines cannot cross points.
  
  		if (env_b.getHeight() <= tolerance || env_b.getWidth() <= tolerance) {// Treat
  																				// as
  																				// polyline
  			Polyline polyline_b = new Polyline();
  			Point p = new Point();
  			envelope_b.queryCornerByVal(0, p);
  			polyline_b.startPath(p);
  			envelope_b.queryCornerByVal(2, p);
  			polyline_b.lineTo(p);
  			return polylineCrossesPolyline_(polyline_a, polyline_b, tolerance,
  					progress_tracker);
  		}
  
  		// Treat env_b as area
  
  		SegmentIterator seg_iter_a = polyline_a.querySegmentIterator();
  		Envelope2D env_b_inflated = new Envelope2D(), env_b_deflated = new Envelope2D();
  		env_b_deflated.setCoords(env_b);
  		env_b_inflated.setCoords(env_b);
  		env_b_deflated.inflate(-tolerance, -tolerance);
  		env_b_inflated.inflate(tolerance, tolerance);
  
  		boolean b_interior = false, b_exterior = false;
  		Envelope2D env_segment_a = new Envelope2D();
  		Envelope2D env_inter = new Envelope2D();
  
  		while (seg_iter_a.nextPath()) {
  			while (seg_iter_a.hasNextSegment()) {
  				Segment segment_a = seg_iter_a.nextSegment();
  				segment_a.queryEnvelope2D(env_segment_a);
  
  				if (!b_exterior) {
  					if (!env_b_inflated.contains(env_segment_a))
  						b_exterior = true;
  				}
  
  				if (!b_interior) {
  					env_inter.setCoords(env_b_deflated);
  					env_inter.intersect(env_segment_a);
  
  					if (!env_inter.isEmpty()
  							&& (env_inter.getHeight() > tolerance || env_inter
  									.getWidth() > tolerance))
  						b_interior = true;
  				}
  
  				if (b_interior && b_exterior)
  					return true;
  			}
  		}
  
  		return false;
  	}