Don't generate thermal reliefs for pads that don't intersect zone.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18174
This commit is contained in:
Jeff Young 2024-06-07 23:06:06 +01:00
parent d304a30155
commit a9b5b1728a
1 changed files with 10 additions and 8 deletions

View File

@ -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<SHAPE> 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 );
padShape = pad->GetEffectiveShape( aLayer, FLASHING::ALWAYS_FLASHED );
if( aFill.Collide( padShape.get(), 0 ) )
{
constraint = bds.m_DRCEngine->EvalRules( THERMAL_RELIEF_GAP_CONSTRAINT, pad,
aZone, aLayer );
padClearance = constraint.GetValue().Min();
if( pad->CanFlashLayer( aLayer ) )
{
aThermalConnectionPads.push_back( pad );
addKnockout( pad, aLayer, padClearance, holes );
}
else if( pad->GetDrillSize().x > 0 )
{
pad->TransformHoleToPolygon( holes, padClearance, m_maxError, ERROR_OUTSIDE );
}
break;