diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 457b0d0e86..e648ced775 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -190,7 +190,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 ) @@ -198,7 +198,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 ) @@ -207,6 +207,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() )