MCPcopy Index your code
hub / github.com/CadQuery/cadquery / testBoundBoxEnlarge

Method testBoundBoxEnlarge

tests/test_cadquery.py:1802–1819  ·  view source on GitHub ↗

Tests BoundBox.enlarge(). Confirms that the bounding box lengths are all enlarged by the correct amount.

(self)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 7

WorkplaneClass · 0.85
extrudeMethod · 0.80
enlargeMethod · 0.80
BoundingBoxMethod · 0.45
valMethod · 0.45
rectMethod · 0.45
isInsideMethod · 0.45

Tested by

no test coverage detected