]> OCCT Git - occt.git/commitdiff
0029765: BOPTools_AlgoTools::MakeSplitEdge Creates Illegal Edge
authorBenjamin Bihler <benjamin.bihler@compositence.de>
Tue, 15 May 2018 07:43:57 +0000 (10:43 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 14 Jun 2018 11:03:01 +0000 (14:03 +0300)
Method MakeSplitEdge checks arguments order.
This makes the method more generic.
Taking vertex orientation into account.

src/BOPTools/BOPTools_AlgoTools_2.cxx

index 9219295f96ef28dae1feef27de821ef9392d481e..9ed2175c49a3f617db602e83f245435448cd99d3 100644 (file)
@@ -162,12 +162,29 @@ void BOPTools_AlgoTools::MakeSplitEdge(const TopoDS_Edge&   aE,
   //
   BRep_Builder BB;
   if (!aV1.IsNull()) {
-    BB.Add  (E, aV1);
+    if (aP1 < aP2) {
+      BB.Add (E, TopoDS::Vertex(aV1.Oriented(TopAbs_FORWARD)));
+    }
+    else {
+      BB.Add (E, TopoDS::Vertex(aV1.Oriented(TopAbs_REVERSED)));
+    }
   }
   if (!aV2.IsNull()) {
-    BB.Add  (E, aV2);
+    if (aP1 < aP2) {
+      BB.Add (E, TopoDS::Vertex(aV2.Oriented(TopAbs_REVERSED)));
+    }
+    else {
+      BB.Add (E, TopoDS::Vertex(aV2.Oriented(TopAbs_FORWARD)));
+    }
+  }
+  
+  if (aP1 < aP2) {
+    BB.Range(E, aP1, aP2);
   }
-  BB.Range(E, aP1, aP2);
+  else {
+    BB.Range(E, aP2, aP1);
+  }
+  
   aNewEdge=E;
   aNewEdge.Orientation(aE.Orientation());
 }