From a9b5b1728ab4d3e48df7e3e058a62cba993d2101 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 7 Jun 2024 23:06:06 +0100 Subject: [PATCH] Don't generate thermal reliefs for pads that don't intersect zone. Fixes https://gitlab.com/kicad/code/kicad/-/issues/18174 --- pcbnew/zone_filler.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index fdd1d79d3b..c791ad32ff 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -875,6 +875,7 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer ZONE_CONNECTION connection; DRC_CONSTRAINT constraint; int padClearance; + std::shared_ptr padShape; int holeClearance; SHAPE_POLY_SET holes; @@ -916,22 +917,23 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer connection = constraint.m_ZoneConnection; } + if( connection == ZONE_CONNECTION::THERMAL && !pad->CanFlashLayer( aLayer ) ) + connection = ZONE_CONNECTION::NONE; + switch( connection ) { case ZONE_CONNECTION::THERMAL: - constraint = bds.m_DRCEngine->EvalRules( THERMAL_RELIEF_GAP_CONSTRAINT, pad, aZone, - aLayer ); - padClearance = constraint.GetValue().Min(); + padShape = pad->GetEffectiveShape( aLayer, FLASHING::ALWAYS_FLASHED ); - if( pad->CanFlashLayer( aLayer ) ) + if( aFill.Collide( padShape.get(), 0 ) ) { + constraint = bds.m_DRCEngine->EvalRules( THERMAL_RELIEF_GAP_CONSTRAINT, pad, + aZone, aLayer ); + padClearance = constraint.GetValue().Min(); + aThermalConnectionPads.push_back( pad ); addKnockout( pad, aLayer, padClearance, holes ); } - else if( pad->GetDrillSize().x > 0 ) - { - pad->TransformHoleToPolygon( holes, padClearance, m_maxError, ERROR_OUTSIDE ); - } break;