From: oan Date: Wed, 22 Jun 2016 15:20:15 +0000 (+0300) Subject: 0027595: Mesh - faces without triangulations due to gp_VectorWithNullMagnitude exception X-Git-Tag: V7_1_0_beta~270 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=782467fd4206914a9c4bcbb927c31627fbe71c1e;p=occt.git 0027595: Mesh - faces without triangulations due to gp_VectorWithNullMagnitude exception Zero magnitude check has been added before gp::Vec::Angle() usage --- diff --git a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx index 687387daf1..0b913ada87 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 c880e5ab4e..5e1dbf075e 100755 --- a/tests/bugs/moddata_1/bug22759 +++ b/tests/bugs/moddata_1/bug22759 @@ -22,7 +22,7 @@ tclean result set Deflection 0.001 incmesh result ${Deflection} -checktrinfo result -tri 411758 -nod 209610 -defl 0.0092442421472207319 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001 +checktrinfo result -tri 311280 -nod 159373 -defl 0.0092442421472206764 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001 vinit vdisplay result