- //RETURN_BAD_RESULT
- MESSAGE("Different nb of old and seam nodes " <<
- u2nodesMaps[ OLD_NODES ].size() << " != " << u2nodesOnSeam.size());
+ const TopoDS_Shape& seam = sm->GetSubShape();
+ if ( u2nodesMaps[ NEW_NODES ].size() > 0 &&
+ u2nodesOnSeam.size() > 0 &&
+ seam.ShapeType() == TopAbs_EDGE )
+ {
+ int nbE1 = SMESH_MesherHelper::Count( tgtFace, TopAbs_EDGE, /*ignoreSame=*/true );
+ int nbE2 = SMESH_MesherHelper::Count( srcFace, TopAbs_EDGE, /*ignoreSame=*/true );
+ if ( nbE1 != nbE2 ) // 2 EDGEs are mapped to a seam EDGE
+ {
+ // find the 2 EDGEs of srcFace
+ TopTools_DataMapIteratorOfDataMapOfShapeShape src2tgtIt( shape2ShapeMap._map2to1 );
+ for ( ; src2tgtIt.More(); src2tgtIt.Next() )
+ if ( seam.IsSame( src2tgtIt.Value() ))
+ SMESH_Algo::addBadInputElements
+ ( srcMesh->GetMeshDS()->MeshElements( src2tgtIt.Key() ));
+ return error( COMPERR_BAD_INPUT_MESH,
+ "Different number of nodes on two edges projected to a seam edge" );
+ }
+ }