def bb_intersect(a,b):
    """Returns true if the bounding boxes (a[0]->a[1]) and (b[0]->b[1]) intersect"""
    amin,amax=a
    bmin,bmax=b
    return not any(q < u or v < p for (p,q,u,v) in zip(amin,amax,bmin,bmax))