2 x11, y11, z11, x12, y12, z12 = box1
7 x21, y21, z21, x22, y22, z22 = box2
12 if ((x11 <= x22
and x12 >= x21)
and 13 (y11 <= y22
and y12 >= y21)
and 14 (z11 <= z22
and z12 >= z21)):
16 dim_x3 = min(x12, x22) - max(x11, x21)
17 dim_y3 = min(y12, y22) - max(y11, y21)
18 dim_z3 = min(z12, z22) - max(z11, z21)
20 dim_x3 = dim_y3 = dim_z3 = 0
22 intersect = dim_x3 * dim_y3 * dim_z3
23 union = (dim_x1 * dim_y1 * dim_z1) + (dim_x2 * dim_y2 * dim_z2) - intersect
24 iu = 1. * intersect / union
26 return iu, intersect, union
def get_overlap_of_aabb(box1, box2, return_volumes=False)