Pcbnew, plot zones on Silk and Mask layers: use actual filled areas.

Previously zone outlines were used, but it did not take in account rule areas
that can create holes in filled areas.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21046
This commit is contained in:
jean-pierre charras 2025-06-02 16:18:38 +02:00
parent 80e09328e5
commit f892f39674

View File

@ -923,12 +923,8 @@ void GenerateLayerPoly( SHAPE_POLY_SET* aResult, BOARD *aBoard, PCB_LAYER_ID aLa
{
int maxError = aBoard->GetDesignSettings().m_MaxError;
SHAPE_POLY_SET buffer;
SHAPE_POLY_SET* boardOutline = nullptr;
int inflate = 0;
if( aBoard->GetBoardPolygonOutlines( buffer ) )
boardOutline = &buffer;
if( aLayer == F_Mask || aLayer == B_Mask )
{
// We remove 1nm as we expand both sides of the shapes, so allowing for a strictly greater
@ -1054,10 +1050,13 @@ void GenerateLayerPoly( SHAPE_POLY_SET* aResult, BOARD *aBoard, PCB_LAYER_ID aLa
if( !zone->IsOnLayer( aLayer ) )
continue;
if( inflate != 0 )
zone->TransformSmoothedOutlineToPolygon( exactPolys, 0, maxError, ERROR_OUTSIDE, boardOutline );
SHAPE_POLY_SET area = *zone->GetFill( aLayer );
zone->TransformSmoothedOutlineToPolygon( *aResult, inflate, maxError, ERROR_OUTSIDE, boardOutline );
if( inflate != 0 )
exactPolys.Append( area );
area.Inflate( inflate, CORNER_STRATEGY::CHAMFER_ALL_CORNERS, maxError );
aResult->Append( area );
}
}