From 7c11ad0fb6913d08642226e24bb4543ff93fe3dc Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 24 Nov 2023 11:28:13 +0100 Subject: [PATCH] Part: fix TopoShapePy::optimalBoundingBox --- src/Mod/Part/App/TopoShapePyImp.cpp | 3 ++- src/Mod/Part/parttests/regression_tests.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index 1be94ad5e2..e3e1de4c7d 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -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(); diff --git a/src/Mod/Part/parttests/regression_tests.py b/src/Mod/Part/parttests/regression_tests.py index 052fdc2575..f58d48f890 100644 --- a/src/Mod/Part/parttests/regression_tests.py +++ b/src/Mod/Part/parttests/regression_tests.py @@ -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())