From 50567764b5be12ed91bc02ac2230c39a50b6ec54 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 24 Mar 2024 19:14:16 +0000 Subject: [PATCH] Allow no-net teardrops on no-net pads with no-net tracks. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17566 --- pcbnew/zone_filler.cpp | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index e0ba939c27..706bdcfda8 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -885,9 +885,18 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer if( !padBBox.Intersects( aZone->GetBoundingBox() ) ) continue; - if( pad->GetNetCode() != aZone->GetNetCode() - || pad->GetNetCode() <= 0 - || pad->GetZoneLayerOverride( aLayer ) == ZLO_FORCE_NO_ZONE_CONNECTION ) + bool noConnection = pad->GetNetCode() != aZone->GetNetCode(); + + if( !aZone->IsTeardropArea() ) + { + if( aZone->GetNetCode() == 0 + || pad->GetZoneLayerOverride( aLayer ) == ZLO_FORCE_NO_ZONE_CONNECTION ) + { + noConnection = true; + } + } + + if( noConnection ) { // collect these for knockout in buildCopperItemClearances() aNoConnectionPads.push_back( pad ); @@ -1049,8 +1058,10 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa { if( aTrack->GetBoundingBox().Intersects( zone_boundingbox ) ) { - bool sameNet = aTrack->GetNetCode() == aZone->GetNetCode() - && aZone->GetNetCode() != 0; + bool sameNet = aTrack->GetNetCode() == aZone->GetNetCode(); + + if( !aZone->IsTeardropArea() && aZone->GetNetCode() == 0 ) + sameNet = false; int gap = evalRulesForItems( PHYSICAL_CLEARANCE_CONSTRAINT, aZone, aTrack, aLayer ); @@ -1124,8 +1135,15 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa auto knockoutGraphicClearance = [&]( BOARD_ITEM* aItem ) { - int shapeNet = ( aItem->Type() == PCB_SHAPE_T ) ? static_cast( aItem )->GetNetCode() : -1; - bool sameNet = shapeNet == aZone->GetNetCode() && aZone->GetNetCode() != 0; + int shapeNet = -1; + + if( aItem->Type() == PCB_SHAPE_T ) + shapeNet = static_cast( aItem )->GetNetCode(); + + bool sameNet = shapeNet == aZone->GetNetCode(); + + if( !aZone->IsTeardropArea() && aZone->GetNetCode() == 0 ) + sameNet = false; // A item on the Edge_Cuts or Margin is always seen as on any layer: if( aItem->IsOnLayer( aLayer ) @@ -1174,7 +1192,12 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa { for( PAD* pad : footprint->Pads() ) { - if( pad->GetNetCode() == aZone->GetNetCode() && aZone->GetNetCode() != 0 ) + bool sameNet = pad->GetNetCode() == aZone->GetNetCode(); + + if( !aZone->IsTeardropArea() && aZone->GetNetCode() == 0 ) + sameNet = false; + + if( sameNet ) { if( pad->IsOnLayer( aLayer ) ) allowedNetTiePads.insert( pad );