diff --git a/src/Mod/Sketcher/App/SketchObjectPy.xml b/src/Mod/Sketcher/App/SketchObjectPy.xml index 4e892ba82e..3972336965 100644 --- a/src/Mod/Sketcher/App/SketchObjectPy.xml +++ b/src/Mod/Sketcher/App/SketchObjectPy.xml @@ -177,6 +177,11 @@ Increases the given BSpline Degree by a number of degrees + + + Increases or reduces the given BSpline knot multiplicity + + diff --git a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp index 6edb28fb5b..b6aa9a5529 100644 --- a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp @@ -1084,6 +1084,25 @@ PyObject* SketchObjectPy::increaseBSplineDegree(PyObject *args) Py_Return; } +PyObject* SketchObjectPy::modifyBSplineKnotMultiplicity(PyObject *args) +{ + int GeoId; + int knotIndex; + int multiplicity = 1; + + if (!PyArg_ParseTuple(args, "ii|i", &GeoId, &knotIndex, &multiplicity)) + return 0; + + if (this->getSketchObjectPtr()->modifyBSplineKnotMultiplicity(GeoId, knotIndex, multiplicity)==false) { + std::stringstream str; + str << "Multiplicity modification failed for: " << GeoId; + PyErr_SetString(PyExc_ValueError, str.str().c_str()); + return 0; + } + + Py_Return; +} + Py::Long SketchObjectPy::getConstraintCount(void) const { return Py::Long(this->getSketchObjectPtr()->Constraints.getSize());