Browse Source

Process non-copper keepouts in footprints.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20405
revert-0c36e162
Jeff Young 9 months ago
parent
commit
ab43c3c6b5
  1. 58
      pcbnew/zone_filler.cpp
  2. 2
      pcbnew/zone_filler.h

58
pcbnew/zone_filler.cpp

@ -1936,30 +1936,48 @@ bool ZONE_FILLER::fillNonCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer,
aFillPolys = aSmoothedOutline; aFillPolys = aSmoothedOutline;
aFillPolys.BooleanSubtract( clearanceHoles ); aFillPolys.BooleanSubtract( clearanceHoles );
for( ZONE* keepout : m_board->Zones() )
{
if( !keepout->GetIsRuleArea() )
continue;
auto subtractKeepout =
[&]( ZONE* candidate )
{
if( !candidate->GetIsRuleArea() )
return;
if( !keepout->HasKeepoutParametersSet() )
continue;
if( !candidate->HasKeepoutParametersSet() )
return;
if( keepout->GetDoNotAllowCopperPour() && keepout->IsOnLayer( aLayer ) )
{
if( keepout->GetBoundingBox().Intersects( zone_boundingbox ) )
{
if( keepout->Outline()->ArcCount() == 0 )
if( candidate->GetDoNotAllowCopperPour() && candidate->IsOnLayer( aLayer ) )
{ {
aFillPolys.BooleanSubtract( *keepout->Outline() );
}
else
{
SHAPE_POLY_SET keepoutOutline( *keepout->Outline() );
keepoutOutline.ClearArcs();
aFillPolys.BooleanSubtract( keepoutOutline );
if( candidate->GetBoundingBox().Intersects( zone_boundingbox ) )
{
if( candidate->Outline()->ArcCount() == 0 )
{
aFillPolys.BooleanSubtract( *candidate->Outline() );
}
else
{
SHAPE_POLY_SET keepoutOutline( *candidate->Outline() );
keepoutOutline.ClearArcs();
aFillPolys.BooleanSubtract( keepoutOutline );
}
}
} }
}
}
};
for( ZONE* keepout : m_board->Zones() )
{
if( checkForCancel( m_progressReporter ) )
return false;
subtractKeepout( keepout );
}
for( FOOTPRINT* footprint : m_board->Footprints() )
{
if( checkForCancel( m_progressReporter ) )
return false;
for( ZONE* keepout : footprint->Zones() )
subtractKeepout( keepout );
} }
// Features which are min_width should survive pruning; features that are *less* than // Features which are min_width should survive pruning; features that are *less* than

2
pcbnew/zone_filler.h

@ -94,7 +94,7 @@ private:
const SHAPE_POLY_SET& aSmoothedOutline, const SHAPE_POLY_SET& aSmoothedOutline,
const SHAPE_POLY_SET& aMaxExtents, SHAPE_POLY_SET& aFillPolys ); const SHAPE_POLY_SET& aMaxExtents, SHAPE_POLY_SET& aFillPolys );
bool fillNonCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer,
bool fillNonCopperZone( const ZONE* candidate, PCB_LAYER_ID aLayer,
const SHAPE_POLY_SET& aSmoothedOutline, SHAPE_POLY_SET& aFillPolys ); const SHAPE_POLY_SET& aSmoothedOutline, SHAPE_POLY_SET& aFillPolys );
/** /**
* Function buildThermalSpokes * Function buildThermalSpokes

Loading…
Cancel
Save