diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index 44011e7b9d..26085c73b2 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -332,7 +332,7 @@ NODE::OPT_OBSTACLE NODE::NearestObstacle( const LINE* aLine, for( const OBSTACLE& obstacle : obstacleList ) { - if( aOpts.m_restrictedSet && aOpts.m_restrictedSet->count( obstacle.m_item ) == 0 ) + if( aOpts.m_restrictedSet && !aOpts.m_restrictedSet->empty() && aOpts.m_restrictedSet->count( obstacle.m_item ) == 0 ) continue; int clearance = diff --git a/pcbnew/router/pns_walkaround.cpp b/pcbnew/router/pns_walkaround.cpp index 2d9bdfd9b0..53c155748e 100644 --- a/pcbnew/router/pns_walkaround.cpp +++ b/pcbnew/router/pns_walkaround.cpp @@ -68,11 +68,18 @@ NODE::OPT_OBSTACLE WALKAROUND::nearestObstacle( const LINE& aPath ) void WALKAROUND::RestrictToSet( bool aEnabled, const std::set& aSet ) { m_restrictedVertices.clear(); + m_restrictedSet.clear(); if( aEnabled ) - m_restrictedSet = aSet; - else - m_restrictedSet.clear(); + { + for( auto item : aSet ) + { + m_restrictedSet.insert( item ); + + if ( item->HasHole() ) + m_restrictedSet.insert( item->Hole() ); + } + } for( auto item : aSet ) {