]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0023497: EDF 15720 - Projection transforms the type of shape SHAPER_V9_1_0RC1
authorjfa <jfa@opencascade.com>
Wed, 15 Aug 2018 09:59:41 +0000 (12:59 +0300)
committerjfa <jfa@opencascade.com>
Wed, 15 Aug 2018 09:59:41 +0000 (12:59 +0300)
src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx

index 5195bb8c874facbf666c3d8e624c6f4a1bbef145..564b32a843853cec3fa82f58135a4a4616230393 100644 (file)
@@ -235,11 +235,23 @@ Standard_Integer GEOMImpl_ProjectionDriver::Execute(Handle(TFunction_Logbook)& l
 
       // check that the result shape is an empty compound
       // (IPAL22905: TC650: Projection on face dialog problems)
-      if( !aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND )
+      if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND)
       {
-        TopoDS_Iterator anIter( aShape );
-        if( !anIter.More() )
+        TopoDS_Iterator anIter(aShape);
+        if (!anIter.More())
           Standard_ConstructionError::Raise("Projection aborted : empty compound produced");
+
+        if (anOriginal.ShapeType() == TopAbs_WIRE) {
+          // Make wire from resulting compound (Mantis issue 0023497)
+          TopTools_ListOfShape anEdgesList;
+          for (; anIter.More(); anIter.Next()) {
+            anEdgesList.Append(anIter.Value());
+          }
+          BRepBuilderAPI_MakeWire aMkWire;
+          aMkWire.Add(anEdgesList);
+          if (aMkWire.IsDone())
+            aShape = aMkWire.Wire();
+        }
       }
     }