Mesh: extend API to access edges of a facet via Python

This commit is contained in:
wmayer
2021-10-20 13:01:11 +02:00
parent ace0d32647
commit 124d06b7f7
14 changed files with 558 additions and 3 deletions

View File

@@ -69,3 +69,23 @@ void Facet::operator = (const Facet& f)
NIndex[i] = f.NIndex[i];
}
}
Edge Facet::getEdge(int index) const
{
index = index % 3;
Edge edge;
// geometric coordinates
edge._aclPoints[0] = this->_aclPoints[index];
edge._aclPoints[1] = this->_aclPoints[(index + 1) % 3];
// indices
edge.Index = index;
edge.PIndex[0] = this->PIndex[index];
edge.PIndex[1] = this->PIndex[(index + 1) % 3];
edge.NIndex[0] = this->Index;
edge.NIndex[1] = this->NIndex[index];
edge._bBorder = (this->NIndex[index] == MeshCore::FACET_INDEX_MAX);
edge.Mesh = this->Mesh;
return edge;
}