| 1011 | |
| 1012 | |
| 1013 | def test_offset2D(): |
| 1014 | |
| 1015 | c = circle(1) |
| 1016 | seg = segment((0, 0), (1, 1)) |
| 1017 | ctx = plane() |
| 1018 | |
| 1019 | # simple offset |
| 1020 | r1 = offset2D(c, 0.1) |
| 1021 | |
| 1022 | # offset with a context |
| 1023 | r2 = offset2D(seg, 0.2, ctx) |
| 1024 | |
| 1025 | # offset that is not closed |
| 1026 | r3 = offset2D(seg, -0.3, ctx, closed=False) |
| 1027 | |
| 1028 | assert r1.isValid() |
| 1029 | assert len(clean(r1).Edges()) == 1 |
| 1030 | assert face(r1).isValid() |
| 1031 | |
| 1032 | assert r2.isValid() |
| 1033 | assert len(clean(r2).Edges()) == 4 |
| 1034 | assert face(r2).isValid() |
| 1035 | |
| 1036 | assert r3.isValid() |
| 1037 | assert len(clean(r3).Edges()) == 1 |
| 1038 | assert r3.edge().Length() == approx(seg.Length()) |
| 1039 | |
| 1040 | |
| 1041 | def test_fillet2D(): |