From 2b662b4ccc7ec414eade21ade603c9befd95b3cb Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 13 Oct 2025 14:07:01 +0100 Subject: [PATCH] Don't abort same-net items in the filter. We still need to check for hole collisions. Fixes https://gitlab.com/kicad/code/kicad/-/issues/21941 (cherry picked from commit d03b5f44ab11178d2a8b448765b29ef8979ccf57) --- pcbnew/drc/drc_test_provider_copper_clearance.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_copper_clearance.cpp b/pcbnew/drc/drc_test_provider_copper_clearance.cpp index d5d9992aa5..e5dcae7cc9 100644 --- a/pcbnew/drc/drc_test_provider_copper_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_copper_clearance.cpp @@ -1152,10 +1152,14 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testGraphicClearances() // Filter: [&]( BOARD_ITEM* other ) -> bool { - BOARD_CONNECTED_ITEM* otherCItem = dynamic_cast( other ); - - if( otherCItem && otherCItem->GetNetCode() == aShape->GetNetCode() ) - return false; + // Graphics are often compound shapes so ignore collisions between shapes + // in a single footprint. + if( aShape->Type() == PCB_SHAPE_T && other->Type() == PCB_SHAPE_T + && aShape->GetParentFootprint() + && aShape->GetParentFootprint() == other->GetParentFootprint() ) + { + return false; + } // Track clearances are tested in testTrackClearances() if( dynamic_cast( other) ) @@ -1215,6 +1219,9 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testGraphicClearances() { testGraphicAgainstZone( item ); + if( item->Type() == PCB_SHAPE_T && item->IsOnCopperLayer() ) + testCopperGraphic( static_cast( item ) ); + done.fetch_add( 1 ); if( m_drcEngine->IsCancelled() )