()
| 118 | |
| 119 | |
| 120 | def test_rectangle_relations(): |
| 121 | |
| 122 | i = Interval(4, 5, axis="y") |
| 123 | q = Quadrilateral(np.array([[2, 2], [6, 2], [6, 7], [2, 5]])) |
| 124 | r = Rectangle(3, 3, 5, 6) |
| 125 | |
| 126 | assert not r.is_in(q) |
| 127 | assert r.is_in(q, soft_margin={"bottom": 1}) |
| 128 | assert r.is_in(q.to_rectangle()) |
| 129 | assert r.is_in(q.to_interval(axis="x")) |
| 130 | |
| 131 | # convert to absolute then convert back to relative |
| 132 | assert r.condition_on(i).relative_to(i) == r |
| 133 | assert r.condition_on(r).relative_to(r) == r |
| 134 | assert r.condition_on(q).relative_to(q) == r.to_quadrilateral() |
| 135 | |
| 136 | # convert to relative then convert back to absolute |
| 137 | assert r.relative_to(i).condition_on(i) == r |
| 138 | assert r.relative_to(r).condition_on(r) == r |
| 139 | assert r.relative_to(q).condition_on(q) == r.to_quadrilateral() |
| 140 | |
| 141 | |
| 142 | def test_quadrilateral_relations(): |
nothing calls this directly
no test coverage detected