TEPairVec& theNew2OldFaces,
TNPairVec& theNew2OldNodes)
{
+ if ( theSrcMesh.GetMeshInfo().NbFaces( ORDER_QUADRATIC ) > 0 )
+ throw SALOME_Exception( "Offset of quadratic mesh not supported" );
+ if ( theSrcMesh.GetMeshInfo().NbFaces() > theSrcMesh.GetMeshInfo().NbTriangles() )
+ throw SALOME_Exception( "Offset of non-triangular mesh not supported" );
+
SMDS_Mesh* newMesh = new SMDS_Mesh;
theNew2OldFaces.clear();
theNew2OldNodes.clear();
( std::make_pair(( const SMDS_MeshElement*) 0,
( const SMDS_MeshElement*) 0)); // to have index == face->GetID()
- if ( theSrcMesh.GetMeshInfo().NbFaces( ORDER_QUADRATIC ) > 0 )
- throw SALOME_Exception( "Offset of quadratic mesh not supported" );
- if ( theSrcMesh.GetMeshInfo().NbFaces() > theSrcMesh.GetMeshInfo().NbTriangles() )
- throw SALOME_Exception( "Offset of non-triangular mesh not supported" );
-
// copy input faces to the newMesh keeping IDs of nodes
double minNodeDist = 1e100;
normals[i].SetCoord( 0,0,0 ); // TODO find norm by neighbors
}
- const double tol = 1e-3 * Sqrt( minNodeDist );
const double sign = ( theOffset < 0 ? -1 : +1 );
+ const double tol = Min( 1e-3 * Sqrt( minNodeDist ),
+ 1e-2 * theOffset * sign );
// translate new nodes by normal to input faces
gp_XYZ newXYZ;