diff --git a/pcbnew/router/pns_item.cpp b/pcbnew/router/pns_item.cpp index 042fe0e497..486739fbd8 100644 --- a/pcbnew/router/pns_item.cpp +++ b/pcbnew/router/pns_item.cpp @@ -103,7 +103,6 @@ bool ITEM::collideSimple( const ITEM* aHead, const NODE* aNode, const SHAPE* shapeH = aHead->Shape(); const HOLE* holeH = aHead->Hole(); int lineWidthH = 0; - int clearanceEpsilon = aNode->GetRuleResolver()->ClearanceEpsilon(); bool collisionsFound = false; if( this == aHead ) // we cannot be self-colliding @@ -212,8 +211,10 @@ bool ITEM::collideSimple( const ITEM* aHead, const NODE* aNode, int actual; VECTOR2I pos; - if( shapeH->Collide( shapeI, clearance + lineWidthH + lineWidthI - clearanceEpsilon, - &actual, &pos ) ) + // The extra "1" here is to account for the fact that the hulls are built to exactly + // the clearance distance, so we need to allow for no collision when exactly at the + // clearance distance. + if( shapeH->Collide( shapeI, clearance + lineWidthH + lineWidthI - 1, &actual, &pos ) ) { if( checkCastellation && aNode->QueryEdgeExclusions( pos ) ) return false; @@ -241,7 +242,10 @@ bool ITEM::collideSimple( const ITEM* aHead, const NODE* aNode, else { // Fast method - if( shapeH->Collide( shapeI, clearance + lineWidthH + lineWidthI - clearanceEpsilon ) ) + // The extra "1" here is to account for the fact that the hulls are built to exactly + // the clearance distance, so we need to allow for no collision when exactly at the + // clearance distance. + if( shapeH->Collide( shapeI, clearance + lineWidthH + lineWidthI - 1 ) ) { if( aCtx ) {