add optional parameters to copy method to copy topology and/or triangulation
This commit is contained in:
@@ -539,7 +539,13 @@ into B-spline surfaces.</UserDocu>
|
||||
</Methode>
|
||||
<Methode Name="copy" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>Create a copy of this shape</UserDocu>
|
||||
<UserDocu>Create a copy of this shape
|
||||
copy(copyGeom=True, copyMesh=False) -> Shape
|
||||
If copyMesh is True, triangulation contained in original shape will be
|
||||
copied along with geometry.
|
||||
If copyGeom is False, only topological objects will be copied, while
|
||||
geometry and triangulation will be shared with original shape.
|
||||
</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="cleaned" Const="true">
|
||||
|
||||
@@ -143,7 +143,6 @@ int TopoShapePy::PyInit(PyObject* args, PyObject*)
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return -1;
|
||||
}
|
||||
@@ -156,7 +155,9 @@ int TopoShapePy::PyInit(PyObject* args, PyObject*)
|
||||
|
||||
PyObject* TopoShapePy::copy(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
PyObject* copyGeom = Py_True;
|
||||
PyObject* copyMesh = Py_False;
|
||||
if (!PyArg_ParseTuple(args, "|O!O!", &PyBool_Type, ©Geom, &PyBool_Type, ©Mesh))
|
||||
return NULL;
|
||||
|
||||
const TopoDS_Shape& shape = this->getTopoShapePtr()->getShape();
|
||||
@@ -171,7 +172,9 @@ PyObject* TopoShapePy::copy(PyObject *args)
|
||||
}
|
||||
|
||||
if (!shape.IsNull()) {
|
||||
BRepBuilderAPI_Copy c(shape);
|
||||
BRepBuilderAPI_Copy c(shape,
|
||||
PyObject_IsTrue(copyGeom) ? Standard_True : Standard_False,
|
||||
PyObject_IsTrue(copyMesh) ? Standard_True : Standard_False);
|
||||
static_cast<TopoShapePy*>(cpy)->getTopoShapePtr()->setShape(c.Shape());
|
||||
}
|
||||
return cpy;
|
||||
|
||||
Reference in New Issue
Block a user