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 3b310cfdf2
commit cef86fb1ef
14 changed files with 558 additions and 3 deletions

View File

@@ -280,6 +280,25 @@ bool MeshGeomEdge::IntersectWithLine (const Base::Vector3f &rclPt,
return dist2 + dist3 <= dist1 + eps;
}
bool MeshGeomEdge::IsParallel(const MeshGeomEdge &edge) const
{
Base::Vector3f r(_aclPoints[1] - _aclPoints[0]);
Base::Vector3f s(edge._aclPoints[1] - edge._aclPoints[0]);
Base::Vector3f n = r.Cross(s);
return n.IsNull();
}
bool MeshGeomEdge::IsCollinear(const MeshGeomEdge &edge) const
{
if (IsParallel(edge)) {
Base::Vector3f r(_aclPoints[1] - _aclPoints[0]);
Base::Vector3f d = edge._aclPoints[0] - _aclPoints[0];
return d.Cross(r).IsNull();
}
return false;
}
bool MeshGeomEdge::IntersectWithEdge (const MeshGeomEdge &edge, Base::Vector3f &res) const
{
const float eps = 1e-06f;