0025106: Command "splitshape" does not split attached face by attached edge
authorjgv <jgv@opencascade.com>
Thu, 21 Aug 2014 07:49:58 +0000 (11:49 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 21 Aug 2014 11:51:03 +0000 (15:51 +0400)
Test cases for issue CR25106

src/LocOpe/LocOpe_WiresOnShape.cxx
tests/bugs/modalg_5/bug25106 [new file with mode: 0755]

index ed42ae8..712c1d4 100644 (file)
@@ -1078,11 +1078,6 @@ void FindInternalIntersections(const TopoDS_Edge& theEdge,
   
   TopoDS_Vertex theVertices [2];
   TopExp::Vertices(theEdge, theVertices[0], theVertices[1]);
-  if (theEdge.Orientation() == TopAbs_REVERSED)
-  {
-    theVertices[0].Reverse();
-    theVertices[1].Reverse();
-  }
   gp_Pnt thePnt [2];
   thePnt[0] = BRep_Tool::Pnt(theVertices[0]);
   thePnt[1] = BRep_Tool::Pnt(theVertices[1]);
@@ -1217,11 +1212,13 @@ void FindInternalIntersections(const TopoDS_Edge& theEdge,
     LastVertex.Orientation(TopAbs_REVERSED);
     
     TopoDS_Shape aLocalShape = theEdge.EmptyCopied();
+    TopAbs_Orientation anOrient = aLocalShape.Orientation();
+    aLocalShape.Orientation(TopAbs_FORWARD);
     TopoDS_Edge NewEdge = TopoDS::Edge(aLocalShape);
     BB.Range(NewEdge, FirstPar, LastPar);
     BB.Add(NewEdge, FirstVertex);
     BB.Add(NewEdge, LastVertex);
-
+    NewEdge.Orientation(anOrient);
     NewEdges.Append(NewEdge);
     FirstVertex = LastVertex;
     FirstPar = LastPar;
diff --git a/tests/bugs/modalg_5/bug25106 b/tests/bugs/modalg_5/bug25106
new file mode 100755 (executable)
index 0000000..d7ba97c
--- /dev/null
@@ -0,0 +1,31 @@
+puts "============"
+puts "OCC25106"
+puts "============"
+puts ""
+#######################################################################
+# Command "splitshape" does not split attached face by attached edge
+#######################################################################
+
+restore [locate_data_file bug25106_bad_split4.brep] c1
+
+explode c1
+
+splitshape result c1_1 c1_1 c1_2
+
+set square 100
+
+set nb_v_good 12
+set nb_e_good 16
+set nb_w_good 5
+set nb_f_good 5
+set nb_sh_good 1
+set nb_sol_good 0
+set nb_compsol_good 0
+set nb_compound_good 0
+set nb_shape_good 39
+
+vinit
+vdisplay result
+vsetdispmode 0
+vfit
+set only_screen 1