From: Pasukhin Dmitry Date: Mon, 27 Oct 2025 21:27:16 +0000 (+0000) Subject: Shape Healing - Regression after #584 (#769) X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=8da521991351bb044e7366f12ea112d801c91106;p=occt.git Shape Healing - Regression after #584 (#769) 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. --- diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Shell.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Shell.cxx index 5e8357678c..6f7fc208d2 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Shell.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Shell.cxx @@ -269,7 +269,25 @@ static NCollection_List GetConnectedFaceGroups( } } - aConnectedGroups.Append(aConnectedGroup); + // Insert in sorted order (largest groups first) + Standard_Boolean anIsInserted = Standard_False; + + for (NCollection_List::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; diff --git a/tests/de/step_1/ZK4 b/tests/de/step_1/ZK4 index 71822db15c..9062ddfc1f 100644 --- a/tests/de/step_1/ZK4 +++ b/tests/de/step_1/ZK4 @@ -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 )