diff --git a/include/plotter.h b/include/plotter.h index bfb800f0a7..7f21a09ba7 100644 --- a/include/plotter.h +++ b/include/plotter.h @@ -36,7 +36,7 @@ #include #include #include -#include // FILL_T +#include // FILL_T class COLOR_SETTINGS; class SHAPE_POLY_SET; diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index 34dac509ab..7fcce01007 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -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( 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 }