Mesh: [skip ci] allow to pass target number to Python function Mesh.decimate()

This commit is contained in:
wmayer
2020-05-03 15:25:48 +02:00
parent 3bef7ba7c9
commit 7a2e16ac9b

View File

@@ -1726,14 +1726,26 @@ PyObject* MeshPy::smooth(PyObject *args, PyObject *kwds)
PyObject* MeshPy::decimate(PyObject *args)
{
float fTol, fRed;
if (!PyArg_ParseTuple(args, "ff", &fTol,&fRed))
return NULL;
if (PyArg_ParseTuple(args, "ff", &fTol,&fRed)) {
PY_TRY {
getMeshObjectPtr()->decimate(fTol, fRed);
} PY_CATCH;
PY_TRY {
getMeshObjectPtr()->decimate(fTol, fRed);
} PY_CATCH;
Py_Return;
}
Py_Return;
PyErr_Clear();
int targetSize;
if (PyArg_ParseTuple(args, "i", &targetSize)) {
PY_TRY {
getMeshObjectPtr()->decimate(targetSize);
} PY_CATCH;
Py_Return;
}
PyErr_SetString(PyExc_ValueError, "decimate(tolerance=float, reduction=float) or decimate(targetSize=int)");
return nullptr;
}
PyObject* MeshPy::nearestFacetOnRay(PyObject *args)