]> OCCT Git - occt.git/commitdiff
0032561: Modelling Algorithms - UnifySameDomain does nothing while it is expected...
authorjgv <jgv@opencascade.com>
Fri, 10 Sep 2021 16:30:38 +0000 (19:30 +0300)
committerjfa <jfa@opencascade.com>
Mon, 20 Sep 2021 09:18:10 +0000 (12:18 +0300)
Correct method ShapeUpgrade_UnifySameDomain::UnifyFaces: when creating the Edge-Face map of initial shape, count each face only once.

src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
tests/boolean/removefeatures/C5
tests/bugs/heal/bug32561 [new file with mode: 0644]

index 47acad0f9f2568b6cc84884fc22b2dcb82b51abf..2d63675697baa85fb3bb21dc9860e4dfe2812f1c 100644 (file)
@@ -2569,7 +2569,11 @@ void ShapeUpgrade_UnifySameDomain::UnifyFaces()
 {
   // creating map of edge faces for the whole shape
   TopTools_IndexedDataMapOfShapeListOfShape aGMapEdgeFaces;
-  TopExp::MapShapesAndAncestors(myShape, TopAbs_EDGE, TopAbs_FACE, aGMapEdgeFaces);
+
+  TopTools_IndexedMapOfShape aFaceMap;
+  TopExp::MapShapes (myShape, TopAbs_FACE, aFaceMap);
+  for (Standard_Integer i = 1; i <= aFaceMap.Extent(); i++)
+    TopExp::MapShapesAndAncestors (aFaceMap(i), TopAbs_EDGE, TopAbs_FACE, aGMapEdgeFaces);
   
   // unify faces in each shell separately
   TopExp_Explorer exps;
index fe32e78e5df16bb5b2b7b205744e94f249ea29ee..4d393e4936bf52394ad322ca5b68eb1dae5c8f82 100644 (file)
@@ -8,7 +8,7 @@ compound s_11 s_12 s_17 gap2
 removefeatures res1 s gap1
 checkshape res1
 checkprops res1 -s 1200 -v 1875
-checknbshapes res1 -vertex 21 -edge 35 -wire 17 -face 17 -shell 2 -solid 2
+checknbshapes res1 -vertex 19 -edge 31 -wire 15 -face 15 -shell 2 -solid 2
 CheckIsFeatureRemoved gap1 {e f}
 
 # check that the common face is still shared
@@ -32,7 +32,7 @@ checkprops m1 -s 600 -v 1000
 removefeatures res2 s gap2
 checkshape res2
 checkprops res2 -s 1200 -v 1875
-checknbshapes res2 -vertex 21 -edge 35 -wire 17 -face 17 -shell 2 -solid 2
+checknbshapes res2 -vertex 19 -edge 31 -wire 15 -face 15 -shell 2 -solid 2
 CheckIsFeatureRemoved gap2 {e f}
 
 # get history of the operation
diff --git a/tests/bugs/heal/bug32561 b/tests/bugs/heal/bug32561
new file mode 100644 (file)
index 0000000..5b9ab84
--- /dev/null
@@ -0,0 +1,18 @@
+puts "======================================================================================="
+puts "OCC32561: UnifySameDomain does nothing while it is expected to union two pairs of faces"
+puts "======================================================================================="
+puts ""
+
+restore [locate_data_file bug32561.brep] a
+
+unifysamedom result a
+
+checkshape result
+
+checknbshapes result -t -solid 64 -shell 64 -face 233 -wire 233 -edge 284 -vertex 116
+
+set tolres [checkmaxtol result]
+
+if { ${tolres} > 2.e-7} {
+   puts "Error: bad tolerance of result"
+}