diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 1ae0c2d05c..e0f181a4b3 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -186,7 +186,7 @@ bool ZONE_FILLER::Fill( std::vector aZones, bool aCheck ) connectivity->SetProgressReporter( m_progressReporter ); connectivity->FindIsolatedCopperIslands( toFill ); - // Now remove insulated copper islands + // Now remove insulated copper islands and islands outside the board edge bool outOfDate = false; for( auto& zone : toFill ) @@ -194,7 +194,7 @@ bool ZONE_FILLER::Fill( std::vector aZones, bool aCheck ) std::sort( zone.m_islands.begin(), zone.m_islands.end(), std::greater() ); SHAPE_POLY_SET poly = zone.m_zone->GetFilledPolysList(); - // only zones with net code > 0 can have islands to remove by definition + // only zones with net code > 0 can have insulated islands by definition if( zone.m_zone->GetNetCode() > 0 ) { for( auto idx : zone.m_islands ) @@ -203,6 +203,11 @@ bool ZONE_FILLER::Fill( std::vector aZones, bool aCheck ) } } + SHAPE_POLY_SET boardOutline; + + if( m_board->GetBoardPolygonOutlines( boardOutline ) ) + poly.BooleanIntersection( boardOutline, SHAPE_POLY_SET::PM_FAST ); + zone.m_zone->SetFilledPolysList( poly ); if( aCheck && zone.m_zone->GetHashValue() != poly.GetHash() )