diff --git a/src/Mod/Part/App/TopoShapeWirePy.xml b/src/Mod/Part/App/TopoShapeWirePy.xml index 86d63f4837..96c37f4318 100644 --- a/src/Mod/Part/App/TopoShapeWirePy.xml +++ b/src/Mod/Part/App/TopoShapeWirePy.xml @@ -49,7 +49,7 @@ Make a loft defined by a list of profiles along a wire. Transition can be 0 (default), 1 (right corners) or 2 (rounded corners). - + Approximate B-Spline-curve from this wire diff --git a/src/Mod/Part/App/TopoShapeWirePyImp.cpp b/src/Mod/Part/App/TopoShapeWirePyImp.cpp index 8063b9e245..5522896ec8 100644 --- a/src/Mod/Part/App/TopoShapeWirePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeWirePyImp.cpp @@ -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()));