| 877 | |
| 878 | |
| 879 | def test_draft(box_shape): |
| 880 | |
| 881 | fbot = box_shape.face("<Z") |
| 882 | fside = box_shape.face("|X or |Y") |
| 883 | |
| 884 | # direction inferred from the normal of the base face |
| 885 | res1 = draft(box_shape, fbot, fside, 5) |
| 886 | assert res1.face(">Z").Area() > fbot.Area() |
| 887 | |
| 888 | # direction specified explicitly |
| 889 | res2 = draft(box_shape, fbot, fside, (0, 0, 1), 5) |
| 890 | assert res2.face(">Z").Area() < fbot.Area() |
| 891 | |
| 892 | # raise on unsupported face type |
| 893 | s = extrude(face(ellipse(2, 1)), (0, 0, 1)) |
| 894 | |
| 895 | with raises(ValueError): |
| 896 | draft(s, s.face("<Z"), s.face(">>Z[-2]"), 5) |
| 897 | |
| 898 | with raises(ValueError): |
| 899 | draft(s, s.face("<Z"), s.face(">>Z[-2]"), (0, 0, 1), 5) |
| 900 | |
| 901 | |
| 902 | def test_clean(): |