From 2b0ea5439fa29f804af6a0c1392f35439b363524 Mon Sep 17 00:00:00 2001 From: oan Date: Wed, 22 Jun 2016 18:20:15 +0300 Subject: [PATCH] 0027595: Mesh - faces without triangulations due to gp_VectorWithNullMagnitude exception Zero magnitude check has been added before gp::Vec::Angle() usage Signed-off-by: oan --- src/BRepMesh/BRepMesh_FastDiscretFace.cxx | 4 +++- tests/bugs/moddata_1/bug22759 | 8 ++++---- tests/mesh/data/standard/W7 | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx index d5c9dc190b..feb622fc60 100644 --- a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx +++ b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx @@ -969,7 +969,9 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther( if (aDist < aDefFace) { // Lets check parameters for angular deflection. - if (aPrevVec2.Angle (aTmpVec) < myAngle) + if (aPrevVec2.SquareMagnitude() < gp::Resolution() || + aTmpVec.SquareMagnitude() < gp::Resolution() || + aPrevVec2.Angle (aTmpVec) < myAngle) { // For current Iso line we can remove this parameter. aToRemove2.Add (aParam2); diff --git a/tests/bugs/moddata_1/bug22759 b/tests/bugs/moddata_1/bug22759 index a8f153e5e5..3d4aeabd3a 100755 --- a/tests/bugs/moddata_1/bug22759 +++ b/tests/bugs/moddata_1/bug22759 @@ -30,13 +30,13 @@ 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 392920 - set good_nod 200191 + set good_tri 310982 + set good_nod 159222 set good_defl 0.0092442421472207319 } else { puts "OS = Windows NT" - set good_tri 392920 - set good_nod 200191 + set good_tri 310982 + set good_nod 159222 set good_defl 0.0092442421472207319 } diff --git a/tests/mesh/data/standard/W7 b/tests/mesh/data/standard/W7 index bc5e498e50..e878561c21 100755 --- a/tests/mesh/data/standard/W7 +++ b/tests/mesh/data/standard/W7 @@ -1,12 +1,12 @@ set TheFileName shading_wrongshape_027.brep set bug_freenodes "OCC22687" -#set nbfreenodes(All) 2 +set nbfreenodes(All) 3 set max_rel_tol_diff 1 if { [string compare $command "shading"] != 0 } { #set bug_area "OCC22687" set rel_tol 2.13 } else { - set rel_tol 0.48 + set rel_tol 0.4806230236905097 } set nbcross(All) 2 set bug_cross "OCC23184" -- 2.39.5