From 39c2c4e13b6eb2fa04dc857eb5893a2f9120786d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 14 Feb 2020 17:00:08 +0100 Subject: [PATCH] Zone filler: pads non connected in zone option: use same algo as the 5.1 branch to calculate thermal clearance (antipad size) for pads having the same netcode as the zone, the net clearance has no meaning (net clearance between object of the same net is 0) and the zone_clearance can be set to 0 (i.e. use the netclass clearance). Therefore use the antipad clearance (thermal clearance) or the zone_clearance if bigger. --- pcbnew/zone_filler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 275e453b60..2606efad74 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -557,7 +557,20 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE_CONTAINER* aZone, SHAPE_ if( pad->GetNetCode() != aZone->GetNetCode() || pad->GetNetCode() <= 0 || aZone->GetPadConnection( pad ) == ZONE_CONNECTION::NONE ) { + // for pads having a netcode different from the zone, use the net clearance: int gap = std::max( zone_clearance, pad->GetClearance() ); + + // for pads having the same netcode as the zone, the net clearance has no + // meaning (clearance between object of the same net is 0) and the + // zone_clearance can be set to 0 (In this case the netclass clearance is used) + // therefore use the antipad clearance (thermal clearance) or the + // zone_clearance if bigger. + if( pad->GetNetCode() > 0 && pad->GetNetCode() == aZone->GetNetCode() ) + { + int thermalGap = aZone->GetThermalReliefGap( pad ); + gap = std::max( zone_clearance, thermalGap );; + } + EDA_RECT item_boundingbox = pad->GetBoundingBox(); item_boundingbox.Inflate( pad->GetClearance() );