From e4fe27993e20363215bd57dc33c9ca6334ef5d94 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 3 Jun 2023 20:25:35 -0700 Subject: [PATCH] Fix wxCHECK_MSG in DRC The layers check needs to look for testing against technical layers for those vias that pass the outer layers --- .../drc_test_provider_physical_clearance.cpp | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_physical_clearance.cpp b/pcbnew/drc/drc_test_provider_physical_clearance.cpp index 42f8384009..e9104130c6 100644 --- a/pcbnew/drc/drc_test_provider_physical_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_physical_clearance.cpp @@ -647,7 +647,18 @@ int DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* aItem if( aItem->Type() == PCB_VIA_T ) { - wxCHECK_MSG( aItem->GetLayerSet().Contains( aLayer ), violations, + LSET layers = aItem->GetLayerSet(); + + if( layers.Contains( F_Cu ) ) + layers |= LSET::FrontBoardTechMask().set( F_CrtYd ); + + if( layers.Contains( B_Cu ) ) + layers |= LSET::BackBoardTechMask().set( B_CrtYd ); + + if( layers.Contains( F_Cu ) && layers.Contains( B_Cu ) ) + layers |= LSET::AllCuMask(); + + wxCHECK_MSG( layers.Contains( aLayer ), violations, wxT( "Bug! Vias should only be checked for layers on which they exist" ) ); itemHoleShape = aItem->GetEffectiveHoleShape(); @@ -659,7 +670,18 @@ int DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* aItem if( other->Type() == PCB_VIA_T ) { - wxCHECK_MSG( other->GetLayerSet().Contains( aLayer ), violations, + LSET layers = other->GetLayerSet(); + + if( layers.Contains( F_Cu ) ) + layers |= LSET::FrontBoardTechMask().set( F_CrtYd ); + + if( layers.Contains( B_Cu ) ) + layers |= LSET::BackBoardTechMask().set( B_CrtYd ); + + if( layers.Contains( F_Cu ) && layers.Contains( B_Cu ) ) + layers |= LSET::AllCuMask(); + + wxCHECK_MSG( layers.Contains( aLayer ), violations, wxT( "Bug! Vias should only be checked for layers on which they exist" ) ); otherHoleShape = other->GetEffectiveHoleShape();