Gerber plotter: Better object attributes handling when plotting a zone

- Clear object attributes before and after plotting a zone.
It avoid using previously defined object attributes when plotting the next zone,
and using therefore incorrect attributes.
- Add aperture attribute to filled zone solid polygons (regions in Gerber)
This commit is contained in:
jean-pierre charras 2020-06-28 10:37:36 +02:00
parent f420396990
commit 67f46a0bb1
2 changed files with 19 additions and 3 deletions

View File

@ -36,7 +36,7 @@
#include <math/box2.h>
#include <gr_text.h>
#include <page_info.h>
#include <eda_text.h> // FILL_T
#include <base_struct.h> // FILL_T
class COLOR_SETTINGS;
class SHAPE_POLY_SET;

View File

@ -715,6 +715,8 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE_CONTAINER* aZone, SHAPE_POLY_SET& p
m_plotter->SetColor( getColor( aZone->GetLayer() ) );
m_plotter->StartBlock( nullptr ); // Clean current object attributes
/* Plot all filled areas: filled areas have a filled area and a thick
* 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)
@ -741,10 +743,22 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE_CONTAINER* aZone, SHAPE_POLY_SET& p
if( cornerList[0] != cornerList[cornerList.size() - 1] )
cornerList.push_back( cornerList[0] );
// Plot the current filled area and its outline
// Plot the current filled area (as region for Gerber plotter
// to manage attributes) and its outline for thick outline
if( GetPlotMode() == FILLED )
{
m_plotter->PlotPoly( cornerList, FILLED_SHAPE, outline_thickness, &gbr_metadata );
if( m_plotter->GetPlotterType() == PLOT_FORMAT::GERBER )
{
if( outline_thickness > 0 )
m_plotter->PlotPoly( cornerList, NO_FILL,
outline_thickness, &gbr_metadata );
static_cast<GERBER_PLOTTER*>( m_plotter )->PlotGerberRegion(
cornerList, &gbr_metadata );
}
else
m_plotter->PlotPoly( cornerList, FILLED_SHAPE,
outline_thickness, &gbr_metadata );
}
else
{
@ -762,6 +776,8 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE_CONTAINER* aZone, SHAPE_POLY_SET& p
}
}
}
m_plotter->EndBlock( nullptr ); // Clear object attributes
}