improve mesh healing functions

This commit is contained in:
wmayer
2018-12-13 17:31:21 +01:00
parent 3b2c3b1d99
commit 9683abfc36
9 changed files with 237 additions and 7 deletions

View File

@@ -146,6 +146,25 @@ PyObject* FacetPy::isDegenerated(PyObject *args)
return Py::new_reference_to(Py::Boolean(tria.IsDegenerated(fEpsilon)));
}
PyObject* FacetPy::isDeformed(PyObject *args)
{
float fMinAngle;
float fMaxAngle;
if (!PyArg_ParseTuple(args, "ff", &fMinAngle, &fMaxAngle))
return NULL;
FacetPy::PointerType face = this->getFacetPtr();
if (!face->isBound()) {
throw Py::RuntimeError("Unbound facet");
}
float fCosOfMinAngle = cos(fMinAngle);
float fCosOfMaxAngle = cos(fMaxAngle);
const MeshCore::MeshKernel& kernel = face->Mesh->getKernel();
MeshCore::MeshGeomFacet tria = kernel.GetFacet(face->Index);
return Py::new_reference_to(Py::Boolean(tria.IsDeformed(fCosOfMinAngle, fCosOfMaxAngle)));
}
Py::List FacetPy::getPoints(void) const
{
FacetPy::PointerType face = this->getFacetPtr();