MCPcopy Index your code
hub / github.com/CadQuery/cadquery / test_offset

Function test_offset

tests/test_free_functions.py:997–1010  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

995
996
997def 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
1013def test_offset2D():

Callers

nothing calls this directly

Calls 6

planeFunction · 0.85
boxFunction · 0.85
offsetFunction · 0.85
VolumeMethod · 0.80
shellsMethod · 0.45
movedMethod · 0.45

Tested by

no test coverage detected