()
| 995 | |
| 996 | |
| 997 | def test_offset(): |
| 998 | |
| 999 | f = plane(1, 1) |
| 1000 | s = box(1, 1, 1).shells() |
| 1001 | |
| 1002 | r1 = offset(f, 1) |
| 1003 | r2 = offset(s, -0.25) |
| 1004 | r3 = offset(f, 1, both=True) |
| 1005 | r4 = offset(f.moved((0, 0), (5, 5)), 1, both=True) |
| 1006 | |
| 1007 | assert r1.Volume() == approx(1) |
| 1008 | assert r2.Volume() == approx(1 - 0.5 ** 3) |
| 1009 | assert r3.Volume() == approx(2) |
| 1010 | assert r4.Volume() == approx(4) |
| 1011 | |
| 1012 | |
| 1013 | def test_offset2D(): |