]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp
Salome HOME
Task 5.1.4 Join 2 features "fuse" and "union" into one feature (issue #3062)
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_UnifySameDomain.cpp
index c33177b73d961182d402d189ed6032270f9c3203..1aeb1140f60800294cb513ad202693e5c93cbcb6 100644 (file)
@@ -20,6 +20,7 @@
 #include "GeomAlgoAPI_UnifySameDomain.h"
 
 #include <GeomAlgoAPI_CompoundBuilder.h>
+#include <GeomAlgoAPI_DFLoader.h>
 #include <GeomAlgoAPI_ShapeTools.h>
 
 #include <ShapeUpgrade_UnifySameDomain.hxx>
@@ -113,6 +114,10 @@ void GeomAlgoAPI_UnifySameDomain::build(const GeomShapePtr& theShape,
   if (aResult.IsNull()) {
     return;
   }
+  // taske off the compound if it consists of single sub-shape
+  if (aResult.ShapeType() == TopAbs_COMPOUND) {
+    aResult = GeomAlgoAPI_DFLoader::refineResult(aResult);
+  }
 
   if (theIsToSimplifyShell && aResult.ShapeType() == TopAbs_SHELL) {
     int aNb = 0;