Skip to content

Commit

Permalink
Add rotateAboutCenter regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzncode committed Feb 6, 2022
1 parent ccc8292 commit 9e74c8f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_cadquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ def testRotate(self):
self.assertEqual(-0.5, endPoint[1])
self.assertEqual(2.5, endPoint[2])

def testRotateAboutCenter(self):
r = Workplane().box(1, 1, 1).rotateAboutCenter((1, 0, 0), 20)
assert len(r.edges("|X").vals()) == 4
assert r.faces(">X").vertices("<Y").val().Center().toTuple() == approx(
(0.5, -0.6408563820557885, 0.2988362387301199)
)

def testPlaneRotateZNormal(self):
"""
Rotation of a plane in the Z direction should never alter its normal.
Expand Down

0 comments on commit 9e74c8f

Please sign in to comment.