]> OCCT Git - occt.git/commitdiff
Shape Healing - Regression after #584 (#769)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Mon, 27 Oct 2025 21:27:16 +0000 (21:27 +0000)
committerGitHub <noreply@github.com>
Mon, 27 Oct 2025 21:27:16 +0000 (21:27 +0000)
Second iteration of fixing regressions.
Fixed issue with loops and incorrect shell created.
#584 affected some tests which were not updated on time.
Now all test cases are passed.

src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Shell.cxx
tests/de/step_1/ZK4

index 5e8357678c8fb57c26e8af1edc348cb66c6654f1..6f7fc208d2dd506bc3578e8aedcb749a831a7b2d 100644 (file)
@@ -269,7 +269,25 @@ static NCollection_List<TopTools_SequenceOfShape> GetConnectedFaceGroups(
       }
     }
 
-    aConnectedGroups.Append(aConnectedGroup);
+    // Insert in sorted order (largest groups first)
+    Standard_Boolean anIsInserted = Standard_False;
+
+    for (NCollection_List<TopTools_SequenceOfShape>::Iterator anIter(aConnectedGroups);
+         anIter.More();
+         anIter.Next())
+    {
+      if (aConnectedGroup.Length() > anIter.Value().Length())
+      {
+        aConnectedGroups.InsertBefore(aConnectedGroup, anIter);
+        anIsInserted = Standard_True;
+        break;
+      }
+    }
+
+    if (!anIsInserted)
+    {
+      aConnectedGroups.Append(aConnectedGroup);
+    }
   }
 
   return aConnectedGroups;
index 71822db15cb068b0573558baae3598fabcdeb7e7..9062ddfc1f9a4deea3bbcc50ce5f5fa71019c66e 100644 (file)
@@ -5,8 +5,8 @@ set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 0  ( 1 )  Summary  = 0  ( 1 )
 CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 4  ( 4 )  Face     = 13  ( 13 ) 
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 4  ( 4 )  Face     = 13  ( 13 )   FreeWire = 0  ( 0 ) 
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 12  ( 12 )  Face     = 13  ( 13 ) 
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 12  ( 12 )  Face     = 13  ( 13 )   FreeWire = 0  ( 0 ) 
 TOLERANCE   : MaxTol   = 0.004158901543  ( 0.004158901545 )  AvgTol   =  0.001029524988  (  0.001123851801 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 1  ( 1 )   NameLabels = 1  ( 1 )   ColorLabels = 0  ( 0 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )