def check_bb_intersection_on_values(min_b1, max_b1, min_b2, max_b2, used_check=lambda a, b: a >= b):
    """
    Checks if there is an intersection of the given bounding box values. Here we use two different bounding boxes,
    namely b1 and b2. Each of them has a corresponding set of min and max values, this works for 2 and 3 dimensional
    problems.

    :param min_b1: List of minimum bounding box points for b1.
    :param max_b1: List of maximum bounding box points for b1.
    :param min_b2: List of minimum bounding box points for b2.
    :param max_b2: List of maximum bounding box points for b2.
    :param used_check: The operation used inside of the is_overlapping1D. With that it possible to change the \
                       collision check from volume and surface check to pure surface or volume checks.
    :return: True if the two bounding boxes intersect with each other
    """
    collide = True
    for min_b1_val, max_b1_val, min_b2_val, max_b2_val in zip(min_b1, max_b1, min_b2, max_b2):
        # inspired by this:
        # https://stackoverflow.com/questions/20925818/algorithm-to-check-if-two-boxes-overlap
        # Checks in each dimension, if there is an overlap if this happens it must be an overlap in 3D, too.
        def is_overlapping_1D(x_min_1, x_max_1, x_min_2, x_max_2):
            # returns true if the min and max values are overlapping
            return used_check(x_max_1, x_min_2) and used_check(x_max_2, x_min_1)

        collide = collide and is_overlapping_1D(min_b1_val, max_b1_val, min_b2_val, max_b2_val)
    return collide