Merge branch 'occ_handle_internal_edges' into 'master'

OCC - Handle internal (forward+reversed) edges correctly

See merge request ngsolve/netgen!573
This commit is contained in:
Lackner, Christopher 2023-06-05 11:46:56 +02:00
commit 2f98144324

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