- shapeType = TopAbs_EDGE;
- shapeID = n1->getshapeId();
- }
- else
- {
- TopoDS_Shape E1 = GetSubShapeByNode( n1, GetMeshDS() );
- TopoDS_Shape E2 = GetSubShapeByNode( n2, GetMeshDS() );
- shape = GetCommonAncestor( E1, E2, *myMesh, TopAbs_FACE );
+ if ( Pos1 != SMDS_TOP_FACE ) std::swap( n1,n2 );
+ TopoDS_Shape F = GetSubShapeByNode( n1, GetMeshDS() );
+ TopoDS_Shape S = GetSubShapeByNode( n2, GetMeshDS() );
+ if ( IsSubShape( S, F ))
+ {
+ shapeType = TopAbs_FACE;
+ shapeID = n1->getshapeId();
+ }