FEM: Add faces by face workaround for force constraint
This commit is contained in:
@@ -575,6 +575,37 @@ PyObject* FemMeshPy::setTransform(PyObject *args)
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
|
||||
PyObject* FemMeshPy::getFacesByFace(PyObject *args)
|
||||
{
|
||||
PyObject *pW;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeFacePy::Type), &pW))
|
||||
return 0;
|
||||
|
||||
try {
|
||||
const TopoDS_Shape& sh = static_cast<Part::TopoShapeFacePy*>(pW)->getTopoShapePtr()->_Shape;
|
||||
if (sh.IsNull()) {
|
||||
PyErr_SetString(Base::BaseExceptionFreeCADError, "Face is empty");
|
||||
return 0;
|
||||
}
|
||||
|
||||
const TopoDS_Face& fc = TopoDS::Face(sh);
|
||||
|
||||
Py::List ret;
|
||||
std::list<int> resultSet = getFemMeshPtr()->getFacesByFace(fc);
|
||||
for (std::list<int>::const_iterator it = resultSet.begin();it!=resultSet.end();++it) {
|
||||
ret.append(Py::Int(*it));
|
||||
}
|
||||
|
||||
return Py::new_reference_to(ret);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
PyErr_SetString(Base::BaseExceptionFreeCADError, e->GetMessageString());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* FemMeshPy::getVolumesByFace(PyObject *args)
|
||||
{
|
||||
PyObject *pW;
|
||||
|
||||
Reference in New Issue
Block a user