From 2b527066538454203ec286ba6e8f5dc86d28680b Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 15 Aug 2018 12:59:41 +0300 Subject: [PATCH] 0023497: EDF 15720 - Projection transforms the type of shape --- src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx b/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx index 5195bb8c8..564b32a84 100644 --- a/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx @@ -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(); + } } } -- 2.39.2