X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FDriverMED%2FDriverMED_W_SMESHDS_Mesh.cxx;h=bfa6eea7ea2a0f148fa33ca899749f5e37c0f099;hp=63c69c992ee921e3a18351a076439b76abd0d968;hb=fc9c05a33c258342ff8d1eabcd9ae06bdf8c5764;hpb=13d0dc562ddb2f6d39431b5690d0dff10ece4d5f diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index 63c69c992..bfa6eea7e 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -62,7 +62,8 @@ DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh(): myAutoDimension(false), myAddODOnVertices(false), myDoAllInGroups(false), - myVersion(-1) + myVersion(-1), + myZTolerance(-1.) {} void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName, int theVersion) @@ -417,6 +418,8 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() anIsXDimension = (aBounds[1] - aBounds[0]) + abs(aBounds[1]) + abs(aBounds[0]) > EPS; anIsYDimension = (aBounds[3] - aBounds[2]) + abs(aBounds[3]) + abs(aBounds[2]) > EPS; anIsZDimension = (aBounds[5] - aBounds[4]) + abs(aBounds[5]) + abs(aBounds[4]) > EPS; + if ( myZTolerance > 0 && anIsZDimension ) + anIsZDimension = (aBounds[5] > myZTolerance || aBounds[4] < -myZTolerance ); aSpaceDimension = Max( aMeshDimension, anIsXDimension + anIsYDimension + anIsZDimension ); if ( !aSpaceDimension ) aSpaceDimension = 3; @@ -550,6 +553,10 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() for(TInt iCoord = 0; iCoord < aSpaceDimension; iCoord++){ aTCoordSlice[iCoord] = aCoordHelperPtr->GetCoord(iCoord); } + if ( aSpaceDimension == 3 && + -myZTolerance < aTCoordSlice[2] && aTCoordSlice[2] < myZTolerance ) + aTCoordSlice[2] = 0.; + // node number int aNodeID = aCoordHelperPtr->GetID(); aNodeInfo->SetElemNum( iNode, aNodeID );