add python binding of OCC defeaturing
This commit is contained in:
@@ -2650,6 +2650,33 @@ PyObject* TopoShapePy::optimalBoundingBox(PyObject *args)
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* TopoShapePy::defeaturing(PyObject *args)
|
||||
{
|
||||
PyObject *l;
|
||||
if (!PyArg_ParseTuple(args, "O",&l))
|
||||
return NULL;
|
||||
|
||||
try {
|
||||
Py::Sequence list(l);
|
||||
std::vector<TopoDS_Shape> shapes;
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
Py::TopoShape sh(*it);
|
||||
shapes.push_back(
|
||||
sh.extensionObject()->getTopoShapePtr()->getShape()
|
||||
);
|
||||
}
|
||||
PyTypeObject* type = this->GetType();
|
||||
PyObject* inst = type->tp_new(type, this, 0);
|
||||
static_cast<TopoShapePy*>(inst)->getTopoShapePtr()->setShape
|
||||
(this->getTopoShapePtr()->defeaturing(shapes));
|
||||
return inst;
|
||||
}
|
||||
catch (const Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// End of Methods, Start of Attributes
|
||||
|
||||
#if 0 // see ComplexGeoDataPy::Matrix which does the same
|
||||
|
||||
Reference in New Issue
Block a user