[Sketcher] Add insertBSplineKnot to SketcherObject

[Sketcher] Workaround for segfault on knot insertion
This commit is contained in:
Ajinkya Dahale
2021-12-28 21:10:41 -05:00
committed by abdullahtahiriyo
parent ff2e246a55
commit 07cad4ab64
4 changed files with 189 additions and 2 deletions

View File

@@ -1551,6 +1551,25 @@ PyObject* SketchObjectPy::modifyBSplineKnotMultiplicity(PyObject *args)
Py_Return;
}
PyObject* SketchObjectPy::insertBSplineKnot(PyObject *args)
{
int GeoId;
double knotParam;
int multiplicity = 1;
if (!PyArg_ParseTuple(args, "id|i", &GeoId, &knotParam, &multiplicity))
return 0;
if (this->getSketchObjectPtr()->insertBSplineKnot(GeoId, knotParam, multiplicity)==false) {
std::stringstream str;
str << "Knot insertion failed for: " << GeoId;
PyErr_SetString(PyExc_ValueError, str.str().c_str());
return 0;
}
Py_Return;
}
PyObject* SketchObjectPy::autoconstraint(PyObject *args)
{
double precision = Precision::Confusion() * 1000;