Tests BoundBox.enlarge(). Confirms that the bounding box lengths are all enlarged by the correct amount.
(self)
| 1800 | self.assertAlmostEqual(100.0, bb.zmax, 2) |
| 1801 | |
| 1802 | def testBoundBoxEnlarge(self): |
| 1803 | """ |
| 1804 | Tests BoundBox.enlarge(). Confirms that the |
| 1805 | bounding box lengths are all enlarged by the |
| 1806 | correct amount. |
| 1807 | """ |
| 1808 | |
| 1809 | enlarge_tol = 2.0 |
| 1810 | bb = Workplane("XY").rect(10, 10).extrude(10).val().BoundingBox() |
| 1811 | bb_enlarged = bb.enlarge(enlarge_tol) |
| 1812 | |
| 1813 | self.assertTrue(bb_enlarged.isInside(bb)) |
| 1814 | self.assertAlmostEqual(bb_enlarged.xmin, bb.xmin - enlarge_tol, 2) |
| 1815 | self.assertAlmostEqual(bb_enlarged.xmax, bb.xmax + enlarge_tol, 2) |
| 1816 | self.assertAlmostEqual(bb_enlarged.ymin, bb.ymin - enlarge_tol, 2) |
| 1817 | self.assertAlmostEqual(bb_enlarged.ymax, bb.ymax + enlarge_tol, 2) |
| 1818 | self.assertAlmostEqual(bb_enlarged.zmin, bb.zmin - enlarge_tol, 2) |
| 1819 | self.assertAlmostEqual(bb_enlarged.zmax, bb.zmax + enlarge_tol, 2) |
| 1820 | |
| 1821 | def testCutThroughAll(self): |
| 1822 | """ |