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 b7bb0a8e9e
commit 79d270cc0c
2 changed files with 5 additions and 3 deletions

View File

@@ -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).</UserDocu>
</Documentation>
</Methode>
<Methode Name="approximate" Const="true">
<Methode Name="approximate" Const="true" Keyword="true">
<Documentation>
<UserDocu>Approximate B-Spline-curve from this wire</UserDocu>
</Documentation>

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()));