From: eap Date: Fri, 2 Oct 2009 16:18:40 +0000 (+0000) Subject: 020461: EDF 1102 GHS3DPLUGIN: Bad detection of volumes with Ghs3d mesh X-Git-Tag: V5_1_3rc1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=44dfa59dd6c38142c204059795037b32443548d3;p=plugins%2Fghs3dplugin.git 020461: EDF 1102 GHS3DPLUGIN: Bad detection of volumes with Ghs3d mesh in findShape(), fix getting GC of tetra --- diff --git a/src/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin_GHS3D.cxx index a7bc287..0d14603 100644 --- a/src/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin_GHS3D.cxx @@ -180,7 +180,7 @@ static TopoDS_Shape findShape(const SMDS_MeshNode *aNode[], aPnt = p; break; } - aPnt += p; + aPnt += p / nbNode; } BRepClass3d_SolidClassifier SC (aShape, aPnt, Precision::Confusion()); @@ -610,8 +610,8 @@ static int findShapeID(SMESH_Mesh& mesh, nNotOnSeamEdge = node3; else nNotOnSeamEdge = node2; - bool checkUV = true; - gp_XY uv = helper.GetNodeUV( geomFace, node1, nNotOnSeamEdge, &checkUV ); + bool uvOK; + gp_XY uv = helper.GetNodeUV( geomFace, node1, nNotOnSeamEdge, &uvOK ); // check that uv is correct double tol = 1e-6; TopoDS_Shape nodeShape = helper.GetSubShapeByNode( node1, meshDS ); @@ -624,7 +624,7 @@ static int findShapeID(SMESH_Mesh& mesh, default:; } BRepAdaptor_Surface surface( geomFace ); - if ( checkUV && node1Pnt.Distance( surface.Value( uv.X(), uv.Y() )) > 2 * tol ) + if ( !uvOK || node1Pnt.Distance( surface.Value( uv.X(), uv.Y() )) > 2 * tol ) return invalidID; // normale to geomFace at UV