From: prascle Date: Tue, 16 Apr 2013 16:47:43 +0000 (+0000) Subject: PR: relax constraints on node distances on StdMeshers_import_1D X-Git-Tag: V7_2_0rc1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bb5c11a5ede32160ebb18549daab96801c236d12;p=modules%2Fsmesh.git PR: relax constraints on node distances on StdMeshers_import_1D --- diff --git a/src/StdMeshers/StdMeshers_Import_1D.cxx b/src/StdMeshers/StdMeshers_Import_1D.cxx index f9ddca12a..5de578356 100644 --- a/src/StdMeshers/StdMeshers_Import_1D.cxx +++ b/src/StdMeshers/StdMeshers_Import_1D.cxx @@ -693,9 +693,11 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th else { // find an existing vertex node + double checktol = max(1.E-10, 10*edgeTol*edgeTol); for ( vNIt = vertexNodes.begin(); vNIt != vertexNodes.end(); ++vNIt) - if ( vNIt->SquareDistance( *node ) < 10 * edgeTol * edgeTol) + if ( vNIt->SquareDistance( *node ) < checktol) { + //MESSAGE("SquareDistance " << vNIt->SquareDistance( *node ) << " checktol " << checktol); (*n2nIt).second = vNIt->_node; vertexNodes.erase( vNIt ); break; @@ -710,13 +712,17 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th SMDS_MeshNode* newNode = tgtMesh->AddNode( (*node)->X(), (*node)->Y(), (*node)->Z()); n2nIt->second = newNode; tgtMesh->SetNodeOnEdge( newNode, shapeID, u ); + //MESSAGE("u=" << u); } } if ( !(newNodes[i] = n2nIt->second )) break; } if ( !newNodes.back() ) + { + //MESSAGE("not all nodes of edge lie on theShape"); continue; // not all nodes of edge lie on theShape + } // make a new edge SMDS_MeshElement * newEdge; @@ -724,6 +730,7 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th newEdge = tgtMesh->AddEdge( newNodes[0], newNodes[1], newNodes[2] ); else newEdge = tgtMesh->AddEdge( newNodes[0], newNodes[1]); + //MESSAGE("add Edge"); tgtMesh->SetMeshElementOnShape( newEdge, shapeID ); e2e->insert( make_pair( edge, newEdge )); }