From: oan Date: Mon, 1 Feb 2016 14:20:37 +0000 (+0300) Subject: 0027119: Regression: Draw command "incmesh" hangs on the attacheced face. X-Git-Tag: V7_0_0rc~52 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=66dce5e76b0de33311494a58f8c696a78449194f 0027119: Regression: Draw command "incmesh" hangs on the attacheced face. BRepMesh_CircleTool: extend radius of circle by quite small value in order to classify points forming inscribed triangle as lying on it. Do not use PConfusion due to false positive result leading algorithm to hanging. Small correction in test cases bugs/mesh/bug27119 Update of test cases according to the new behavior: bugs/moddata_1/bug22759 mesh/data/standard/M4 --- diff --git a/src/BRepMesh/BRepMesh_CircleTool.cxx b/src/BRepMesh/BRepMesh_CircleTool.cxx index 9be1f518b0..e0f76003d9 100644 --- a/src/BRepMesh/BRepMesh_CircleTool.cxx +++ b/src/BRepMesh/BRepMesh_CircleTool.cxx @@ -152,7 +152,7 @@ Standard_Boolean BRepMesh_CircleTool::MakeCircle(const gp_XY& thePoint1, theRadius = Sqrt(Max(Max((thePoint1 - aIntPnt).SquareModulus(), (thePoint2 - aIntPnt).SquareModulus()), - (thePoint3 - aIntPnt).SquareModulus())) + aPrecision; + (thePoint3 - aIntPnt).SquareModulus())) + 2 * RealEpsilon(); return Standard_True; } diff --git a/tests/bugs/mesh/bug27119 b/tests/bugs/mesh/bug27119 new file mode 100644 index 0000000000..e36f79aed3 --- /dev/null +++ b/tests/bugs/mesh/bug27119 @@ -0,0 +1,44 @@ +puts "========" +puts "OCC27119" +puts "========" +puts "" +########################################### +## Regression: Draw command "incmesh" hangs on the attacheced face. +########################################### + +set BugNumber OCC27119 + +restore [locate_data_file bug27119_GrossPlatePart3Step2TransformedFace.brep] result + +dchrono t reset +dchrono t start +incmesh result 1.e-6 +dchrono t stop +set time [dchrono t show] +regexp {CPU user time: ([0-9|.]+) seconds} $time full seconds + +set tri 0 +set nod 0 +set def 0 + +set tri_info [trinfo result] +regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri +regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod +regexp { deflection +([-0-9.+eE]+)} $tri_info full def + +set ref_tri 7855 +set ref_nod 7857 +set ref_def 9.3791641120333225e-013 +set tol_rel 0.01 + +# Computes deviation of the value from specified one +checkreal "Nb of triangles" $tri $ref_tri 0 $tol_rel +checkreal "Nb of nodes" $nod $ref_nod 0 $tol_rel +checkreal "Deflection" $def $ref_def 1.e-12 0 + +set eps_time 3 +if { $seconds > $eps_time } { + puts "Error: Too slow ($seconds > $eps_time)" +} + +set 3dviewer 1 diff --git a/tests/bugs/moddata_1/bug22759 b/tests/bugs/moddata_1/bug22759 index 5b9b2293b8..dfaf8ab5a2 100755 --- a/tests/bugs/moddata_1/bug22759 +++ b/tests/bugs/moddata_1/bug22759 @@ -23,6 +23,71 @@ incmesh result ${Deflection} checktrinfo result -tri 615414 -nod 311438 -defl 0.0032657364637550075 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001 +regexp {deflection +([-0-9.+eE]+)} $tri_info full defl + +set env(os_type) $tcl_platform(platform) +if { [string compare $env(os_type) "windows"] != 0 } { + puts "OS = Linux" + set good_tri 616054 + set good_nod 311758 + set good_defl 0.0032657364637550023 +} else { + puts "OS = Windows NT" + set good_tri 616054 + set good_nod 311758 + set good_defl 0.0032657364637550023 +} + +proc GetPercent {Value GoodValue} { + set Percent 0. + if {${GoodValue} != 0.} { + set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.] + } elseif {${Value} != 0.} { + set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.] + } else { + set Percent 0. + } + return ${Percent} +} + +set percent_max 0.1 +set status 0 + +set triangle_percent [GetPercent ${tri} ${good_tri}] +puts "triangle_percent = ${triangle_percent}" +if { ${triangle_percent} > ${percent_max} } { + puts "triangle: Faulty ${BugNumber}" + set status 1 +} else { + puts "triangle: OK ${BugNumber}" +} + +set node_percent [GetPercent ${nod} ${good_nod}] +puts "node_percent = ${node_percent}" +if { ${node_percent} > ${percent_max} } { + puts "node: Faulty ${BugNumber}" + set status 1 +} else { + puts "node: OK ${BugNumber}" +} + +set deflection_percent [GetPercent ${defl} ${good_defl}] +puts "deflection_percent = ${deflection_percent}" +if { ${deflection_percent} > ${percent_max} } { + puts "deflection: Faulty ${BugNumber}" + set status 1 +} else { + puts "deflection: OK ${BugNumber}" +} + +# Resume +puts "" +if { ${status} != 0 } { + puts "Faulty ${BugNumber}" +} else { + puts "OK ${BugNumber}" +} + vinit vdisplay result vfit diff --git a/tests/mesh/data/standard/M4 b/tests/mesh/data/standard/M4 index 14a7e2a338..be8dfb5033 100755 --- a/tests/mesh/data/standard/M4 +++ b/tests/mesh/data/standard/M4 @@ -1,7 +1,7 @@ set TheFileName shading_112.brep set bug_area "OCC22687" if { [string compare $command "shading"] == 0 } { - set rel_tol 1.71 + set rel_tol 1.7 } else { set rel_tol 1.55 }