From eef47c2a794dd3ab3e09702ce572c6700492be41 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 23 Dec 2022 14:06:10 +0100 Subject: [PATCH] DRC: ensure tracks are tested against holes, even if hole clearance is set to 0. Even with clearance = 0, copper to hole must be tested because it cannot be inside the hole --- pcbnew/drc/drc_test_provider_copper_clearance.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_copper_clearance.cpp b/pcbnew/drc/drc_test_provider_copper_clearance.cpp index da3531835e..50795e5535 100644 --- a/pcbnew/drc/drc_test_provider_copper_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_copper_clearance.cpp @@ -286,13 +286,16 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem( PCB_TRACK* track, constraint = m_drcEngine->EvalRules( HOLE_CLEARANCE_CONSTRAINT, b[ii], a[ii], layer ); clearance = constraint.GetValue().Min(); - if( constraint.GetSeverity() != RPT_SEVERITY_IGNORE && clearance > 0 ) + // Test for hole to item clearance even if clearance is 0, because the item cannot be + // inside (or intersect) the hole. + if( constraint.GetSeverity() != RPT_SEVERITY_IGNORE ) { if( a_shape[ii]->Collide( holeShape.get(), std::max( 0, clearance - m_drcEpsilon ), &actual, &pos ) ) { std::shared_ptr drce = DRC_ITEM::Create( DRCE_HOLE_CLEARANCE ); - wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ), + wxString msg = formatMsg( clearance ? _( "(%s clearance %s; actual %s)" ) + : _( "(%s clearance %s; actual < 0)" ), constraint.GetName(), clearance, actual );