Base: fix Matrix4D::hasScale
* If all column vectors of the 3x3 sub-matrix are equal the function incorrectly claims that it's uniform scaling. * Detect also non-uniform scaling and if was applied from the left or right side * Replace the int with an enum and expose it to Python * Add several new unit tests
This commit is contained in:
@@ -351,7 +351,10 @@ PyObject* MatrixPy::hasScale(PyObject * args)
|
||||
double tol=0;
|
||||
if (!PyArg_ParseTuple(args, "|d", &tol))
|
||||
return nullptr;
|
||||
return Py::new_reference_to(Py::Int(getMatrixPtr()->hasScale(tol)));
|
||||
|
||||
ScaleType type = getMatrixPtr()->hasScale(tol);
|
||||
Py::Module mod("FreeCAD");
|
||||
return Py::new_reference_to(mod.callMemberFunction("ScaleType", Py::TupleN(Py::Int(static_cast<int>(type)))));
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::nullify(PyObject * args)
|
||||
|
||||
Reference in New Issue
Block a user