def test_overlaps_xz_overlap(self): a = BoundingBox(0, 0, 0, 10, 10, 10) b = BoundingBox(5, 15, 9.5, 30, 30, 30) self.assertTrue(a.overlaps(b)) self.assertEqual(a.overlaps(b), b.overlaps(a)) a = BoundingBox(0, 0, 0, 10, 10, 10) b = BoundingBox(11, 15, 9.5, 30, 30, 30) self.assertFalse(a.overlaps(b)) self.assertEqual(a.overlaps(b), b.overlaps(a))
def test_overlaps_boxes_threshold(self): a = BoundingBox(0, 0, 0, 10, 10, 10) b = BoundingBox(9, 9, 9, 30, 30, 30) self.assertFalse(a.overlaps(b, threshold=5))
def test_overlaps_boxes_intersecting(self): a = BoundingBox(0, 0, 0, 10, 10, 10) b = BoundingBox(5, 4, 6, 30, 30, 30) self.assertTrue(a.overlaps(b)) self.assertEqual(a.overlaps(b), b.overlaps(a))
def test_overlaps_no_overlap(self): a = BoundingBox(0, 0, 0, 10, 10, 10) b = BoundingBox(20, 20, 20, 30, 30, 30) self.assertFalse(a.overlaps(b)) self.assertEqual(a.overlaps(b), b.overlaps(a))