@staticmethod
def _bound_rect_in_dist(bound_pts1, bound_pts2, distance):
    """Check if the bounding rectangles of two footprints overlap within a distance.

        Checking the overlap of the bounding rectangels is extremely quick given this
        method's use of the Separating Axis Theorem.

        Args:
            bound_pts1: An array of Point2Ds (min, center, max) for the first footprint.
            bound_pts2: An array of Point2Ds (min, center, max) for the second footprint.
            distance: Acceptable distance between the two bounding rectangles.
        """
    polygon1_width = bound_pts1[2].x - bound_pts1[0].x
    polygon2_width = bound_pts2[2].x - bound_pts2[0].x
    dist_btwn_x = abs(bound_pts1[1].x - bound_pts2[1].x)
    x_gap_btwn_rect = dist_btwn_x - 0.5 * polygon1_width - 0.5 * polygon2_width
    polygon1_height = bound_pts1[2].y - bound_pts1[0].y
    polygon2_height = bound_pts2[2].y - bound_pts2[0].y
    dist_btwn_y = abs(bound_pts1[1].y - bound_pts2[1].y)
    y_gap_btwn_rect = (dist_btwn_y - 0.5 * polygon1_height - 0.5 *
        polygon2_height)
    if x_gap_btwn_rect > distance or y_gap_btwn_rect > distance:
        return False
    return True
