From: eap Date: Thu, 2 Sep 2010 14:18:22 +0000 (+0000) Subject: 0020966: How to create GHS3D mesh from an existing mesh ? X-Git-Tag: V5_1_5a1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c81c45e92897cda1aeaf2018722367639cb1231e;p=plugins%2Fghs3dplugin.git 0020966: How to create GHS3D mesh from an existing mesh ? Fix bad input file (wrong nb of faces) in case if not all faces are bound to geometry --- diff --git a/src/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin_GHS3D.cxx index 70dc77b..6ff024a 100644 --- a/src/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin_GHS3D.cxx @@ -266,10 +266,8 @@ static bool writeFaces (ofstream & theFile, int shapeID, nbNodes, aSmdsID; bool idFound; - std::cout << " " << theMesh->NbFaces() << " shapes of 2D dimension" << std::endl; - std::cout << std::endl; - - theFile << space << theMesh->NbFaces() << space << dummyint << std::endl; + // count faces bound to geometry + int nbFaces = 0; TopExp_Explorer expface( theMesh->ShapeToMesh(), TopAbs_FACE ); for ( int i = 0; expface.More(); expface.Next(), i++ ) { @@ -286,8 +284,16 @@ static bool writeFaces (ofstream & theFile, if ( ! idFound ) { tabID[i] = shapeID; tabShape[i] = aShape; + theSubMesh = theMesh->MeshElements( aShape ); + if ( theSubMesh ) + nbFaces += theSubMesh->NbElements(); } } + std::cout << " " << nbFaces << " shapes of 2D dimension" << std::endl; + std::cout << std::endl; + + theFile << space << nbFaces << space << dummyint << std::endl; + for ( int i =0; i < nbShape; i++ ) { if ( tabID[i] != 0 ) { aShape = tabShape[i];