From 4694a2622ebefef9b3501bd1bb5d52542bcd3a5a Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Thu, 9 Jun 2022 00:31:47 +0200 Subject: [PATCH] router: use either copper or hole clearance, whichever is larger, when checking track -> hole collisions (cherry picked from commit 990281a8979f7a44a03e2c6257a3b88c1fb57eaf) --- pcbnew/router/pns_node.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index 0536757866..8ea571cc8d 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -392,10 +392,12 @@ NODE::OPT_OBSTACLE NODE::NearestObstacle( const LINE* aLine, int aKindMask, if( obstacle.m_item->Hole() ) { - clearance = GetHoleClearance( obstacle.m_item, aLine, aUseClearanceEpsilon ) - + aLine->Width() / 2; - obstacleHull = obstacle.m_item->HoleHull( clearance, 0, layer ); - //debugDecorator->AddLine( obstacleHull, 4 ); + clearance = GetHoleClearance( obstacle.m_item, aLine, aUseClearanceEpsilon ); + int copperClearance = GetClearance( obstacle.m_item, aLine, aUseClearanceEpsilon ); + + clearance = std::max( clearance, copperClearance ); + + obstacleHull = obstacle.m_item->HoleHull( clearance, aLine->Width(), layer ); intersectingPts.clear(); HullIntersection( obstacleHull, aLine->CLine(), intersectingPts );