]> OCCT Git - occt.git/commitdiff
0029573: ConcatenateWireC0 crashes on two edges wire
authorifv <ifv@opencascade.com>
Fri, 27 Jul 2018 07:21:43 +0000 (10:21 +0300)
committerbugmaster <bugmaster@opencascade.com>
Mon, 30 Jul 2018 15:39:01 +0000 (18:39 +0300)
Wrong setting first/last vertices is fixed
Test case added

src/BRepAlgo/BRepAlgo.cxx
tests/bugs/modalg_7/bug29573 [new file with mode: 0644]

index a6bdf8a1d20e8d26ba18287e3103a5f8f31ce358..40a6277af98a44a0c16b9e22313d711d2fae24c2 100644 (file)
@@ -421,9 +421,9 @@ TopoDS_Edge  BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire)
     isReverse = !IsFwdSeq(1);
   }
 
-  TopoDS_Vertex FirstVtx_final = (isReverse)? LastVertex : FirstVertex;
+  TopoDS_Vertex FirstVtx_final = FirstVertex;
   FirstVtx_final.Orientation(TopAbs_FORWARD);
-  TopoDS_Vertex LastVtx_final = (isReverse)? FirstVertex : LastVertex;
+  TopoDS_Vertex LastVtx_final = LastVertex;
   LastVtx_final.Orientation(TopAbs_REVERSED);
 
   if (CurveSeq.IsEmpty())
diff --git a/tests/bugs/modalg_7/bug29573 b/tests/bugs/modalg_7/bug29573
new file mode 100644 (file)
index 0000000..d291f5f
--- /dev/null
@@ -0,0 +1,14 @@
+puts "========"
+puts "0029573: ConcatenateWireC0 crashes on two edges wire"
+puts "========"
+puts ""
+
+restore [locate_data_file bug29573.brep] w
+
+explode w
+
+concatC0wire r1 w_1
+checknbshapes r1 -vertex 2 -edge 1
+
+concatC0wire r2 w_2
+checknbshapes r2 -vertex 2 -edge 1