Base: add overloaded method isIdentity() to Rotation and Placement that accepts a tolerance

This commit is contained in:
wmayer
2023-01-03 10:54:47 +01:00
parent 7cbecd46c7
commit f039789d0b
8 changed files with 57 additions and 37 deletions

View File

@@ -377,9 +377,11 @@ PyObject* RotationPy::isSame(PyObject *args)
PyObject* RotationPy::isIdentity(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
double tol = 0.0;
if (!PyArg_ParseTuple(args, "|d", &tol))
return nullptr;
bool null = getRotationPtr()->isIdentity();
bool null = tol > 0.0 ? getRotationPtr()->isIdentity(tol)
: getRotationPtr()->isIdentity();
return Py_BuildValue("O", (null ? Py_True : Py_False));
}