diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index e076fe6f71..0536757866 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -359,7 +359,7 @@ NODE::OPT_OBSTACLE NODE::NearestObstacle( const LINE* aLine, int aKindMask, for( const auto& ip : intersectingPts ) { //debugDecorator->AddPoint( ip.p, ip.valid?3:6, 100000, (const char *) wxString::Format("obstacle-isect-point-%d" ).c_str() ); - if(ip.valid) + if( ip.valid ) updateNearest( ip, obstacle.m_item, obstacleHull, false ); } @@ -370,8 +370,10 @@ NODE::OPT_OBSTACLE NODE::NearestObstacle( const LINE* aLine, int aKindMask, int viaHoleRadius = static_cast( via.Hole() )->GetRadius(); - int viaClearance = GetClearance( obstacle.m_item, &via ) + via.Diameter() / 2; - int holeClearance = GetHoleClearance( obstacle.m_item, &via ) + viaHoleRadius; + int viaClearance = GetClearance( obstacle.m_item, &via, aUseClearanceEpsilon ) + + via.Diameter() / 2; + int holeClearance = + GetHoleClearance( obstacle.m_item, &via, aUseClearanceEpsilon ) + viaHoleRadius; if( holeClearance > viaClearance ) viaClearance = holeClearance; @@ -390,7 +392,8 @@ NODE::OPT_OBSTACLE NODE::NearestObstacle( const LINE* aLine, int aKindMask, if( obstacle.m_item->Hole() ) { - clearance = GetHoleClearance( obstacle.m_item, aLine ) + aLine->Width() / 2; + clearance = GetHoleClearance( obstacle.m_item, aLine, aUseClearanceEpsilon ) + + aLine->Width() / 2; obstacleHull = obstacle.m_item->HoleHull( clearance, 0, layer ); //debugDecorator->AddLine( obstacleHull, 4 ); @@ -406,9 +409,13 @@ NODE::OPT_OBSTACLE NODE::NearestObstacle( const LINE* aLine, int aKindMask, // Don't use via.Drill(); it doesn't include the plating thickness int viaHoleRadius = static_cast( via.Hole() )->GetRadius(); - int viaClearance = GetClearance( obstacle.m_item, &via ) + via.Diameter() / 2; - int holeClearance = GetHoleClearance( obstacle.m_item, &via ) + viaHoleRadius; - int holeToHole = GetHoleToHoleClearance( obstacle.m_item, &via ) + viaHoleRadius; + int viaClearance = GetClearance( obstacle.m_item, &via, aUseClearanceEpsilon ) + + via.Diameter() / 2; + int holeClearance = GetHoleClearance( obstacle.m_item, &via, aUseClearanceEpsilon ) + + viaHoleRadius; + int holeToHole = + GetHoleToHoleClearance( obstacle.m_item, &via, aUseClearanceEpsilon ) + + viaHoleRadius; if( holeClearance > viaClearance ) viaClearance = holeClearance; @@ -416,7 +423,7 @@ NODE::OPT_OBSTACLE NODE::NearestObstacle( const LINE* aLine, int aKindMask, if( holeToHole > viaClearance ) viaClearance = holeToHole; - obstacleHull = obstacle.m_item->Hull( viaClearance + PNS_HULL_MARGIN, 0, layer ); + obstacleHull = obstacle.m_item->Hull( viaClearance, 0, layer ); //debugDecorator->AddLine( obstacleHull, 5 ); intersectingPts.clear();