def box_overlay(a, b):
"""Checking overlay by bounds (minx, miny, maxx, maxy)
"""
# for i, j in product([0, 2], [1, 3]):
# px, py = (b1[i], b1[j])
# if b2[0] <= px <= b2[2] and b2[1] <= py <= b2[3]:
# return True
# return False
bbox1 = box(a[0], a[1], a[2], a[3])
bbox2 = box(b[0], b[1], b[2], b[3])
return bbox1.intersects(bbox2)
评论列表
文章目录