Sketcher: ConverttoNURBS python implementation

This commit is contained in:
Abdullah Tahiri 2017-02-16 22:39:34 +01:00 committed by wmayer
parent ce7e186049
commit 4abe462a41
2 changed files with 24 additions and 1 deletions

View File

@ -156,7 +156,12 @@
<Documentation>
<UserDocu>Deletes all unused (not further constrained) internal geometry</UserDocu>
</Documentation>
</Methode>
</Methode>
<Methode Name="ConvertToNURBS">
<Documentation>
<UserDocu>Approximates the given geometry with a B-Spline</UserDocu>
</Documentation>
</Methode>
<Methode Name="calculateAngleViaPoint">
<Documentation>
<UserDocu>

View File

@ -998,6 +998,24 @@ PyObject* SketchObjectPy::DeleteUnusedInternalGeometry(PyObject *args)
Py_Return;
}
PyObject* SketchObjectPy::ConvertToNURBS(PyObject *args)
{
int GeoId;
if (!PyArg_ParseTuple(args, "i", &GeoId))
return 0;
if (this->getSketchObjectPtr()->ConvertToNURBS(GeoId)==false) {
std::stringstream str;
str << "Object does not support NURBS conversion: " << GeoId;
PyErr_SetString(PyExc_ValueError, str.str().c_str());
return 0;
}
Py_Return;
}
Py::Int SketchObjectPy::getConstraintCount(void) const
{
return Py::Int(this->getSketchObjectPtr()->Constraints.getSize());