def test_3d_box_contains_2d_box(self): box_a = BoundingBox2d([(1, 1), (9, 9)]) # lives in the xy-plane, z-axis is 0 box_b = BoundingBox([(0, 0, 0), (10, 10, 10)]) assert box_b.contains(box_a) is True, "xy-plane is included" box_c = BoundingBox([(0, 0, 1), (10, 10, 10)]) assert box_c.contains(box_a) is False, "xy-plane is not included"
def test_contains_other_bounding_box(self): box_a = BoundingBox([(0, 0, 0), (10, 10, 10)]) box_b = BoundingBox([(1, 1, 1), (9, 9, 9)]) box_c = BoundingBox([(1, 1, 1), (11, 11, 11)]) assert box_a.contains(box_b) is True assert box_a.contains(box_a) is True # self contained assert box_b.contains(box_a) is False assert box_a.contains(box_c) is False