diff --git a/src/IntWalk/IntWalk_PWalking.cxx b/src/IntWalk/IntWalk_PWalking.cxx index 1a5fa68052..241951121c 100644 --- a/src/IntWalk/IntWalk_PWalking.cxx +++ b/src/IntWalk/IntWalk_PWalking.cxx @@ -762,6 +762,9 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, Epsilon(VM1 - Vm1), Epsilon(UM2 - Um2), Epsilon(VM2 - Vm2)}; + + Standard_Integer aPrevNbPoints = line->NbPoints(); + Arrive = Standard_False; while(!Arrive) //010 { @@ -1099,7 +1102,13 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, if(aDelta > Epsilon(pasInit[i])) { pasInit[i] -= aDelta; - LevelOfIterWithoutAppend=0; + if ((aPrevStatus != IntWalk_StepTooSmall) && + (line->NbPoints() != aPrevNbPoints)) + { + LevelOfIterWithoutAppend = 0; + } + + aPrevNbPoints = line->NbPoints(); } } } @@ -1174,8 +1183,13 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, // StepTooSmall --> Increase step --> PasTropGrand...) // nullify LevelOfIterWithoutAppend only if the condition // is satisfied: - if (aPrevStatus != IntWalk_PasTropGrand) + if ((aPrevStatus != IntWalk_PasTropGrand) && + (line->NbPoints() != aPrevNbPoints)) + { LevelOfIterWithoutAppend = 0; + } + + aPrevNbPoints = line->NbPoints(); break; } diff --git a/tests/perf/modalg/bug30176 b/tests/perf/modalg/bug30176 new file mode 100644 index 0000000000..ebc07ff516 --- /dev/null +++ b/tests/perf/modalg/bug30176 @@ -0,0 +1,24 @@ +puts "========" +puts "0030176: Modeling Algorithms - Infinite loop in IntWalk_PWalking::Perform()" +puts "========" +puts "" + +restore [locate_data_file bug30176_shape.brep] sshh +explode sshh e + +dchrono h1 restart +blend result sshh 0.1 sshh_36 0.1 sshh_36 0.1 sshh_38 0.1 sshh_71 0.1 sshh_72 0.1 sshh_73 +dchrono h1 stop counter BlOp + +checkshape result + +if {[regexp "Faulties" [bopargcheck result]]} { + puts "Error: bopargcheck has found some faulties in result" +} + +checkmaxtol result -ref 0.0001 +checknbshapes result -wire 43 -face 43 -shell 1 -solid 1 + +checkprops result -s 26.9203 -v 9.40217 + +checkview -display result -2d -path ${imagedir}/${test_image}.png