From ec4d377d15da4cc8a783c635cb8a3b06a699873e Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Fri, 27 Jan 2023 08:57:18 -0500 Subject: [PATCH] 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 --- pcbnew/zone_filler.cpp | 21 +++++++++++++++++++++ pcbnew/zone_settings.cpp | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 393a72e578..58350da91f 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -474,6 +474,27 @@ bool ZONE_FILLER::Fill( std::vector& 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& islands = zone.m_islands.at( layer ); + std::shared_ptr poly = zone.m_zone->GetFilledPolysList( layer ); + + if( islands.size() != static_cast( 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 ) ) diff --git a/pcbnew/zone_settings.cpp b/pcbnew/zone_settings.cpp index bca1323f28..91de6549b5 100644 --- a/pcbnew/zone_settings.cpp +++ b/pcbnew/zone_settings.cpp @@ -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 );