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:
parent
9f80da60c3
commit
a0fec9db57
|
@ -8,7 +8,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* 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
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* 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() )
|
if( candidate->GetNetCode() != zone->GetNetCode() )
|
||||||
continue;
|
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 );
|
plotted.insert( candidate );
|
||||||
aggregateArea.BooleanAdd( candidate->GetFilledPolysList(), SHAPE_POLY_SET::PM_FAST );
|
aggregateArea.BooleanAdd( candidate->GetFilledPolysList(), SHAPE_POLY_SET::PM_FAST );
|
||||||
}
|
}
|
||||||
|
|
|
@ -659,12 +659,13 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE_CONTAINER* aZone, SHAPE_POLY_SET& p
|
||||||
m_plotter->SetColor( getColor( aZone->GetLayer() ) );
|
m_plotter->SetColor( getColor( aZone->GetLayer() ) );
|
||||||
|
|
||||||
/* Plot all filled areas: filled areas have a filled area and a thick
|
/* 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
|
* outline (depending on the fill area option we must plot the filled area itself
|
||||||
* OR a set of segments ) and plot the thick outline itself,
|
* and plot the thick outline itself, if the thickness has meaning (at least is > 1)
|
||||||
* if the thickness has meaning (at least is > 1)
|
|
||||||
*
|
*
|
||||||
* in non filled mode the outline is plotted, but not the filling items
|
* 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 )
|
for( auto ic = polysList.CIterate(); ic; ++ic )
|
||||||
{
|
{
|
||||||
wxPoint pos( ic->x, ic->y );
|
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] );
|
cornerList.push_back( cornerList[0] );
|
||||||
|
|
||||||
// Plot the current filled area and its outline
|
// Plot the current filled area and its outline
|
||||||
int outline_thickness = aZone->GetFilledPolysUseThickness() ? aZone->GetMinThickness() : 0;
|
|
||||||
|
|
||||||
if( GetPlotMode() == FILLED )
|
if( GetPlotMode() == FILLED )
|
||||||
{
|
{
|
||||||
m_plotter->PlotPoly( cornerList, FILLED_SHAPE, outline_thickness, &gbr_metadata );
|
m_plotter->PlotPoly( cornerList, FILLED_SHAPE, outline_thickness, &gbr_metadata );
|
||||||
|
|
Loading…
Reference in New Issue