Create rotation from any matrix
To help find a matrix components a decompose method is added to Matrix class
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
//#include <array>
|
||||
|
||||
// inclusion of the generated files (generated out of MatrixPy.xml)
|
||||
#include "RotationPy.h"
|
||||
@@ -351,6 +352,18 @@ PyObject* MatrixPy::hasScale(PyObject * args)
|
||||
Py::Module mod("FreeCAD");
|
||||
return Py::new_reference_to(mod.callMemberFunction("ScaleType", Py::TupleN(Py::Int(static_cast<int>(type)))));
|
||||
}
|
||||
PyObject* MatrixPy::decompose(PyObject * args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
auto ms = getMatrixPtr()->decompose();
|
||||
Py::Tuple tuple(4);
|
||||
for (int i=0; i<4; i++) {
|
||||
tuple.setItem(i, Py::Matrix(ms[i]));
|
||||
}
|
||||
return Py::new_reference_to(tuple);
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::nullify()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user