From 0f38ceb7f91c988f0360ab722d3ea43148954ff7 Mon Sep 17 00:00:00 2001 From: skv Date: Tue, 30 Sep 2014 19:46:13 +0400 Subject: [PATCH] Fix the case of several sections if one is empty --- src/GEOMImpl/GEOMImpl_PolylineDriver.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/GEOMImpl/GEOMImpl_PolylineDriver.cxx b/src/GEOMImpl/GEOMImpl_PolylineDriver.cxx index 70f59b415..632ba525d 100644 --- a/src/GEOMImpl/GEOMImpl_PolylineDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PolylineDriver.cxx @@ -143,6 +143,7 @@ Standard_Integer GEOMImpl_PolylineDriver::MakePolyline2D Standard_Integer iC = aClosedFlags->Lower(); std::list >::const_iterator anIter = aCoords.begin(); BRep_Builder aBuilder; + Standard_Boolean isEmpty = Standard_True; if (aNbSections > 1) { aBuilder.MakeCompound(TopoDS::Compound(aShape)); @@ -160,20 +161,20 @@ Standard_Integer GEOMImpl_PolylineDriver::MakePolyline2D (*anIter, aClosedFlags->Value(iC), aWPlane); } - if (aSection.IsNull()) { - return 0; - } - if (aNbSections > 1) { // There are multiple sections. - aBuilder.Add(aShape, aSection); + if (aSection.IsNull() == Standard_False) { + aBuilder.Add(aShape, aSection); + isEmpty = Standard_False; + } } else { // There is only one section. - aShape = aSection; + isEmpty = aSection.IsNull(); + aShape = aSection; } } - if (aShape.IsNull()) { + if (isEmpty) { return 0; } -- 2.39.2