0028207: Unexpected result of the unify same domain algorithm
authorimn <imn@opencascade.com>
Thu, 30 Mar 2017 15:19:21 +0000 (18:19 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 12 Apr 2017 14:52:17 +0000 (17:52 +0300)
- Now algorithm of merging edges uses angular tolerance

src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
tests/bugs/modalg_6/bug28207 [new file with mode: 0644]

index 7286e15..312c544 100644 (file)
@@ -1852,8 +1852,6 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
 //=======================================================================
 void ShapeUpgrade_UnifySameDomain::UnifyEdges()
 {
-  Standard_Real Tol = Precision::Confusion();
-  
   //Handle(ShapeBuild_ReShape) myContext = new ShapeBuild_ReShape;
   Standard_Real myTolerance = Precision::Confusion();
   TopoDS_Shape aResult = myContext->Apply(myShape);
@@ -1896,7 +1894,7 @@ void ShapeUpgrade_UnifySameDomain::UnifyEdges()
       SeqEdges.Append(expE.Current());
     SharedVert.Clear();
     CheckSharedVertices(SeqEdges, aMapEdgesVertex, myKeepShapes, SharedVert); 
-    MergeSeq(SeqEdges, Tol, myConcatBSplines, myContext, 
+    MergeSeq(SeqEdges, myAngTol, myConcatBSplines, myContext,
              myOldToGeneratedShapes, SharedVert, 
              myRemovedShapes, NewEdges2OldEdges);
   }
@@ -1958,7 +1956,7 @@ void ShapeUpgrade_UnifySameDomain::UnifyEdges()
       CheckSharedVertices(SeqEdges, aMapEdgesVertex, myKeepShapes, SharedVert);
       //if (!SharedVert.IsEmpty()) 
       //  continue;
-      if ( MergeSeq(SeqEdges, Tol, myConcatBSplines, myContext, 
+      if ( MergeSeq(SeqEdges, myAngTol, myConcatBSplines, myContext, 
                     myOldToGeneratedShapes, SharedVert, 
                     myRemovedShapes, NewEdges2OldEdges))
       {
@@ -1990,7 +1988,7 @@ void ShapeUpgrade_UnifySameDomain::UnifyEdges()
     {
       SharedVert.Clear();
       CheckSharedVertices(aNonSharedEdges, aMapEdgesVertex, myKeepShapes, SharedVert);
-      if ( MergeSeq(aNonSharedEdges, Tol, myConcatBSplines, myContext, 
+      if ( MergeSeq(aNonSharedEdges, myAngTol, myConcatBSplines, myContext, 
                     myOldToGeneratedShapes, SharedVert, 
                     myRemovedShapes, NewEdges2OldEdges))
       {
diff --git a/tests/bugs/modalg_6/bug28207 b/tests/bugs/modalg_6/bug28207
new file mode 100644 (file)
index 0000000..feb2196
--- /dev/null
@@ -0,0 +1,20 @@
+puts "========"
+puts "OCC28207"
+puts "========"
+puts ""
+#########################################################
+##  Unexpected result of the unify same domain algorithm
+#########################################################
+
+restore [locate_data_file bug28207_face.brep] s1
+
+unifysamedom result1 s1
+checknbshapes result1 -face 1 -wire 1 -edge 984
+
+unifysamedom result2 s1 -a 0.001
+checknbshapes result2 -face 1 -wire 1 -edge 223
+
+unifysamedom result s1 -a 1.0
+checknbshapes result -face 1 -wire 1 -edge 4
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file