Added tests of the text feature

This commit is contained in:
adam-urbanczyk
2019-02-21 21:17:54 +01:00
parent a26b4017d5
commit e474c0ef6f

View File

@ -1800,3 +1800,17 @@ class TestCadQuery(BaseTest):
# The obj1 shape shall have the same volume as the obj2 shape.
self.assertAlmostEqual(obj1.val().Volume(), obj2.val().Volume())
def testText(self):
box = Workplane("XY" ).box(4, 4, 0.5)
obj1 = box.faces('>Z').workplane().text('CQ 2.0',0.5,-.05,cut=True)
#combined object should have smaller volume
self.assertGreater(box.val().Volume(),obj1.val().Volume())
obj2 = box.faces('>Z').workplane().text('CQ 2.0',0.5,.05,cut=False,combine=True)
#combined object should have bigger volume
self.assertLess(box.val().Volume(),obj2.val().Volume())