diff --git a/src/Base/RotationPy.xml b/src/Base/RotationPy.xml index 9e30199cf6..4bac43b9ae 100644 --- a/src/Base/RotationPy.xml +++ b/src/Base/RotationPy.xml @@ -73,7 +73,7 @@ - + toEuler(Vector) -> list @@ -82,6 +82,14 @@ + + + + toMatrix() + convert the rotation to a matrix representation + + + diff --git a/src/Base/RotationPyImp.cpp b/src/Base/RotationPyImp.cpp index 98585530c3..e38985e50c 100644 --- a/src/Base/RotationPyImp.cpp +++ b/src/Base/RotationPyImp.cpp @@ -270,6 +270,15 @@ PyObject* RotationPy::toEuler(PyObject * args) return Py::new_reference_to(tuple); } +PyObject* RotationPy::toMatrix(PyObject * args) +{ + if (!PyArg_ParseTuple(args, "")) + return NULL; + Base::Matrix4D mat; + getRotationPtr()->getValue(mat); + return new MatrixPy(new Matrix4D(mat)); +} + PyObject* RotationPy::isSame(PyObject *args) { PyObject *rot;