Stop removing islands for fully-isolated zones

It is hard for a user to tell what is going on when their zone
just doesn't fill at all.  We catch isolated areas in the DRC so
we can just leave them alone here until the zone has at least one
non-isolated filled area.

Also change default back to always remove islands to reduce confusion

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13271
This commit is contained in:
Jon Evans 2023-01-27 08:57:18 -05:00
parent 36d44e0ef2
commit ec4d377d15
2 changed files with 22 additions and 1 deletions

View File

@ -474,6 +474,27 @@ bool ZONE_FILLER::Fill( std::vector<ZONE*>& aZones, bool aCheck, wxWindow* aPare
//
for( CN_ZONE_ISOLATED_ISLAND_LIST& zone : islandsList )
{
// If *all* the polygons are islands, do not remove any of them
bool allIslands = true;
for( PCB_LAYER_ID layer : zone.m_zone->GetLayerSet().Seq() )
{
if( !zone.m_islands.count( layer ) )
continue;
std::vector<int>& islands = zone.m_islands.at( layer );
std::shared_ptr<SHAPE_POLY_SET> poly = zone.m_zone->GetFilledPolysList( layer );
if( islands.size() != static_cast<size_t>( poly->OutlineCount() ) )
{
allIslands = false;
break;
}
}
if( allIslands )
continue;
for( PCB_LAYER_ID layer : zone.m_zone->GetLayerSet().Seq() )
{
if( m_debugZoneFiller && LSET::InternalCuMask().Contains( layer ) )

View File

@ -71,7 +71,7 @@ ZONE_SETTINGS::ZONE_SETTINGS()
m_cornerSmoothingType = SMOOTHING_NONE;
m_cornerRadius = 0;
m_removeIslands = ISLAND_REMOVAL_MODE::AREA;
m_removeIslands = ISLAND_REMOVAL_MODE::ALWAYS;
m_minIslandArea = 10 * pcbIUScale.IU_PER_MM * pcbIUScale.IU_PER_MM;
SetIsRuleArea( false );