MCPcopy
hub / github.com/CadQuery/cadquery / test_draft

Function test_draft

tests/test_free_functions.py:879–899  ·  view source on GitHub ↗
(box_shape)

Source from the content-addressed store, hash-verified

877
878
879def 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
902def test_clean():

Callers

nothing calls this directly

Calls 6

draftFunction · 0.85
extrudeFunction · 0.85
faceFunction · 0.85
ellipseFunction · 0.85
faceMethod · 0.45
AreaMethod · 0.45

Tested by

no test coverage detected