0000572: add a method to Part module to read BRep data from string
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5410 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
@@ -311,6 +311,30 @@ PyObject* TopoShapePy::exportBrep(PyObject *args)
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* TopoShapePy::importBrep(PyObject *args)
|
||||
{
|
||||
PyObject* input;
|
||||
if (!PyArg_ParseTuple(args, "O", &input))
|
||||
//char* input;
|
||||
//if (!PyArg_ParseTuple(args, "s", &input))
|
||||
return NULL;
|
||||
|
||||
try {
|
||||
// read brep
|
||||
Base::PyStreambuf buf(input);
|
||||
std::istream str(0);
|
||||
str.rdbuf(&buf);
|
||||
//std::stringstream str(input);
|
||||
getTopoShapePtr()->importBrep(str);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_Exception,e.what());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* TopoShapePy::exportStl(PyObject *args)
|
||||
{
|
||||
char* filename;
|
||||
|
||||
Reference in New Issue
Block a user