KiCad PCB EDA Suite
plot_board_layers.cpp File Reference

Functions to plot one board layer (silkscreen layers or other layers). More...

#include <fctsys.h>
#include <common.h>
#include <plotter.h>
#include <base_struct.h>
#include <draw_graphic_text.h>
#include <geometry/geometry_utils.h>
#include <trigo.h>
#include <pcb_base_frame.h>
#include <macros.h>
#include <class_board.h>
#include <class_module.h>
#include <class_track.h>
#include <class_edge_mod.h>
#include <class_pcb_text.h>
#include <class_zone.h>
#include <class_drawsegment.h>
#include <class_pcb_target.h>
#include <class_dimension.h>
#include <pcbnew.h>
#include <pcbplot.h>
#include <gbr_metadata.h>

Go to the source code of this file.

Functions

static void PlotSolderMaskLayer (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt, int aMinThickness)
 
void PlotSilkScreen (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
 Function PlotSilkScreen plot silkscreen layers which have specific requirements, mainly for pads. More...
 
void PlotOneBoardLayer (BOARD *aBoard, PLOTTER *aPlotter, PCB_LAYER_ID aLayer, const PCB_PLOT_PARAMS &aPlotOpt)
 Function PlotOneBoardLayer main function to plot one copper or technical layer. More...
 
void PlotStandardLayer (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
 Function PlotStandardLayer plot copper or technical layers. More...
 
void PlotLayerOutlines (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
 Function PlotLayerOutlines plot copper outline of a copper layer. More...
 
static void initializePlotter (PLOTTER *aPlotter, BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts)
 Set up most plot options for plotting a board (especially the viewport) Important thing: page size is the 'drawing' page size, paper size is the physical page size. More...
 
static void FillNegativeKnockout (PLOTTER *aPlotter, const EDA_RECT &aBbbox)
 Prefill in black an area a little bigger than the board to prepare for the negative plot. More...
 
static void ConfigureHPGLPenSizes (HPGL_PLOTTER *aPlotter, PCB_PLOT_PARAMS *aPlotOpts)
 Calculate the effective size of HPGL pens and set them in the plotter object. More...
 
PLOTTERStartPlotBoard (BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aFullFileName, const wxString &aSheetDesc)
 Open a new plotfile using the options (and especially the format) specified in the options and prepare the page for plotting. More...
 

Variables

static const PCB_LAYER_ID plot_seq []
 

Detailed Description

Functions to plot one board layer (silkscreen layers or other layers).

Silkscreen layers have specific requirement for pads (not filled) and texts (with option to remove them from some copper areas (pads...)

Definition in file plot_board_layers.cpp.

Function Documentation

◆ ConfigureHPGLPenSizes()

static void ConfigureHPGLPenSizes ( HPGL_PLOTTER aPlotter,
PCB_PLOT_PARAMS aPlotOpts 
)
static

Calculate the effective size of HPGL pens and set them in the plotter object.

Definition at line 1027 of file plot_board_layers.cpp.

1029 {
1030  /* Compute pen_dim (the value is given in mils) in pcb units,
1031  with plot scale (if Scale is 2, pen diameter value is always m_HPGLPenDiam
1032  so apparent pen diam is actually pen diam / Scale */
1033  int pen_diam = KiROUND( aPlotOpts->GetHPGLPenDiameter() * IU_PER_MILS /
1034  aPlotOpts->GetScale() );
1035 
1036  // Set HPGL-specific options and start
1037  aPlotter->SetPenSpeed( aPlotOpts->GetHPGLPenSpeed() );
1038  aPlotter->SetPenNumber( aPlotOpts->GetHPGLPenNum() );
1039  aPlotter->SetPenDiameter( pen_diam );
1040 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:121
virtual void SetPenDiameter(double diameter)
int GetHPGLPenSpeed() const
double GetScale() const
virtual void SetPenSpeed(int speed)
Definition: plotter.h:606
int GetHPGLPenNum() const
virtual void SetPenNumber(int number)
Definition: plotter.h:611
double GetHPGLPenDiameter() const
#define IU_PER_MILS
Definition: plotter.cpp:134

References PCB_PLOT_PARAMS::GetHPGLPenDiameter(), PCB_PLOT_PARAMS::GetHPGLPenNum(), PCB_PLOT_PARAMS::GetHPGLPenSpeed(), PCB_PLOT_PARAMS::GetScale(), IU_PER_MILS, KiROUND(), HPGL_PLOTTER::SetPenDiameter(), HPGL_PLOTTER::SetPenNumber(), and HPGL_PLOTTER::SetPenSpeed().

Referenced by StartPlotBoard().

◆ FillNegativeKnockout()

static void FillNegativeKnockout ( PLOTTER aPlotter,
const EDA_RECT aBbbox 
)
static

Prefill in black an area a little bigger than the board to prepare for the negative plot.

Definition at line 1014 of file plot_board_layers.cpp.

1015 {
1016  const int margin = 5 * IU_PER_MM; // Add a 5 mm margin around the board
1017  aPlotter->SetNegative( true );
1018  aPlotter->SetColor( WHITE ); // Which will be plotted as black
1019  EDA_RECT area = aBbbox;
1020  area.Inflate( margin );
1021  aPlotter->Rect( area.GetOrigin(), area.GetEnd(), FILLED_SHAPE );
1022  aPlotter->SetColor( BLACK );
1023 }
virtual void SetColor(COLOR4D color)=0
const wxPoint GetEnd() const
Definition: eda_rect.h:114
const wxPoint GetOrigin() const
Definition: eda_rect.h:112
virtual void SetNegative(bool aNegative)
Definition: plotter.h:118
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
Definition: colors.h:49
Definition: colors.h:45
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

References BLACK, FILLED_SHAPE, EDA_RECT::GetEnd(), EDA_RECT::GetOrigin(), EDA_RECT::Inflate(), PLOTTER::Rect(), PLOTTER::SetColor(), PLOTTER::SetNegative(), and WHITE.

Referenced by StartPlotBoard().

◆ initializePlotter()

static void initializePlotter ( PLOTTER aPlotter,
BOARD aBoard,
PCB_PLOT_PARAMS aPlotOpts 
)
static

Set up most plot options for plotting a board (especially the viewport) Important thing: page size is the 'drawing' page size, paper size is the physical page size.

Definition at line 927 of file plot_board_layers.cpp.

929 {
930  PAGE_INFO pageA4( wxT( "A4" ) );
931  const PAGE_INFO& pageInfo = aBoard->GetPageSettings();
932  const PAGE_INFO* sheet_info;
933  double paperscale; // Page-to-paper ratio
934  wxSize paperSizeIU;
935  wxSize pageSizeIU( pageInfo.GetSizeIU() );
936  bool autocenter = false;
937 
938  /* Special options: to fit the sheet to an A4 sheet replace
939  the paper size. However there is a difference between
940  the autoscale and the a4paper option:
941  - Autoscale fits the board to the paper size
942  - A4paper fits the original paper size to an A4 sheet
943  - Both of them fit the board to an A4 sheet
944  */
945  if( aPlotOpts->GetA4Output() ) // Fit paper to A4
946  {
947  sheet_info = &pageA4;
948  paperSizeIU = pageA4.GetSizeIU();
949  paperscale = (double) paperSizeIU.x / pageSizeIU.x;
950  autocenter = true;
951  }
952  else
953  {
954  sheet_info = &pageInfo;
955  paperSizeIU = pageSizeIU;
956  paperscale = 1;
957 
958  // Need autocentering only if scale is not 1:1
959  autocenter = (aPlotOpts->GetScale() != 1.0);
960  }
961 
962  EDA_RECT bbox = aBoard->ComputeBoundingBox();
963  wxPoint boardCenter = bbox.Centre();
964  wxSize boardSize = bbox.GetSize();
965 
966  double compound_scale;
967 
968  /* Fit to 80% of the page if asked; it could be that the board is empty,
969  * in this case regress to 1:1 scale */
970  if( aPlotOpts->GetAutoScale() && boardSize.x > 0 && boardSize.y > 0 )
971  {
972  double xscale = (paperSizeIU.x * 0.8) / boardSize.x;
973  double yscale = (paperSizeIU.y * 0.8) / boardSize.y;
974 
975  compound_scale = std::min( xscale, yscale ) * paperscale;
976  }
977  else
978  compound_scale = aPlotOpts->GetScale() * paperscale;
979 
980 
981  /* For the plot offset we have to keep in mind the auxiliary origin
982  too: if autoscaling is off we check that plot option (i.e. autoscaling
983  overrides auxiliary origin) */
984  wxPoint offset( 0, 0);
985 
986  if( autocenter )
987  {
988  offset.x = KiROUND( boardCenter.x - ( paperSizeIU.x / 2.0 ) / compound_scale );
989  offset.y = KiROUND( boardCenter.y - ( paperSizeIU.y / 2.0 ) / compound_scale );
990  }
991  else
992  {
993  if( aPlotOpts->GetUseAuxOrigin() )
994  offset = aBoard->GetAuxOrigin();
995  }
996 
997  /* Configure the plotter object with all the stuff computed and
998  most of that taken from the options */
999  aPlotter->SetPageSettings( *sheet_info );
1000 
1001  aPlotter->SetViewport( offset, IU_PER_MILS/10, compound_scale,
1002  aPlotOpts->GetMirror() );
1003  // has meaning only for gerber plotter. Must be called only after SetViewport
1004  aPlotter->SetGerberCoordinatesFormat( aPlotOpts->GetGerberPrecision() );
1005 
1006  aPlotter->SetDefaultLineWidth( aPlotOpts->GetLineWidth() );
1007  aPlotter->SetCreator( wxT( "PCBNEW" ) );
1008  aPlotter->SetColorMode( false ); // default is plot in Black and White.
1009  aPlotter->SetTextMode( aPlotOpts->GetTextMode() );
1010 }
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:554
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:161
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:121
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:126
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.cpp:537
double GetScale() const
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false)
Definition: plotter.h:433
bool GetMirror() const
bool GetA4Output() const
int GetGerberPrecision() const
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
virtual void SetTextMode(PlotTextMode mode)
Change the current text mode.
Definition: plotter.h:428
const wxPoint & GetAuxOrigin() const
Definition: class_board.h:350
bool GetAutoScale() const
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror)=0
Set the plot offset and scaling for the current plot.
virtual void SetDefaultLineWidth(int width)=0
Set the default line width.
int GetLineWidth() const
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
#define IU_PER_MILS
Definition: plotter.cpp:134
PlotTextMode GetTextMode() const
wxPoint Centre() const
Definition: eda_rect.h:60
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Function ComputeBoundingBox calculates the bounding box containing all board items (or board edge seg...
bool GetUseAuxOrigin() const
const wxSize GetSize() const
Definition: eda_rect.h:101
#define min(a, b)
Definition: auxiliary.h:85

References EDA_RECT::Centre(), BOARD::ComputeBoundingBox(), PCB_PLOT_PARAMS::GetA4Output(), PCB_PLOT_PARAMS::GetAutoScale(), BOARD::GetAuxOrigin(), PCB_PLOT_PARAMS::GetGerberPrecision(), PCB_PLOT_PARAMS::GetLineWidth(), PCB_PLOT_PARAMS::GetMirror(), BOARD::GetPageSettings(), PCB_PLOT_PARAMS::GetScale(), EDA_RECT::GetSize(), PCB_PLOT_PARAMS::GetTextMode(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), IU_PER_MILS, KiROUND(), min, PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetDefaultLineWidth(), PLOTTER::SetGerberCoordinatesFormat(), PLOTTER::SetPageSettings(), PLOTTER::SetTextMode(), and PLOTTER::SetViewport().

Referenced by StartPlotBoard().

◆ PlotLayerOutlines()

void PlotLayerOutlines ( BOARD aBoard,
PLOTTER aPlotter,
LSET  aLayerMask,
const PCB_PLOT_PARAMS aPlotOpt 
)

Function PlotLayerOutlines plot copper outline of a copper layer.

Parameters
aBoard= the board to plot
aPlotter= the plotter to use
aLayerMask= the mask to define the layers to plot
aPlotOpt= the plot options. Has meaning for some formats only

Definition at line 667 of file plot_board_layers.cpp.

669 {
670 
671  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
672  itemplotter.SetLayerSet( aLayerMask );
673 
674  SHAPE_POLY_SET outlines;
675 
676  for( LSEQ seq = aLayerMask.Seq( plot_seq, arrayDim( plot_seq ) ); seq; ++seq )
677  {
678  PCB_LAYER_ID layer = *seq;
679 
680  outlines.RemoveAllContours();
681  aBoard->ConvertBrdLayerToPolygonalContours( layer, outlines );
682 
683  outlines.Simplify( SHAPE_POLY_SET::PM_FAST );
684 
685  // Plot outlines
686  std::vector< wxPoint > cornerList;
687 
688  // Now we have one or more basic polygons: plot each polygon
689  for( int ii = 0; ii < outlines.OutlineCount(); ii++ )
690  {
691  for(int kk = 0; kk <= outlines.HoleCount (ii); kk++ )
692  {
693  cornerList.clear();
694  const SHAPE_LINE_CHAIN& path = (kk == 0) ? outlines.COutline( ii ) : outlines.CHole( ii, kk - 1 );
695 
696  for( int jj = 0; jj < path.PointCount(); jj++ )
697  cornerList.push_back( wxPoint( path.CPoint( jj ).x , path.CPoint( jj ).y ) );
698 
699 
700  // Ensure the polygon is closed
701  if( cornerList[0] != cornerList[cornerList.size() - 1] )
702  cornerList.push_back( cornerList[0] );
703 
704  aPlotter->PlotPoly( cornerList, NO_FILL );
705  }
706  }
707 
708  // Plot pad holes
710  {
711  int smallDrill = (aPlotOpt.GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE)
712  ? SMALL_DRILL : INT_MAX;
713 
714  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
715  {
716  for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
717  {
718  wxSize hole = pad->GetDrillSize();
719 
720  if( hole.x == 0 || hole.y == 0 )
721  continue;
722 
723  if( hole.x == hole.y )
724  {
725  hole.x = std::min( smallDrill, hole.x );
726  aPlotter->Circle( pad->GetPosition(), hole.x, NO_FILL );
727  }
728  else
729  {
730  // Note: small drill marks have no significance when applied to slots
731  wxPoint drl_start, drl_end;
732  int width;
733  pad->GetOblongDrillGeometry( drl_start, drl_end, width );
734  aPlotter->ThickSegment( pad->GetPosition() + drl_start,
735  pad->GetPosition() + drl_end, width, SKETCH, NULL );
736  }
737  }
738  }
739  }
740 
741  // Plot vias holes
742  for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
743  {
744  const VIA* via = dyn_cast<const VIA*>( track );
745 
746  if( via && via->IsOnLayer( layer ) ) // via holes can be not through holes
747  {
748  aPlotter->Circle( via->GetPosition(), via->GetDrillValue(), NO_FILL );
749  }
750  }
751  }
752 }
D_PAD * Next() const
Definition: class_pad.h:160
#define SMALL_DRILL
Definition: pcbplot.h:72
int OutlineCount() const
Returns the number of outlines in the set
static const PCB_LAYER_ID plot_seq[]
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
int PointCount() const
Function PointCount()
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Function Seq returns an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:367
const VECTOR2I & CPoint(int aIndex) const
Function CPoint()
PCB_LAYER_ID
A quick note on layer IDs:
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Class SHAPE_POLY_SET.
void ConvertBrdLayerToPolygonalContours(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aOutlines)
Function ConvertBrdLayerToPolygonalContours Build a set of polygons which are the outlines of copper ...
void Simplify(POLYGON_MODE aFastMode)
Simplifies the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFast...
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
const wxPoint GetPosition() const override
Definition: class_track.h:433
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:99
DLIST< MODULE > m_Modules
Definition: class_board.h:249
Class SHAPE_LINE_CHAIN.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:456
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
DLIST< TRACK > m_Track
Definition: class_board.h:250
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Function IsOnLayer tests to see if this object is on the given layer.
DrillMarksType GetDrillMarksType() const
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
#define min(a, b)
Definition: auxiliary.h:85

References arrayDim(), SHAPE_POLY_SET::CHole(), PLOTTER::Circle(), BOARD::ConvertBrdLayerToPolygonalContours(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), PCB_PLOT_PARAMS::GetDrillMarksType(), VIA::GetDrillValue(), VIA::GetPosition(), SHAPE_POLY_SET::HoleCount(), VIA::IsOnLayer(), BOARD::m_Modules, BOARD::m_Track, min, D_PAD::Next(), PCB_PLOT_PARAMS::NO_DRILL_SHAPE, NO_FILL, SHAPE_POLY_SET::OutlineCount(), plot_seq, PLOTTER::PlotPoly(), SHAPE_POLY_SET::PM_FAST, SHAPE_LINE_CHAIN::PointCount(), SHAPE_POLY_SET::RemoveAllContours(), LSET::Seq(), BRDITEMS_PLOTTER::SetLayerSet(), SHAPE_POLY_SET::Simplify(), SKETCH, SMALL_DRILL, PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE, PLOTTER::ThickSegment(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PlotOneBoardLayer().

◆ PlotOneBoardLayer()

void PlotOneBoardLayer ( BOARD aBoard,
PLOTTER aPlotter,
PCB_LAYER_ID  aLayer,
const PCB_PLOT_PARAMS aPlotOpt 
)

Function PlotOneBoardLayer main function to plot one copper or technical layer.

It prepare options and calls the specialized plot function, according to the layer type

Parameters
aBoard= the board to plot
aPlotter= the plotter to use
aLayer= the layer id to plot
aPlotOpt= the plot options (files, sketch). Has meaning for some formats only

Definition at line 154 of file plot_board_layers.cpp.

156 {
157  PCB_PLOT_PARAMS plotOpt = aPlotOpt;
158  int soldermask_min_thickness = aBoard->GetDesignSettings().m_SolderMaskMinWidth;
159 
160  // Set a default color and the text mode for this layer
161  aPlotter->SetColor( aPlotOpt.GetColor() );
162  aPlotter->SetTextMode( aPlotOpt.GetTextMode() );
163 
164  // Specify that the contents of the "Edges Pcb" layer are to be plotted
165  // in addition to the contents of the currently specified layer.
166  LSET layer_mask( aLayer );
167 
168  if( !aPlotOpt.GetExcludeEdgeLayer() )
169  layer_mask.set( Edge_Cuts );
170 
171  if( IsCopperLayer( aLayer ) )
172  {
173  // Skip NPTH pads on copper layers ( only if hole size == pad size ):
174  // Drill mark will be plotted,
175  // if drill mark is SMALL_DRILL_SHAPE or FULL_DRILL_SHAPE
176  if( plotOpt.GetFormat() == PLOT_FORMAT_DXF )
177  {
178  plotOpt.SetSkipPlotNPTH_Pads( false );
179  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
180  }
181  else
182  {
183  plotOpt.SetSkipPlotNPTH_Pads( true );
184  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
185  }
186  }
187  else
188  {
189  switch( aLayer )
190  {
191  case B_Mask:
192  case F_Mask:
193  plotOpt.SetSkipPlotNPTH_Pads( false );
194  // Disable plot pad holes
196 
197  // Plot solder mask:
198  if( soldermask_min_thickness == 0 )
199  {
200  if( plotOpt.GetFormat() == PLOT_FORMAT_DXF )
201  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
202  else
203  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
204  }
205  else
206  PlotSolderMaskLayer( aBoard, aPlotter, layer_mask, plotOpt,
207  soldermask_min_thickness );
208 
209  break;
210 
211  case B_Adhes:
212  case F_Adhes:
213  case B_Paste:
214  case F_Paste:
215  plotOpt.SetSkipPlotNPTH_Pads( false );
216  // Disable plot pad holes
218 
219  if( plotOpt.GetFormat() == PLOT_FORMAT_DXF )
220  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
221  else
222  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
223  break;
224 
225  case F_SilkS:
226  case B_SilkS:
227  if( plotOpt.GetFormat() == PLOT_FORMAT_DXF && plotOpt.GetDXFPlotPolygonMode() )
228  // PlotLayerOutlines() is designed only for DXF plotters.
229  // and must not be used for other plot formats
230  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
231  else
232  PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
233 
234  // Gerber: Subtract soldermask from silkscreen if enabled
235  if( aPlotter->GetPlotterType() == PLOT_FORMAT_GERBER
236  && plotOpt.GetSubtractMaskFromSilk() )
237  {
238  if( aLayer == F_SilkS )
239  layer_mask = LSET( F_Mask );
240  else
241  layer_mask = LSET( B_Mask );
242 
243  // Create the mask to subtract by creating a negative layer polarity
244  aPlotter->SetLayerPolarity( false );
245 
246  // Disable plot pad holes
248 
249  // Plot the mask
250  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
251  }
252  break;
253 
254  // These layers are plotted like silk screen layers.
255  // Mainly, pads on these layers are not filled.
256  // This is not necessary the best choice.
257  case Dwgs_User:
258  case Cmts_User:
259  case Eco1_User:
260  case Eco2_User:
261  case Edge_Cuts:
262  case Margin:
263  case F_CrtYd:
264  case B_CrtYd:
265  case F_Fab:
266  case B_Fab:
267  plotOpt.SetSkipPlotNPTH_Pads( false );
269 
270  if( plotOpt.GetFormat() == PLOT_FORMAT_DXF && plotOpt.GetDXFPlotPolygonMode() )
271  // PlotLayerOutlines() is designed only for DXF plotters.
272  // and must not be used for other plot formats
273  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
274  else
275  PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
276  break;
277 
278  default:
279  plotOpt.SetSkipPlotNPTH_Pads( false );
281 
282  if( plotOpt.GetFormat() == PLOT_FORMAT_DXF && plotOpt.GetDXFPlotPolygonMode() )
283  // PlotLayerOutlines() is designed only for DXF plotters.
284  // and must not be used for other plot formats
285  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
286  else
287  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
288  break;
289  }
290  }
291 }
bool GetDXFPlotPolygonMode() const
virtual void SetColor(COLOR4D color)=0
virtual void SetLayerPolarity(bool aPositive)
Function SetLayerPolarity sets current Gerber layer polarity to positive or negative by writing %LPD*...
Definition: plotter.h:419
void PlotStandardLayer(BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotStandardLayer plot copper or technical layers.
PlotFormat GetFormat() const
void PlotSilkScreen(BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotSilkScreen plot silkscreen layers which have specific requirements, mainly for pads.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:539
void SetDrillMarksType(DrillMarksType aVal)
static void PlotSolderMaskLayer(BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt, int aMinThickness)
void PlotLayerOutlines(BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotLayerOutlines plot copper outline of a copper layer.
Class LSET is a set of PCB_LAYER_IDs.
virtual void SetTextMode(PlotTextMode mode)
Change the current text mode.
Definition: plotter.h:428
COLOR4D GetColor() const
void SetSkipPlotNPTH_Pads(bool aSkip)
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
bool GetSubtractMaskFromSilk() const
virtual PlotFormat GetPlotterType() const =0
Returns the effective plot engine in use.
PlotTextMode GetTextMode() const
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
bool GetExcludeEdgeLayer() const
int m_SolderMaskMinWidth
Solder mask min width.

References B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, PCB_PLOT_PARAMS::GetColor(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetDXFPlotPolygonMode(), PCB_PLOT_PARAMS::GetExcludeEdgeLayer(), PCB_PLOT_PARAMS::GetFormat(), PLOTTER::GetPlotterType(), PCB_PLOT_PARAMS::GetSubtractMaskFromSilk(), PCB_PLOT_PARAMS::GetTextMode(), IsCopperLayer(), BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, Margin, PCB_PLOT_PARAMS::NO_DRILL_SHAPE, PLOT_FORMAT_DXF, PLOT_FORMAT_GERBER, PlotLayerOutlines(), PlotSilkScreen(), PlotSolderMaskLayer(), PlotStandardLayer(), PLOTTER::SetColor(), PCB_PLOT_PARAMS::SetDrillMarksType(), PLOTTER::SetLayerPolarity(), PCB_PLOT_PARAMS::SetSkipPlotNPTH_Pads(), and PLOTTER::SetTextMode().

Referenced by DIALOG_EXPORT_SVG::CreateSVGFile(), DIALOG_PLOT::Plot(), and PLOT_CONTROLLER::PlotLayer().

◆ PlotSilkScreen()

void PlotSilkScreen ( BOARD aBoard,
PLOTTER aPlotter,
LSET  aLayerMask,
const PCB_PLOT_PARAMS aPlotOpt 
)

Function PlotSilkScreen plot silkscreen layers which have specific requirements, mainly for pads.

Should not be used for other layers

Parameters
aBoard= the board to plot
aPlotter= the plotter to use
aLayerMask= the mask to define the layers to plot (silkscreen Front and/or Back)
aPlotOpt= the plot options (files, sketch). Has meaning for some formats only

Definition at line 69 of file plot_board_layers.cpp.

71 {
72  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
73  itemplotter.SetLayerSet( aLayerMask );
74 
75  // Plot edge layer and graphic items
76  itemplotter.PlotBoardGraphicItems();
77 
78  // Plot footprint outlines :
79  itemplotter.Plot_Edges_Modules();
80 
81  // Plot pads (creates pads outlines, for pads on silkscreen layers)
82  LSET layersmask_plotpads = aLayerMask;
83 
84  // Calculate the mask layers of allowed layers for pads
85 
86  if( !aPlotOpt.GetPlotPadsOnSilkLayer() ) // Do not plot pads on silk screen layers
87  layersmask_plotpads.set( B_SilkS, false ).set( F_SilkS, false );
88 
89  if( layersmask_plotpads.any() )
90  {
91  for( MODULE* Module = aBoard->m_Modules; Module; Module = Module->Next() )
92  {
93  aPlotter->StartBlock( NULL );
94 
95  for( D_PAD* pad = Module->PadsList(); pad; pad = pad->Next() )
96  {
97  // See if the pad is on this layer
98  LSET masklayer = pad->GetLayerSet();
99  if( !( masklayer & layersmask_plotpads ).any() )
100  continue;
101 
103 
104  if( layersmask_plotpads[B_SilkS] )
105  color = aBoard->Colors().GetLayerColor( B_SilkS );
106 
107  if( layersmask_plotpads[F_SilkS] )
108  color = ( color == COLOR4D::BLACK) ? aBoard->Colors().GetLayerColor( F_SilkS ) : color;
109 
110  itemplotter.PlotPad( pad, color, SKETCH );
111  }
112 
113  aPlotter->EndBlock( NULL );
114  }
115  }
116 
117  // Plot footprints fields (ref, value ...)
118  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
119  {
120  if( ! itemplotter.PlotAllTextsModule( module ) )
121  {
122  wxLogMessage( _( "Your BOARD has a bad layer number for footprint %s" ),
123  GetChars( module->GetReference() ) );
124  }
125  }
126 
127  // Plot filled areas
128  aPlotter->StartBlock( NULL );
129 
130  for( int ii = 0; ii < aBoard->GetAreaCount(); ii++ )
131  {
132  ZONE_CONTAINER* edge_zone = aBoard->GetArea( ii );
133 
134  if( !aLayerMask[ edge_zone->GetLayer() ] )
135  continue;
136 
137  itemplotter.PlotFilledAreas( edge_zone );
138  }
139 
140  aPlotter->EndBlock( NULL );
141 
142  // Plot segments used to fill zone areas (deprecated, but here for very old boards
143  // compatibility):
144  for( SEGZONE* seg = aBoard->m_SegZoneDeprecated; seg; seg = seg->Next() )
145  {
146  if( !aLayerMask[ seg->GetLayer() ] )
147  continue;
148 
149  aPlotter->ThickSegment( seg->GetStart(), seg->GetEnd(), seg->GetWidth(),
150  itemplotter.GetPlotMode(), NULL );
151  }
152 }
D_PAD * Next() const
Definition: class_pad.h:160
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:59
virtual void EndBlock(void *aData)
calling this function allows one to define the end of a group of drawing items for instance in SVG or...
Definition: plotter.h:454
int color
Definition: DXF_plotter.cpp:62
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:179
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
Definition: plotter.h:445
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1026
Class LSET is a set of PCB_LAYER_IDs.
DLIST< SEGZONE > m_SegZoneDeprecated
Definition: class_board.h:251
const COLORS_DESIGN_SETTINGS & Colors() const
Function GetColorSettings.
Definition: class_board.h:572
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
DLIST< MODULE > m_Modules
Definition: class_board.h:249
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:456
bool GetPlotPadsOnSilkLayer() const
Definition: colors.h:45
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:997
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References B_SilkS, BLACK, color, BOARD::Colors(), PLOTTER::EndBlock(), F_SilkS, BOARD::GetArea(), BOARD::GetAreaCount(), GetChars(), ZONE_CONTAINER::GetLayer(), COLORS_DESIGN_SETTINGS::GetLayerColor(), PCB_PLOT_PARAMS::GetPlotMode(), PCB_PLOT_PARAMS::GetPlotPadsOnSilkLayer(), BOARD::m_Modules, BOARD::m_SegZoneDeprecated, D_PAD::Next(), BRDITEMS_PLOTTER::Plot_Edges_Modules(), BRDITEMS_PLOTTER::PlotAllTextsModule(), BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotPad(), BRDITEMS_PLOTTER::SetLayerSet(), SKETCH, PLOTTER::StartBlock(), and PLOTTER::ThickSegment().

Referenced by PlotOneBoardLayer().

◆ PlotSolderMaskLayer()

void PlotSolderMaskLayer ( BOARD aBoard,
PLOTTER aPlotter,
LSET  aLayerMask,
const PCB_PLOT_PARAMS aPlotOpt,
int  aMinThickness 
)
static

Definition at line 773 of file plot_board_layers.cpp.

776 {
777  PCB_LAYER_ID layer = aLayerMask[B_Mask] ? B_Mask : F_Mask;
778 
779  // We remove 1nm as we expand both sides of the shapes, so allowing for
780  // a strictly greater than or equal comparison in the shape separation (boolean add)
781  // means that we will end up with separate shapes that then are shrunk
782  int inflate = aMinThickness/2 - 1;
783 
784  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
785  itemplotter.SetLayerSet( aLayerMask );
786 
787  // Plot edge layer and graphic items
788  // They do not have a solder Mask margin, because they are only graphic items
789  // on this layer (like logos), not actually areas around pads.
790  itemplotter.PlotBoardGraphicItems();
791 
792  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
793  {
794  for( BOARD_ITEM* item = module->GraphicalItemsList(); item; item = item->Next() )
795  {
796  if( layer != item->GetLayer() )
797  continue;
798 
799  switch( item->Type() )
800  {
801  case PCB_MODULE_EDGE_T:
802  itemplotter.Plot_1_EdgeModule( (EDGE_MODULE*) item );
803  break;
804 
805  default:
806  break;
807  }
808  }
809  }
810 
811  // Build polygons for each pad shape.
812  // the size of the shape on solder mask should be:
813  // size of pad + clearance around the pad.
814  // clearance = solder mask clearance + extra margin
815  // extra margin is half the min width for solder mask
816  // This extra margin is used to merge too close shapes
817  // (distance < aMinThickness), and will be removed when creating
818  // the actual shapes
819  SHAPE_POLY_SET areas; // Contains shapes to plot
820  SHAPE_POLY_SET initialPolys; // Contains exact shapes to plot
821 
822  /* calculates the coeff to compensate radius reduction of holes clearance
823  * due to the segment approx ( 1 /cos( PI/circleToSegmentsCount )
824  */
825  int circleToSegmentsCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF;
826  double correction = GetCircletoPolyCorrectionFactor( circleToSegmentsCount );
827 
828  // Plot pads
829  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
830  {
831  // add shapes with exact size
832  module->TransformPadsShapesWithClearanceToPolygon( layer,
833  initialPolys, 0, circleToSegmentsCount, correction );
834  // add shapes inflated by aMinThickness/2
835  module->TransformPadsShapesWithClearanceToPolygon( layer,
836  areas, inflate, circleToSegmentsCount, correction );
837  }
838 
839  // Plot vias on solder masks, if aPlotOpt.GetPlotViaOnMaskLayer() is true,
840  if( aPlotOpt.GetPlotViaOnMaskLayer() )
841  {
842  // The current layer is a solder mask,
843  // use the global mask clearance for vias
844  int via_clearance = aBoard->GetDesignSettings().m_SolderMaskMargin;
845  int via_margin = via_clearance + inflate;
846 
847  for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
848  {
849  const VIA* via = dyn_cast<const VIA*>( track );
850 
851  if( !via )
852  continue;
853 
854  // vias are plotted only if they are on the corresponding
855  // external copper layer
856  LSET via_set = via->GetLayerSet();
857 
858  if( via_set[B_Cu] )
859  via_set.set( B_Mask );
860 
861  if( via_set[F_Cu] )
862  via_set.set( F_Mask );
863 
864  if( !( via_set & aLayerMask ).any() )
865  continue;
866 
867  via->TransformShapeWithClearanceToPolygon( areas, via_margin,
868  circleToSegmentsCount,
869  correction );
870  via->TransformShapeWithClearanceToPolygon( initialPolys, via_clearance,
871  circleToSegmentsCount,
872  correction );
873  }
874  }
875 
876  // Add filled zone areas.
877 #if 0 // Set to 1 if a solder mask margin must be applied to zones on solder mask
878  int zone_margin = aBoard->GetDesignSettings().m_SolderMaskMargin;
879 #else
880  int zone_margin = 0;
881 #endif
882 
883  for( int ii = 0; ii < aBoard->GetAreaCount(); ii++ )
884  {
885  ZONE_CONTAINER* zone = aBoard->GetArea( ii );
886 
887  if( zone->GetLayer() != layer )
888  continue;
889 
891  inflate+zone_margin, false );
893  zone_margin, false );
894  }
895 
896  // To avoid a lot of code, use a ZONE_CONTAINER
897  // to handle and plot polygons, because our polygons look exactly like
898  // filled areas in zones
899  // Note, also this code is not optimized: it creates a lot of copy/duplicate data
900  // However it is not complex, and fast enough for plot purposes (copy/convert data
901  // is only a very small calculation time for these calculations)
902  ZONE_CONTAINER zone( aBoard );
904  zone.SetMinThickness( 0 ); // trace polygons only
905  zone.SetLayer ( layer );
906 
907  areas.BooleanAdd( initialPolys, SHAPE_POLY_SET::PM_FAST );
908  areas.Inflate( -inflate, circleToSegmentsCount );
909 
910  // Combine the current areas to initial areas. This is mandatory because
911  // inflate/deflate transform is not perfect, and we want the initial areas perfectly kept
912  areas.BooleanAdd( initialPolys, SHAPE_POLY_SET::PM_FAST );
914 
915  zone.SetFilledPolysList( areas );
916 
917  itemplotter.PlotFilledAreas( &zone );
918 }
void SetFilledPolysList(SHAPE_POLY_SET &aPolysList)
Function SetFilledPolysList sets the list of filled polygons.
Definition: class_zone.h:580
int m_SolderMaskMargin
Solder mask margin.
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:59
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, int aClearanceValue, int aCircleToSegmentsCount, double aCorrectionFactor, bool ignoreLineWidth=false) const override
Function TransformShapeWithClearanceToPolygon Convert the track shape to a closed polygon Used in fil...
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset union For aFastMode meaning, see function booleanOp
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
void TransformOutlinesShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, int aMinClearanceValue, bool aUseNetClearance) const
Function TransformOutlinesShapeWithClearanceToPolygon Convert the outlines shape to a polygon with no...
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:179
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:539
void SetArcSegmentCount(int aArcSegCount)
Definition: class_zone.h:185
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
PCB_LAYER_ID
A quick note on layer IDs:
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1026
Class LSET is a set of PCB_LAYER_IDs.
void Inflate(int aFactor, int aCircleSegmentsCount)
Performs outline inflation/deflation, using round corners.
Class SHAPE_POLY_SET.
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Function SetLayer sets the layer this item is on.
Definition: class_zone.cpp:206
void Fracture(POLYGON_MODE aFastMode)
Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the oute...
bool GetPlotViaOnMaskLayer() const
BOARD_ITEM * Next() const
DLIST< MODULE > m_Modules
Definition: class_board.h:249
DLIST< TRACK > m_Track
Definition: class_board.h:250
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:997
void SetMinThickness(int aMinThickness)
Definition: class_zone.h:201
#define ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF
Definition: pcbnew.h:42
double GetCircletoPolyCorrectionFactor(int aSegCountforCircle)

References ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF, B_Cu, B_Mask, SHAPE_POLY_SET::BooleanAdd(), F_Cu, F_Mask, SHAPE_POLY_SET::Fracture(), BOARD::GetArea(), BOARD::GetAreaCount(), GetCircletoPolyCorrectionFactor(), BOARD::GetDesignSettings(), ZONE_CONTAINER::GetLayer(), VIA::GetLayerSet(), PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer(), SHAPE_POLY_SET::Inflate(), BOARD::m_Modules, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, BOARD::m_Track, BOARD_ITEM::Next(), PCB_MODULE_EDGE_T, BRDITEMS_PLOTTER::Plot_1_EdgeModule(), BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotFilledAreas(), SHAPE_POLY_SET::PM_FAST, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, ZONE_CONTAINER::SetArcSegmentCount(), ZONE_CONTAINER::SetFilledPolysList(), ZONE_CONTAINER::SetLayer(), BRDITEMS_PLOTTER::SetLayerSet(), ZONE_CONTAINER::SetMinThickness(), ZONE_CONTAINER::TransformOutlinesShapeWithClearanceToPolygon(), and TRACK::TransformShapeWithClearanceToPolygon().

Referenced by PlotOneBoardLayer().

◆ PlotStandardLayer()

void PlotStandardLayer ( BOARD aBoard,
PLOTTER aPlotter,
LSET  aLayerMask,
const PCB_PLOT_PARAMS aPlotOpt 
)

Function PlotStandardLayer plot copper or technical layers.

not used for silk screen layers, because these layers have specific requirements, mainly for pads

Parameters
aBoard= the board to plot
aPlotter= the plotter to use
aLayerMask= the mask to define the layers to plot
aPlotOpt= the plot options (files, sketch). Has meaning for some formats only

aPlotOpt has 3 important options to control this plot, which are set, depending on the layer type to plot SetEnablePlotVia( bool aEnable ) aEnable = true to plot vias, false to skip vias (has meaning only for solder mask layers). SetSkipPlotNPTH_Pads( bool aSkip ) aSkip = true to skip NPTH Pads, when the pad size and the pad hole have the same size. Used in GERBER format only. SetDrillMarksType( DrillMarksType aVal ) controle the actual hole: no hole, small hole, actual hole

Definition at line 297 of file plot_board_layers.cpp.

299 {
300  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
301 
302  itemplotter.SetLayerSet( aLayerMask );
303 
304  EDA_DRAW_MODE_T plotMode = aPlotOpt.GetPlotMode();
305 
306  // Plot edge layer and graphic items
307  itemplotter.PlotBoardGraphicItems();
308 
309  // Draw footprint shapes without pads (pads will plotted later)
310  // We plot here module texts, but they are usually on silkscreen layer,
311  // so they are not plot here but plot by PlotSilkScreen()
312  // Plot footprints fields (ref, value ...)
313  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
314  {
315  if( ! itemplotter.PlotAllTextsModule( module ) )
316  {
317  wxLogMessage( _( "Your BOARD has a bad layer number for footprint %s" ),
318  GetChars( module->GetReference() ) );
319  }
320  }
321 
322  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
323  {
324  for( BOARD_ITEM* item = module->GraphicalItemsList(); item; item = item->Next() )
325  {
326  if( !aLayerMask[ item->GetLayer() ] )
327  continue;
328 
329  switch( item->Type() )
330  {
331  case PCB_MODULE_EDGE_T:
332  itemplotter.Plot_1_EdgeModule( (EDGE_MODULE*) item );
333  break;
334 
335  default:
336  break;
337  }
338  }
339  }
340 
341  // Plot footprint pads
342  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
343  {
344  aPlotter->StartBlock( NULL );
345 
346  for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
347  {
348  if( (pad->GetLayerSet() & aLayerMask) == 0 )
349  continue;
350 
351  wxSize margin;
352  double width_adj = 0;
353 
354  if( ( aLayerMask & LSET::AllCuMask() ).any() )
355  width_adj = itemplotter.getFineWidthAdj();
356 
357  static const LSET speed( 4, B_Mask, F_Mask, B_Paste, F_Paste );
358 
359  LSET anded = ( speed & aLayerMask );
360 
361  if( anded == LSET( F_Mask ) || anded == LSET( B_Mask ) )
362  {
363  margin.x = margin.y = pad->GetSolderMaskMargin();
364  }
365  else if( anded == LSET( F_Paste ) || anded == LSET( B_Paste ) )
366  {
367  margin = pad->GetSolderPasteMargin();
368  }
369 
370  // Now offset the pad size by margin + width_adj
371  // this is easy for most shapes, but not for a trapezoid or a custom shape
372  wxSize padPlotsSize;
373  wxSize extraSize = margin * 2;
374  extraSize.x += width_adj;
375  extraSize.y += width_adj;
376  wxSize deltaSize = pad->GetDelta(); // has meaning only for trapezoidal pads
377 
378  if( pad->GetShape() == PAD_SHAPE_TRAPEZOID )
379  { // The easy way is to use BuildPadPolygon to calculate
380  // size and delta of the trapezoidal pad after offseting:
381  wxPoint coord[4];
382  pad->BuildPadPolygon( coord, extraSize/2, 0.0 );
383  // Calculate the size and delta from polygon corners coordinates:
384  // coord[0] is the lower left
385  // coord[1] is the upper left
386  // coord[2] is the upper right
387  // coord[3] is the lower right
388 
389  // the size is the distance between middle of segments
390  // (left/right or top/bottom)
391  // size X is the dist between left and right middle points:
392  padPlotsSize.x = ( ( -coord[0].x + coord[3].x ) // the lower segment X length
393  + ( -coord[1].x + coord[2].x ) ) // the upper segment X length
394  / 2; // the Y size is the half sum
395  // size Y is the dist between top and bottom middle points:
396  padPlotsSize.y = ( ( coord[0].y - coord[1].y ) // the left segment Y lenght
397  + ( coord[3].y - coord[2].y ) ) // the right segment Y lenght
398  / 2; // the Y size is the half sum
399 
400  // calculate the delta ( difference of lenght between 2 opposite edges )
401  // The delta.x is the delta along the X axis, therefore the delta of Y lenghts
402  wxSize delta;
403 
404  if( coord[0].y != coord[3].y )
405  delta.x = coord[0].y - coord[3].y;
406  else
407  delta.y = coord[1].x - coord[0].x;
408 
409  pad->SetDelta( delta );
410  }
411  else
412  padPlotsSize = pad->GetSize() + extraSize;
413 
414  // Don't draw a null size item :
415  if( padPlotsSize.x <= 0 || padPlotsSize.y <= 0 )
416  continue;
417 
419 
420  if( pad->GetLayerSet()[B_Cu] )
421  color = aBoard->Colors().GetItemColor( LAYER_PAD_BK );
422 
423  if( pad->GetLayerSet()[F_Cu] )
424  color = color.LegacyMix( aBoard->Colors().GetItemColor( LAYER_PAD_FR ) );
425 
426  // Temporary set the pad size to the required plot size:
427  wxSize tmppadsize = pad->GetSize();
428 
429  switch( pad->GetShape() )
430  {
431  case PAD_SHAPE_CIRCLE:
432  case PAD_SHAPE_OVAL:
433  pad->SetSize( padPlotsSize );
434 
435  if( aPlotOpt.GetSkipPlotNPTH_Pads() &&
436  ( pad->GetSize() == pad->GetDrillSize() ) &&
437  ( pad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED ) )
438  break;
439 
440  itemplotter.PlotPad( pad, color, plotMode );
441  break;
442 
443  case PAD_SHAPE_TRAPEZOID:
444  case PAD_SHAPE_RECT:
445  case PAD_SHAPE_ROUNDRECT:
447  pad->SetSize( padPlotsSize );
448  itemplotter.PlotPad( pad, color, plotMode );
449  break;
450 
451  case PAD_SHAPE_CUSTOM:
452  // inflate/deflate a custom shape is a bit complex.
453  // so build a similar pad shape, and inflate/deflate the polygonal shape
454  {
455  // we expect margin.x = margin.y for custom pads
456  if( margin.x < 0 )
457  // be sure the anchor pad is not bigger than the deflated shape
458  // because this anchor will be added to the pad shape when plotting
459  // the pad
460  pad->SetSize( padPlotsSize );
461 
462  D_PAD dummy( *pad );
463  SHAPE_POLY_SET shape;
464  pad->MergePrimitivesAsPolygon( &shape, 64 );
465  shape.Inflate( margin.x, ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF );
466  dummy.DeletePrimitivesList();
467  dummy.AddPrimitive( shape, 0 );
468  dummy.MergePrimitivesAsPolygon();
469 
470  itemplotter.PlotPad( &dummy, color, plotMode );
471  }
472  break;
473  }
474 
475  pad->SetSize( tmppadsize ); // Restore the pad size
476  pad->SetDelta( deltaSize );
477  }
478 
479  aPlotter->EndBlock( NULL );
480  }
481 
482  // Plot vias on copper layers, and if aPlotOpt.GetPlotViaOnMaskLayer() is true,
483  // plot them on solder mask
484 
485  GBR_METADATA gbr_metadata;
486 
487  bool isOnCopperLayer = ( aLayerMask & LSET::AllCuMask() ).any();
488 
489  if( isOnCopperLayer )
490  {
493  }
494 
495  aPlotter->StartBlock( NULL );
496 
497  for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
498  {
499  const VIA* Via = dyn_cast<const VIA*>( track );
500 
501  if( !Via )
502  continue;
503 
504  // vias are not plotted if not on selected layer, but if layer
505  // is SOLDERMASK_LAYER_BACK or SOLDERMASK_LAYER_FRONT,vias are drawn,
506  // only if they are on the corresponding external copper layer
507  LSET via_mask_layer = Via->GetLayerSet();
508 
509  if( aPlotOpt.GetPlotViaOnMaskLayer() )
510  {
511  if( via_mask_layer[B_Cu] )
512  via_mask_layer.set( B_Mask );
513 
514  if( via_mask_layer[F_Cu] )
515  via_mask_layer.set( F_Mask );
516  }
517 
518  if( !( via_mask_layer & aLayerMask ).any() )
519  continue;
520 
521  int via_margin = 0;
522  double width_adj = 0;
523 
524  // If the current layer is a solder mask, use the global mask
525  // clearance for vias
526  if( aLayerMask[B_Mask] || aLayerMask[F_Mask] )
527  via_margin = aBoard->GetDesignSettings().m_SolderMaskMargin;
528 
529  if( ( aLayerMask & LSET::AllCuMask() ).any() )
530  width_adj = itemplotter.getFineWidthAdj();
531 
532  int diameter = Via->GetWidth() + 2 * via_margin + width_adj;
533 
534  // Don't draw a null size item :
535  if( diameter <= 0 )
536  continue;
537 
538  // Some vias can be not connected (no net).
539  // Set the m_NotInNet for these vias to force a empty net name in gerber file
540  gbr_metadata.m_NetlistMetadata.m_NotInNet = Via->GetNetname().IsEmpty();
541 
542  gbr_metadata.SetNetName( Via->GetNetname() );
543 
544  COLOR4D color = aBoard->Colors().GetItemColor( LAYER_VIAS + Via->GetViaType() );
545  // Set plot color (change WHITE to LIGHTGRAY because
546  // the white items are not seen on a white paper or screen
547  aPlotter->SetColor( color != WHITE ? color : LIGHTGRAY);
548  aPlotter->FlashPadCircle( Via->GetStart(), diameter, plotMode, &gbr_metadata );
549  }
550 
551  aPlotter->EndBlock( NULL );
552  aPlotter->StartBlock( NULL );
554 
555  // Plot tracks (not vias) :
556  for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
557  {
558  if( track->Type() == PCB_VIA_T )
559  continue;
560 
561  if( !aLayerMask[track->GetLayer()] )
562  continue;
563 
564  // Some track segments can be not connected (no net).
565  // Set the m_NotInNet for these segments to force a empty net name in gerber file
566  gbr_metadata.m_NetlistMetadata.m_NotInNet = track->GetNetname().IsEmpty();
567 
568  gbr_metadata.SetNetName( track->GetNetname() );
569  int width = track->GetWidth() + itemplotter.getFineWidthAdj();
570  aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) );
571  aPlotter->ThickSegment( track->GetStart(), track->GetEnd(), width, plotMode, &gbr_metadata );
572  }
573 
574  aPlotter->EndBlock( NULL );
575 
576  // Plot zones (deprecated, for very old boards compatibility):
577  for( TRACK* track = aBoard->m_SegZoneDeprecated; track; track = track->Next() )
578  {
579  if( !aLayerMask[track->GetLayer()] )
580  continue;
581 
582  int width = track->GetWidth() + itemplotter.getFineWidthAdj();
583  aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) );
584  aPlotter->ThickSegment( track->GetStart(), track->GetEnd(), width, plotMode, NULL );
585  }
586 
587  // Plot filled ares
588  aPlotter->StartBlock( NULL );
589  for( int ii = 0; ii < aBoard->GetAreaCount(); ii++ )
590  {
591  ZONE_CONTAINER* zone = aBoard->GetArea( ii );
592 
593  if( !aLayerMask[zone->GetLayer()] )
594  continue;
595 
596  itemplotter.PlotFilledAreas( zone );
597  }
598  aPlotter->EndBlock( NULL );
599 
600  // Adding drill marks, if required and if the plotter is able to plot them:
602  itemplotter.PlotDrillMarks();
603 }
D_PAD * Next() const
Definition: class_pad.h:160
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:676
int m_SolderMaskMargin
Solder mask margin.
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:59
virtual void EndBlock(void *aData)
calling this function allows one to define the end of a group of drawing items for instance in SVG or...
Definition: plotter.h:454
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:66
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
virtual void SetColor(COLOR4D color)=0
const wxPoint & GetStart() const
Definition: class_track.h:126
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:152
int color
Definition: DXF_plotter.cpp:62
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:179
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
Definition: plotter.h:445
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:539
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
static const int delta[8][2]
Definition: solve.cpp:112
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCircle
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1026
Class LSET is a set of PCB_LAYER_IDs.
void Inflate(int aFactor, int aCircleSegmentsCount)
Performs outline inflation/deflation, using round corners.
Class SHAPE_POLY_SET.
EDA_DRAW_MODE_T
Definition: eda_text.h:77
DLIST< SEGZONE > m_SegZoneDeprecated
Definition: class_board.h:251
VIATYPE_T GetViaType() const
Definition: class_track.h:461
bool GetSkipPlotNPTH_Pads() const
const wxString & GetNetname() const
Function GetNetname.
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:84
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:162
const COLORS_DESIGN_SETTINGS & Colors() const
Function GetColorSettings.
Definition: class_board.h:572
bool GetPlotViaOnMaskLayer() const
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
smd pads, front layer
BOARD_ITEM * Next() const
int GetWidth() const
Definition: class_track.h:120
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
DLIST< MODULE > m_Modules
Definition: class_board.h:249
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:456
Definition: colors.h:49
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:142
bool m_NotInNet
true if a pad of a footprint cannot be connected (for instance a mechanical NPTH, ot a not named pad)...
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
DLIST< TRACK > m_Track
Definition: class_board.h:250
GBR_NETLIST_METADATA m_NetlistMetadata
a item to handle object attribute:
Definition: gbr_metadata.h:181
Definition: colors.h:45
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:997
DrillMarksType GetDrillMarksType() const
#define ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF
Definition: pcbnew.h:42
print info associated to a net (TO.N attribute)
EDA_DRAW_MODE_T GetPlotMode() const
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References LSET::AllCuMask(), ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF, B_Cu, B_Mask, B_Paste, BLACK, color, BOARD::Colors(), delta, dummy(), PLOTTER::EndBlock(), F_Cu, F_Mask, F_Paste, PLOTTER::FlashPadCircle(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_VIAPAD, GBR_NETLIST_METADATA::GBR_NETINFO_NET, BOARD::GetArea(), BOARD::GetAreaCount(), GetChars(), BRDITEMS_PLOTTER::getColor(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetDrillMarksType(), BRDITEMS_PLOTTER::getFineWidthAdj(), COLORS_DESIGN_SETTINGS::GetItemColor(), ZONE_CONTAINER::GetLayer(), VIA::GetLayerSet(), BOARD_CONNECTED_ITEM::GetNetname(), PCB_PLOT_PARAMS::GetPlotMode(), PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer(), PCB_PLOT_PARAMS::GetSkipPlotNPTH_Pads(), TRACK::GetStart(), VIA::GetViaType(), TRACK::GetWidth(), SHAPE_POLY_SET::Inflate(), LAYER_PAD_BK, LAYER_PAD_FR, LAYER_VIAS, LIGHTGRAY, BOARD::m_Modules, GBR_METADATA::m_NetlistMetadata, GBR_NETLIST_METADATA::m_NotInNet, BOARD::m_SegZoneDeprecated, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, BOARD::m_Track, BOARD_ITEM::Next(), D_PAD::Next(), PCB_PLOT_PARAMS::NO_DRILL_SHAPE, PAD_ATTRIB_HOLE_NOT_PLATED, PAD_SHAPE_CHAMFERED_RECT, PAD_SHAPE_CIRCLE, PAD_SHAPE_CUSTOM, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, PCB_MODULE_EDGE_T, PCB_VIA_T, BRDITEMS_PLOTTER::Plot_1_EdgeModule(), BRDITEMS_PLOTTER::PlotAllTextsModule(), BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotDrillMarks(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotPad(), GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), BRDITEMS_PLOTTER::SetLayerSet(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetNetName(), PLOTTER::StartBlock(), PLOTTER::ThickSegment(), and WHITE.

Referenced by PlotOneBoardLayer().

◆ StartPlotBoard()

PLOTTER* StartPlotBoard ( BOARD aBoard,
PCB_PLOT_PARAMS aPlotOpts,
int  aLayer,
const wxString &  aFullFileName,
const wxString &  aSheetDesc 
)

Open a new plotfile using the options (and especially the format) specified in the options and prepare the page for plotting.

Return the plotter object if OK, NULL if the file is not created (or has a problem)

Definition at line 1047 of file plot_board_layers.cpp.

1051 {
1052  // Create the plotter driver and set the few plotter specific
1053  // options
1054  PLOTTER* plotter = NULL;
1055 
1056  switch( aPlotOpts->GetFormat() )
1057  {
1058  case PLOT_FORMAT_DXF:
1059  plotter = new DXF_PLOTTER();
1060  break;
1061 
1062  case PLOT_FORMAT_POST:
1063  PS_PLOTTER* PS_plotter;
1064  PS_plotter = new PS_PLOTTER();
1065  PS_plotter->SetScaleAdjust( aPlotOpts->GetFineScaleAdjustX(),
1066  aPlotOpts->GetFineScaleAdjustY() );
1067  plotter = PS_plotter;
1068  break;
1069 
1070  case PLOT_FORMAT_PDF:
1071  plotter = new PDF_PLOTTER();
1072  break;
1073 
1074  case PLOT_FORMAT_HPGL:
1075  HPGL_PLOTTER* HPGL_plotter;
1076  HPGL_plotter = new HPGL_PLOTTER();
1077 
1078  /* HPGL options are a little more convoluted to compute, so
1079  they're split in another function */
1080  ConfigureHPGLPenSizes( HPGL_plotter, aPlotOpts );
1081  plotter = HPGL_plotter;
1082  break;
1083 
1084  case PLOT_FORMAT_GERBER:
1085  plotter = new GERBER_PLOTTER();
1086  break;
1087 
1088  case PLOT_FORMAT_SVG:
1089  plotter = new SVG_PLOTTER();
1090  break;
1091 
1092  default:
1093  wxASSERT( false );
1094  return NULL;
1095  }
1096 
1097  // Compute the viewport and set the other options
1098 
1099  // page layout is not mirrored, so temporary change mirror option
1100  // just to plot the page layout
1101  PCB_PLOT_PARAMS plotOpts = *aPlotOpts;
1102 
1103  if( plotOpts.GetPlotFrameRef() && plotOpts.GetMirror() )
1104  plotOpts.SetMirror( false );
1105 
1106  initializePlotter( plotter, aBoard, &plotOpts );
1107 
1108  if( plotter->OpenFile( aFullFileName ) )
1109  {
1110  plotter->ClearHeaderLinesList();
1111 
1112  // For the Gerber "file function" attribute, set the layer number
1113  if( plotter->GetPlotterType() == PLOT_FORMAT_GERBER )
1114  {
1115  bool useX2mode = plotOpts.GetUseGerberX2format();
1116 
1117  GERBER_PLOTTER* gbrplotter = static_cast <GERBER_PLOTTER*> ( plotter );
1118  gbrplotter->UseX2format( useX2mode );
1119  gbrplotter->UseX2NetAttributes( plotOpts.GetIncludeGerberNetlistInfo() );
1120 
1121  // Attributes can be added using X2 format or as comment (X1 format)
1122  AddGerberX2Attribute( plotter, aBoard, aLayer, not useX2mode );
1123  }
1124 
1125  plotter->StartPlot();
1126 
1127  // Plot the frame reference if requested
1128  if( aPlotOpts->GetPlotFrameRef() )
1129  {
1130  PlotWorkSheet( plotter, aBoard->GetTitleBlock(),
1131  aBoard->GetPageSettings(),
1132  1, 1, // Only one page
1133  aSheetDesc, aBoard->GetFileName() );
1134 
1135  if( aPlotOpts->GetMirror() )
1136  initializePlotter( plotter, aBoard, aPlotOpts );
1137  }
1138 
1139  /* When plotting a negative board: draw a black rectangle
1140  * (background for plot board in white) and switch the current
1141  * color to WHITE; note the color inversion is actually done
1142  * in the driver (if supported) */
1143  if( aPlotOpts->GetNegative() )
1144  {
1145  EDA_RECT bbox = aBoard->ComputeBoundingBox();
1146  FillNegativeKnockout( plotter, bbox );
1147  }
1148 
1149  return plotter;
1150  }
1151 
1152  delete plotter;
1153  return NULL;
1154 }
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:554
void UseX2NetAttributes(bool aEnable)
Definition: plotter.h:1157
bool GetPlotFrameRef() const
static void initializePlotter(PLOTTER *aPlotter, BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts)
Set up most plot options for plotting a board (especially the viewport) Important thing: page size is...
virtual bool StartPlot()=0
static void FillNegativeKnockout(PLOTTER *aPlotter, const EDA_RECT &aBbbox)
Prefill in black an area a little bigger than the board to prepare for the negative plot.
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:79
void SetScaleAdjust(double scaleX, double scaleY)
Set the 'fine' scaling for the postscript engine.
Definition: plotter.h:684
PlotFormat GetFormat() const
void SetMirror(bool aFlag)
void UseX2format(bool aEnable)
Definition: plotter.h:1156
void AddGerberX2Attribute(PLOTTER *aPlotter, const BOARD *aBoard, LAYER_NUM aLayer, bool aUseX1CompatibilityMode)
Calculates some X2 attributes, as defined in the Gerber file format specification and add them to the...
Definition: pcbplot.cpp:352
const wxString & GetFileName() const
Definition: class_board.h:238
bool GetUseGerberX2format() const
void PlotWorkSheet(PLOTTER *plotter, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename)
bool GetMirror() const
bool GetIncludeGerberNetlistInfo() const
static void ConfigureHPGLPenSizes(HPGL_PLOTTER *aPlotter, PCB_PLOT_PARAMS *aPlotOpts)
Calculate the effective size of HPGL pens and set them in the plotter object.
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
double GetFineScaleAdjustX() const
Base plotter engine class.
Definition: plotter.h:97
TITLE_BLOCK & GetTitleBlock()
Definition: class_board.h:560
virtual PlotFormat GetPlotterType() const =0
Returns the effective plot engine in use.
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void ClearHeaderLinesList()
Function ClearHeaderLinesList remove all lines from the list of free lines to print at the beginning ...
Definition: plotter.h:185
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Function ComputeBoundingBox calculates the bounding box containing all board items (or board edge seg...
double GetFineScaleAdjustY() const
bool GetNegative() const

References AddGerberX2Attribute(), PLOTTER::ClearHeaderLinesList(), BOARD::ComputeBoundingBox(), ConfigureHPGLPenSizes(), FillNegativeKnockout(), BOARD::GetFileName(), PCB_PLOT_PARAMS::GetFineScaleAdjustX(), PCB_PLOT_PARAMS::GetFineScaleAdjustY(), PCB_PLOT_PARAMS::GetFormat(), PCB_PLOT_PARAMS::GetIncludeGerberNetlistInfo(), PCB_PLOT_PARAMS::GetMirror(), PCB_PLOT_PARAMS::GetNegative(), BOARD::GetPageSettings(), PCB_PLOT_PARAMS::GetPlotFrameRef(), PLOTTER::GetPlotterType(), BOARD::GetTitleBlock(), PCB_PLOT_PARAMS::GetUseGerberX2format(), initializePlotter(), PLOTTER::OpenFile(), PLOT_FORMAT_DXF, PLOT_FORMAT_GERBER, PLOT_FORMAT_HPGL, PLOT_FORMAT_PDF, PLOT_FORMAT_POST, PLOT_FORMAT_SVG, PlotWorkSheet(), PCB_PLOT_PARAMS::SetMirror(), PSLIKE_PLOTTER::SetScaleAdjust(), PLOTTER::StartPlot(), GERBER_PLOTTER::UseX2format(), and GERBER_PLOTTER::UseX2NetAttributes().

Referenced by DIALOG_EXPORT_SVG::CreateSVGFile(), PLOT_CONTROLLER::OpenPlotfile(), and DIALOG_PLOT::Plot().

Variable Documentation

◆ plot_seq

const PCB_LAYER_ID plot_seq[]
static

Definition at line 607 of file plot_board_layers.cpp.

Referenced by PlotLayerOutlines().