Testcase for symmetric extrusion
Added a test case for symmetric extrusion operation.
This commit is contained in:
parent
32160d16a2
commit
58683d0eb0
|
@ -1387,3 +1387,27 @@ class TestCadQuery(BaseTest):
|
||||||
result =topOfLid.union(bottom)
|
result =topOfLid.union(bottom)
|
||||||
|
|
||||||
self.saveModel(result)
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user