From efdbe4659aa82b32e5183896e3350d2380a68efb Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 17 Feb 2014 16:42:28 +0100 Subject: [PATCH] + fixes #0001418: Base::Matrix4d can't invert rotoinversion --- src/Base/MatrixPyImp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Base/MatrixPyImp.cpp b/src/Base/MatrixPyImp.cpp index e8d1625045a9..15aaac855cdb 100644 --- a/src/Base/MatrixPyImp.cpp +++ b/src/Base/MatrixPyImp.cpp @@ -341,7 +341,7 @@ PyObject* MatrixPy::invert(PyObject * args) return NULL; PY_TRY { - if (getMatrixPtr()->determinant() > DBL_EPSILON) + if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON) getMatrixPtr()->inverseGauss(); else { PyErr_SetString(PyExc_Exception, "Cannot invert singular matrix"); @@ -359,7 +359,7 @@ PyObject* MatrixPy::inverse(PyObject * args) return NULL; PY_TRY { - if (getMatrixPtr()->determinant() > DBL_EPSILON) { + if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON) { Base::Matrix4D m = *getMatrixPtr(); m.inverseGauss(); return new MatrixPy(m);