Part: fix TopoShapePy::optimalBoundingBox

This commit is contained in:
wmayer
2023-11-24 11:28:13 +01:00
committed by wwmayer
parent 5f3c6b6d1a
commit c18ecb1a9b
2 changed files with 6 additions and 1 deletions

View File

@@ -2671,8 +2671,9 @@ PyObject* TopoShapePy::optimalBoundingBox(PyObject *args)
{
PyObject* useT = Py_True;
PyObject* useS = Py_False;
if (!PyArg_ParseTuple(args, "|O!O!", &PyBool_Type, &PyBool_Type, &useT, &useS))
if (!PyArg_ParseTuple(args, "|O!O!", &PyBool_Type, &useT, &PyBool_Type, &useS)) {
return nullptr;
}
try {
TopoDS_Shape shape = this->getTopoShapePtr()->getShape();

View File

@@ -19,3 +19,7 @@ class RegressionTests(unittest.TestCase):
# We should now have empty list...
with self.assertRaises(IndexError):
result.pop()
def test_OptimalBox(self):
box = Part.makeBox(1, 1, 1)
self.assertTrue(box.optimalBoundingBox(True, False).isValid())