OCC - Handle internal (forward+reversed) edges correctly

This commit is contained in:
Matthias Hochsteger 2023-06-05 11:24:52 +02:00
parent 971f7c6b07
commit 3e9eba7906

View File

@ -63,7 +63,7 @@ namespace netgen
auto & orientation = edge_orientation[edgenr];
double s0, s1;
auto cof = BRep_Tool::CurveOnSurface (edge, face, s0, s1);
if(edge.Orientation() == TopAbs_FORWARD)
if(edge.Orientation() == TopAbs_FORWARD || edge.Orientation() == TopAbs_INTERNAL)
{
curve_on_face[FORWARD][edgenr] = cof;
orientation += FORWARD;
@ -75,6 +75,15 @@ namespace netgen
orientation += REVERSED;
edge_on_face[REVERSED][edgenr] = edge;
}
if(edge.Orientation() == TopAbs_INTERNAL)
{
// add reversed edge
auto r_edge = TopoDS::Edge(edge.Reversed());
auto cof = BRep_Tool::CurveOnSurface (r_edge, face, s0, s1);
curve_on_face[REVERSED][edgenr] = cof;
orientation += REVERSED;
edge_on_face[REVERSED][edgenr] = r_edge;
}
if(orientation > BOTH)
throw Exception("have edge more than twice in face " + ToString(nr) + " " + properties.GetName() + ", orientation: " + ToString(orientation));