1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0026484: BRepExtrema_DistShapeShape hangs

Check in math_GlobOptMin::computeGlobalExtremum(...) method if the parameter went out of boundary(-ies).

Added test case bugs/modalg_6/bug26484
This commit is contained in:
nbv 2015-07-29 15:38:41 +03:00 committed by bugmaster
parent 03383c97c3
commit debc95ee5a
2 changed files with 27 additions and 1 deletions

View File

@ -407,11 +407,17 @@ void math_GlobOptMin::computeGlobalExtremum(Standard_Integer j)
math_Vector aStepBestPoint(1, myN);
Standard_Boolean isInside = Standard_False;
Standard_Real r;
Standard_Boolean isReached = Standard_False;
for(myX(j) = myA(j) + myE1; myX(j) < myB(j) + myE1; myX(j) += myV(j))
for(myX(j) = myA(j) + myE1;
(myX(j) < myB(j) + myE1) && (!isReached);
myX(j) += myV(j))
{
if (myX(j) > myB(j))
{
myX(j) = myB(j);
isReached = Standard_True;
}
if (j == 1)
{

View File

@ -0,0 +1,20 @@
puts "=========="
puts "OCC26484"
puts "=========="
puts ""
###########################################
# BRepExtrema_DistShapeShape hangs
###########################################
restore [locate_data_file bug26484_shape.brep] s1
restore [locate_data_file bug26484_face.brep] s2
distmini dd s1 s2
dump dd_val
distmini dd s2 s1
regexp {([-0-9.+eE]+)$} [dump dd_val] full dist
set expected_dist 13.2039203316305
set tol_abs_dist 1.0e-07
set tol_rel_dist 0.01
checkreal "Dump of dd_val" ${dist} ${expected_dist} ${tol_abs_dist} ${tol_rel_dist}