Testcase for symmetric extrusion

Added a test case for symmetric extrusion operation.
This commit is contained in:
adam-urbanczyk 2016-05-22 21:39:54 +02:00
parent 32160d16a2
commit 58683d0eb0

View File

@ -1387,3 +1387,27 @@ class TestCadQuery(BaseTest):
result =topOfLid.union(bottom)
self.saveModel(result)
def testExtrude(self):
"""
Test symmetric extrude
"""
r = 1.
h = 1.
decimal_places = 9.
#extrude symmetrically
s = Workplane("XY").circle(r).extrude(h,both=True)
top_face = s.faces(">Z")
bottom_face = s.faces("<Z")
#calculate the distance between the top and the bottom face
delta = top_face.val().Center().sub(bottom_face.val().Center())
self.assertTupleAlmostEquals(delta.toTuple(),
(0.,0.,2.*h),
decimal_places)