From 3e9eba7906cd6d95ed9a6ec10706763b0d85d054 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 5 Jun 2023 11:24:52 +0200 Subject: [PATCH] OCC - Handle internal (forward+reversed) edges correctly --- libsrc/occ/occ_face.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libsrc/occ/occ_face.cpp b/libsrc/occ/occ_face.cpp index 2e60469a..a092a3a0 100644 --- a/libsrc/occ/occ_face.cpp +++ b/libsrc/occ/occ_face.cpp @@ -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));