From 37eed564ab1d27ffcbd6a6bb8e4e3d306fcbfbd3 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Thu, 27 Feb 2020 17:52:16 +0000 Subject: [PATCH] Process all drawsegments on the outline layer --- pcbnew/convert_drawsegment_list_to_polygon.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pcbnew/convert_drawsegment_list_to_polygon.cpp b/pcbnew/convert_drawsegment_list_to_polygon.cpp index 41ab2003f3..b8a496cd10 100644 --- a/pcbnew/convert_drawsegment_list_to_polygon.cpp +++ b/pcbnew/convert_drawsegment_list_to_polygon.cpp @@ -190,6 +190,9 @@ bool ConvertOutlineToPolygon( std::vector& aSegList, SHAPE_POLY_SE if( aSegList.size() == 0 ) return true; + // Return value + bool polygonComplete = true; + wxString msg; // Make a working copy of aSegList, because the list is modified during calculations @@ -497,17 +500,21 @@ bool ConvertOutlineToPolygon( std::vector& aSegList, SHAPE_POLY_SE if( aErrorLocation ) *aErrorLocation = prevPt; - return false; + polygonComplete = false; + break; } break; } } } + int holeNum = -1; + while( segList.size() ) { // emit a signal layers keepout for every interior polygon left... int hole = aPolygons.NewHole(); + holeNum++; graphic = (DRAWSEGMENT*) segList[0]; segList.erase( segList.begin() ); @@ -702,7 +709,8 @@ bool ConvertOutlineToPolygon( std::vector& aSegList, SHAPE_POLY_SE if( aErrorLocation ) *aErrorLocation = prevPt; - return false; + aPolygons.Hole( 0, holeNum ).SetClosed( false ); + polygonComplete = false; } break; } @@ -746,7 +754,7 @@ bool ConvertOutlineToPolygon( std::vector& aSegList, SHAPE_POLY_SE } } - return true; + return polygonComplete; } #include