From f8f536f485262318a093f403dacedb236aae610c Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sun, 11 Dec 2016 19:28:01 +0000
Subject: [PATCH] tentative fix for inconsistent curve/reverse curve when
 orientation is internal or external

---
 Geo/OCCEdge.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Geo/OCCEdge.cpp b/Geo/OCCEdge.cpp
index bd73756ee8..4350de8a87 100644
--- a/Geo/OCCEdge.cpp
+++ b/Geo/OCCEdge.cpp
@@ -34,6 +34,11 @@
 OCCEdge::OCCEdge(GModel *m, TopoDS_Edge edge, int num, GVertex *v1, GVertex *v2)
   : GEdge(m, num, v1, v2), c(edge), trimmed(0)
 {
+  // force orientation of internal/external edges: otherwise reverse will not
+  // produce the expected result
+  if (c.Orientation() == TopAbs_INTERNAL || c.Orientation() == TopAbs_EXTERNAL){
+    c = TopoDS::Edge(c.Oriented(TopAbs_FORWARD));
+  }
   curve = BRep_Tool::Curve(c, s0, s1);
   // build the reverse curve
   c_rev = c;
-- 
GitLab