Part: [skip ci] simplify using Wire.approximate() by supporting keyword arguments and making all arguments optional

This commit is contained in:
wmayer
2020-02-17 15:39:21 +01:00
parent 48744aa9b5
commit 71ce2156f0
2 changed files with 5 additions and 3 deletions

View File

@@ -326,12 +326,14 @@ PyObject* TopoShapeWirePy::makeHomogenousWires(PyObject *args)
}
}
PyObject* TopoShapeWirePy::approximate(PyObject *args)
PyObject* TopoShapeWirePy::approximate(PyObject *args, PyObject *kwds)
{
double tol2d = gp::Resolution();
double tol3d = 0.0001;
int maxseg=10, maxdeg=3;
if (!PyArg_ParseTuple(args, "ddii",&tol2d,&tol3d,&maxseg,&maxdeg))
static char* kwds_approx[] = {"Tol2d","Tol3d","MaxSegments","MaxDegree",NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ddii", kwds_approx, &tol2d, &tol3d, &maxseg, &maxdeg))
return 0;
try {
BRepAdaptor_CompCurve adapt(TopoDS::Wire(getTopoShapePtr()->getShape()));