- ShapeUpgrade_UnifySameDomain aUnify;
- aUnify.Initialize( aFuseShape );
- aUnify.UnifyFacesAndEdges();
- aUnify.Build();
- TopoDS_Shape aUnitedShape = aUnify.Shape();
-
- TopExp_Explorer anExp( aUnitedShape, TopAbs_FACE );
- if ( anExp.More() ) {
- aRegionFace = TopoDS::Face( anExp.Current() );
- anExp.Next();
- if ( anExp.More() ) {
- aRegionFace.Nullify();
- }
+ ShapeUpgrade_UnifySameDomain anUnifier( aFuseShape );
+ anUnifier.Build();
+ TopoDS_Shape anUnitedShape = anUnifier.Shape();
+
+ TopTools_IndexedMapOfShape aMapOfFaces;
+ TopExp::MapShapes( anUnitedShape, TopAbs_FACE, aMapOfFaces );
+ if ( aMapOfFaces.Extent() == 1 ) {
+ aRegionFace = TopoDS::Face( aMapOfFaces(1) );