Fix solder mask plotting issues.

1) Don't plot all footprint texts for each footprint graphic item.

2) Correctly handle multi-layer zones.
This commit is contained in:
Jeff Young 2021-08-23 11:38:04 +01:00
parent 4ac2aa675a
commit 6f5e602df9
1 changed files with 11 additions and 11 deletions

View File

@ -838,10 +838,10 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
for( FOOTPRINT* footprint : aBoard->Footprints() )
{
itemplotter.PlotFootprintTextItems( footprint );
for( BOARD_ITEM* item : footprint->GraphicalItems() )
{
itemplotter.PlotFootprintTextItems( footprint );
if( item->Type() == PCB_FP_SHAPE_T && item->GetLayer() == layer )
itemplotter.PlotFootprintGraphicItem( (FP_SHAPE*) item );
}
@ -921,7 +921,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
for( ZONE* zone : aBoard->Zones() )
{
if( zone->GetLayer() != layer )
if( !zone->IsOnLayer( layer ) )
continue;
// add shapes inflated by aMinThickness/2 in areas
@ -930,15 +930,15 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
// add shapes with their exact mask layer size in initialPolys
zone->TransformSmoothedOutlineToPolygon( initialPolys, zone_margin, boardOutline );
}
int numSegs = GetArcToSegmentCount( inflate, maxError, 360.0 );
// Merge all polygons: After deflating, not merged (not overlapping) polygons
// will have the initial shape (with perhaps small changes due to deflating transform)
areas.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
areas.Deflate( inflate, numSegs );
}
int numSegs = GetArcToSegmentCount( inflate, maxError, 360.0 );
// Merge all polygons: After deflating, not merged (not overlapping) polygons
// will have the initial shape (with perhaps small changes due to deflating transform)
areas.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
areas.Deflate( inflate, numSegs );
#if !NEW_ALGO
// To avoid a lot of code, use a ZONE to handle and plot polygons, because our polygons look
// exactly like filled areas in zones.
@ -967,7 +967,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
// Slightly inflate polygons to avoid any gap between them and other shapes,
// These gaps are created by arc to segments approximations
areas.Inflate( Millimeter2iu( 0.002 ),6 );
areas.Inflate( Millimeter2iu( 0.002 ), 6 );
// Now, only polygons with a too small thickness are stored in areas.
areas.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );