PCBNew - fix incorrect gerber generation for overlapping zones of the same net and having different draw options.

Previously, zones of the same net were merged for plotting,
regardless the fact the outline thickness can be different between the zones,
creating incorrect solid areas.

Fixes: lp:1840695
https://bugs.launchpad.net/kicad/+bug/1840695
This commit is contained in:
jean-pierre charras 2019-08-25 12:10:48 +02:00
parent 9f80da60c3
commit a0fec9db57
2 changed files with 18 additions and 6 deletions

View File

@ -8,7 +8,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -582,6 +582,19 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
if( candidate->GetNetCode() != zone->GetNetCode() )
continue;
// Merging zones of the same net can be done only for areas
// having compatible settings for drawings:
// use or not outline thickness, and if using outline thickness,
// having the same thickness
// becuase after merging only one outline thickness is used
if( candidate->GetFilledPolysUseThickness() != zone->GetFilledPolysUseThickness() )
// Should not happens, because usually the same option is used for filling
continue;
if( zone->GetFilledPolysUseThickness() &&
( candidate->GetMinThickness() != zone->GetMinThickness() ) )
continue;
plotted.insert( candidate );
aggregateArea.BooleanAdd( candidate->GetFilledPolysList(), SHAPE_POLY_SET::PM_FAST );
}

View File

@ -659,12 +659,13 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE_CONTAINER* aZone, SHAPE_POLY_SET& p
m_plotter->SetColor( getColor( aZone->GetLayer() ) );
/* Plot all filled areas: filled areas have a filled area and a thick
* outline we must plot the filled area itself ( as a filled polygon
* OR a set of segments ) and plot the thick outline itself,
* if the thickness has meaning (at least is > 1)
* outline (depending on the fill area option we must plot the filled area itself
* and plot the thick outline itself, if the thickness has meaning (at least is > 1)
*
* in non filled mode the outline is plotted, but not the filling items
*/
int outline_thickness = aZone->GetFilledPolysUseThickness() ? aZone->GetMinThickness() : 0;
for( auto ic = polysList.CIterate(); ic; ++ic )
{
wxPoint pos( ic->x, ic->y );
@ -677,8 +678,6 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE_CONTAINER* aZone, SHAPE_POLY_SET& p
cornerList.push_back( cornerList[0] );
// Plot the current filled area and its outline
int outline_thickness = aZone->GetFilledPolysUseThickness() ? aZone->GetMinThickness() : 0;
if( GetPlotMode() == FILLED )
{
m_plotter->PlotPoly( cornerList, FILLED_SHAPE, outline_thickness, &gbr_metadata );