From 0402c03468004f5e187412cb7c10d5875326a4b3 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Tue, 7 May 2024 08:02:30 -0400 Subject: [PATCH] Do not test for effective annular width when it's already within limits. --- .../drc/drc_test_provider_annular_width.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_annular_width.cpp b/pcbnew/drc/drc_test_provider_annular_width.cpp index c8821b5320..59226dfe61 100644 --- a/pcbnew/drc/drc_test_provider_annular_width.cpp +++ b/pcbnew/drc/drc_test_provider_annular_width.cpp @@ -242,7 +242,16 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run() if( m_drcEngine->IsErrorLimitExceeded( DRCE_ANNULAR_WIDTH ) ) return false; - int annularWidth = 0; + // PADSTACKS TODO: once we have padstacks we'll need to run this per-layer.... + auto constraint = m_drcEngine->EvalRules( ANNULAR_WIDTH_CONSTRAINT, item, nullptr, + UNDEFINED_LAYER ); + + int annularWidth = 0; + int v_min = 0; + int v_max = 0; + bool fail_min = false; + bool fail_max = false; + switch( item->Type() ) { @@ -332,7 +341,8 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run() annularWidth = sqrt( dist_sq ) - slot->GetWidth() / 2; } } - else + else if( constraint.Value().HasMin() + && ( annularWidth < constraint.Value().Min() ) ) { SHAPE_POLY_SET otherPadOutline; SHAPE_POLY_SET slotPolygon; @@ -392,14 +402,6 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run() return true; } - // PADSTACKS TODO: once we have padstacks we'll need to run this per-layer.... - auto constraint = m_drcEngine->EvalRules( ANNULAR_WIDTH_CONSTRAINT, item, nullptr, - UNDEFINED_LAYER ); - int v_min = 0; - int v_max = 0; - bool fail_min = false; - bool fail_max = false; - if( constraint.GetSeverity() == RPT_SEVERITY_IGNORE ) return true;