FEM: Add faces by face workaround for force constraint

This commit is contained in:
Stefan Tröger
2016-05-16 09:00:25 +02:00
committed by wmayer
parent 55534e98d4
commit aae79ee558
6 changed files with 75 additions and 30 deletions

View File

@@ -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;