KiCad PCB EDA Suite
plot_board_layers.cpp File Reference

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

#include <eda_item.h>
#include <geometry/geometry_utils.h>
#include <geometry/shape_segment.h>
#include <pcb_base_frame.h>
#include <math/util.h>
#include <board.h>
#include <core/arraydim.h>
#include <footprint.h>
#include <track.h>
#include <fp_shape.h>
#include <pcb_text.h>
#include <zone.h>
#include <pcb_shape.h>
#include <pcb_target.h>
#include <dimension.h>
#include <pcbplot.h>
#include <plotters_specific.h>
#include <pcb_painter.h>
#include <gbr_metadata.h>
#include <advanced_config.h>

Go to the source code of this file.

Macros

#define NEW_ALGO   1
 

Functions

static void PlotSolderMaskLayer (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt, int aMinThickness)
 
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.

Macro Definition Documentation

◆ NEW_ALGO

#define NEW_ALGO   1

Definition at line 706 of 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 1006 of file plot_board_layers.cpp.

1007 {
1008  // Compute penDiam (the value is given in mils) in pcb units, with plot scale (if Scale is 2,
1009  // penDiam value is always m_HPGLPenDiam so apparent penDiam is actually penDiam / Scale
1010  int penDiam = KiROUND( aPlotOpts->GetHPGLPenDiameter() * IU_PER_MILS / aPlotOpts->GetScale() );
1011 
1012  // Set HPGL-specific options and start
1013  aPlotter->SetPenSpeed( aPlotOpts->GetHPGLPenSpeed() );
1014  aPlotter->SetPenNumber( aPlotOpts->GetHPGLPenNum() );
1015  aPlotter->SetPenDiameter( penDiam );
1016 }
virtual void SetPenDiameter(double diameter)
int GetHPGLPenSpeed() const
double GetScale() const
virtual void SetPenSpeed(int speed)
Definition: plotter_hpgl.h:77
int GetHPGLPenNum() const
virtual void SetPenNumber(int number)
Definition: plotter_hpgl.h:82
double GetHPGLPenDiameter() const
#define IU_PER_MILS
Definition: plotter.cpp:137
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68

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 991 of file plot_board_layers.cpp.

992 {
993  const int margin = 5 * IU_PER_MM; // Add a 5 mm margin around the board
994  aPlotter->SetNegative( true );
995  aPlotter->SetColor( WHITE ); // Which will be plotted as black
996  EDA_RECT area = aBbbox;
997  area.Inflate( margin );
998  aPlotter->Rect( area.GetOrigin(), area.GetEnd(), FILL_TYPE::FILLED_SHAPE );
999  aPlotter->SetColor( BLACK );
1000 }
virtual void SetColor(COLOR4D color)=0
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH)=0
static constexpr double IU_PER_MM
Mock up a conversion function.
Definition: color4d.h:44
const wxPoint GetEnd() const
Definition: eda_rect.h:108
const wxPoint GetOrigin() const
Definition: eda_rect.h:106
virtual void SetNegative(bool aNegative)
Definition: plotter.h:152
Definition: color4d.h:48
Handle the component boundary box.
Definition: eda_rect.h:42
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:363

References BLACK, FILLED_SHAPE, EDA_RECT::GetEnd(), EDA_RECT::GetOrigin(), EDA_RECT::Inflate(), IU_PER_MM, 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 907 of file plot_board_layers.cpp.

909 {
910  PAGE_INFO pageA4( wxT( "A4" ) );
911  const PAGE_INFO& pageInfo = aBoard->GetPageSettings();
912  const PAGE_INFO* sheet_info;
913  double paperscale; // Page-to-paper ratio
914  wxSize paperSizeIU;
915  wxSize pageSizeIU( pageInfo.GetSizeIU() );
916  bool autocenter = false;
917 
918  // Special options: to fit the sheet to an A4 sheet replace the paper size. However there
919  // is a difference between the autoscale and the a4paper option:
920  // - Autoscale fits the board to the paper size
921  // - A4paper fits the original paper size to an A4 sheet
922  // - Both of them fit the board to an A4 sheet
923  if( aPlotOpts->GetA4Output() )
924  {
925  sheet_info = &pageA4;
926  paperSizeIU = pageA4.GetSizeIU();
927  paperscale = (double) paperSizeIU.x / pageSizeIU.x;
928  autocenter = true;
929  }
930  else
931  {
932  sheet_info = &pageInfo;
933  paperSizeIU = pageSizeIU;
934  paperscale = 1;
935 
936  // Need autocentering only if scale is not 1:1
937  autocenter = (aPlotOpts->GetScale() != 1.0);
938  }
939 
940  EDA_RECT bbox = aBoard->ComputeBoundingBox();
941  wxPoint boardCenter = bbox.Centre();
942  wxSize boardSize = bbox.GetSize();
943 
944  double compound_scale;
945 
946  // Fit to 80% of the page if asked; it could be that the board is empty, in this case
947  // regress to 1:1 scale
948  if( aPlotOpts->GetAutoScale() && boardSize.x > 0 && boardSize.y > 0 )
949  {
950  double xscale = (paperSizeIU.x * 0.8) / boardSize.x;
951  double yscale = (paperSizeIU.y * 0.8) / boardSize.y;
952 
953  compound_scale = std::min( xscale, yscale ) * paperscale;
954  }
955  else
956  compound_scale = aPlotOpts->GetScale() * paperscale;
957 
958 
959  // For the plot offset we have to keep in mind the auxiliary origin too: if autoscaling is
960  // off we check that plot option (i.e. autoscaling overrides auxiliary origin)
961  wxPoint offset( 0, 0);
962 
963  if( autocenter )
964  {
965  offset.x = KiROUND( boardCenter.x - ( paperSizeIU.x / 2.0 ) / compound_scale );
966  offset.y = KiROUND( boardCenter.y - ( paperSizeIU.y / 2.0 ) / compound_scale );
967  }
968  else
969  {
970  if( aPlotOpts->GetUseAuxOrigin() )
971  offset = aBoard->GetDesignSettings().m_AuxOrigin;
972  }
973 
974  aPlotter->SetPageSettings( *sheet_info );
975 
976  aPlotter->SetViewport( offset, IU_PER_MILS/10, compound_scale, aPlotOpts->GetMirror() );
977  // Has meaning only for gerber plotter. Must be called only after SetViewport
978  aPlotter->SetGerberCoordinatesFormat( aPlotOpts->GetGerberPrecision() );
979  // Has meaning only for SVG plotter. Must be called only after SetViewport
980  aPlotter->SetSvgCoordinatesFormat( aPlotOpts->GetSvgPrecision(), aPlotOpts->GetSvgUseInch() );
981 
982  aPlotter->SetCreator( wxT( "PCBNEW" ) );
983  aPlotter->SetColorMode( false ); // default is plot in Black and White.
984  aPlotter->SetTextMode( aPlotOpts->GetTextMode() );
985 }
const PAGE_INFO & GetPageSettings() const
Definition: board.h:589
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:182
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:161
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
double GetScale() const
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false)
Definition: plotter.h:467
virtual void SetSvgCoordinatesFormat(unsigned aResolution, bool aUseInches=false)
Definition: plotter.h:472
bool GetMirror() const
bool GetA4Output() const
int GetGerberPrecision() const
unsigned GetSvgPrecision() const
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
virtual void SetTextMode(PLOT_TEXT_MODE mode)
Change the current text mode.
Definition: plotter.h:462
PLOT_TEXT_MODE GetTextMode() const
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.
Handle the component boundary box.
Definition: eda_rect.h:42
#define IU_PER_MILS
Definition: plotter.cpp:137
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
wxPoint Centre() const
Definition: eda_rect.h:60
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1022
bool GetSvgUseInch() const
bool GetUseAuxOrigin() const
wxPoint m_AuxOrigin
origin for plot exports
const wxSize GetSize() const
Definition: eda_rect.h:96
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:167

References EDA_RECT::Centre(), BOARD::ComputeBoundingBox(), PCB_PLOT_PARAMS::GetA4Output(), PCB_PLOT_PARAMS::GetAutoScale(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetGerberPrecision(), PCB_PLOT_PARAMS::GetMirror(), BOARD::GetPageSettings(), PCB_PLOT_PARAMS::GetScale(), EDA_RECT::GetSize(), PCB_PLOT_PARAMS::GetSvgPrecision(), PCB_PLOT_PARAMS::GetSvgUseInch(), PCB_PLOT_PARAMS::GetTextMode(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), IU_PER_MILS, KiROUND(), BOARD_DESIGN_SETTINGS::m_AuxOrigin, PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetGerberCoordinatesFormat(), PLOTTER::SetPageSettings(), PLOTTER::SetSvgCoordinatesFormat(), 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 593 of file plot_board_layers.cpp.

595 {
596  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
597  itemplotter.SetLayerSet( aLayerMask );
598 
599  SHAPE_POLY_SET outlines;
600 
601  for( LSEQ seq = aLayerMask.Seq( plot_seq, arrayDim( plot_seq ) ); seq; ++seq )
602  {
603  PCB_LAYER_ID layer = *seq;
604 
605  outlines.RemoveAllContours();
606  aBoard->ConvertBrdLayerToPolygonalContours( layer, outlines );
607 
608  outlines.Simplify( SHAPE_POLY_SET::PM_FAST );
609 
610  // Plot outlines
611  std::vector<wxPoint> cornerList;
612 
613  // Now we have one or more basic polygons: plot each polygon
614  for( int ii = 0; ii < outlines.OutlineCount(); ii++ )
615  {
616  for(int kk = 0; kk <= outlines.HoleCount (ii); kk++ )
617  {
618  cornerList.clear();
619  const SHAPE_LINE_CHAIN& path = (kk == 0) ? outlines.COutline( ii ) : outlines.CHole( ii, kk - 1 );
620 
621  for( int jj = 0; jj < path.PointCount(); jj++ )
622  cornerList.emplace_back( (wxPoint) path.CPoint( jj ) );
623 
624  // Ensure the polygon is closed
625  if( cornerList[0] != cornerList[cornerList.size() - 1] )
626  cornerList.push_back( cornerList[0] );
627 
628  aPlotter->PlotPoly( cornerList, FILL_TYPE::NO_FILL );
629  }
630  }
631 
632  // Plot pad holes
634  {
635  int smallDrill = (aPlotOpt.GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE)
637 
638  for( FOOTPRINT* footprint : aBoard->Footprints() )
639  {
640  for( PAD* pad : footprint->Pads() )
641  {
642  wxSize hole = pad->GetDrillSize();
643 
644  if( hole.x == 0 || hole.y == 0 )
645  continue;
646 
647  if( hole.x == hole.y )
648  {
649  hole.x = std::min( smallDrill, hole.x );
650  aPlotter->Circle( pad->GetPosition(), hole.x, FILL_TYPE::NO_FILL );
651  }
652  else
653  {
654  // Note: small drill marks have no significance when applied to slots
655  const SHAPE_SEGMENT* seg = pad->GetEffectiveHoleShape();
656  aPlotter->ThickSegment( (wxPoint) seg->GetSeg().A,
657  (wxPoint) seg->GetSeg().B,
658  seg->GetWidth(), SKETCH, NULL );
659  }
660  }
661  }
662  }
663 
664  // Plot vias holes
665  for( TRACK* track : aBoard->Tracks() )
666  {
667  const VIA* via = dyn_cast<const VIA*>( track );
668 
669  if( via && via->IsOnLayer( layer ) ) // via holes can be not through holes
670  {
671  aPlotter->Circle( via->GetPosition(), via->GetDrillValue(), FILL_TYPE::NO_FILL );
672  }
673  }
674  }
675 }
Definition: track.h:344
int OutlineCount() const
Returns the number of outlines in the set
static const PCB_LAYER_ID plot_seq[]
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Draw a polygon ( filled or not )
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
double m_SmallDrillMarkSize
The diameter of the drill marks on print and plot outputs (in mm), when the "Drill marks" option is s...
int PointCount() const
Function PointCount()
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:411
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:506
const SEG & GetSeg() const
const VECTOR2I & CPoint(int aIndex) const
Function Point()
PCB_LAYER_ID
A quick note on layer IDs:
#define NULL
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Definition: track.cpp:171
SHAPE_POLY_SET.
FOOTPRINTS & Footprints()
Definition: board.h:286
void ConvertBrdLayerToPolygonalContours(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aOutlines)
Build a set of polygons which are the outlines of copper items (pads, tracks, vias,...
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
void Simplify(POLYGON_MODE aFastMode)
Simplifies the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFast...
virtual void Circle(const wxPoint &pos, int diametre, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH)=0
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
SHAPE_LINE_CHAIN.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
VECTOR2I A
Definition: seg.h:47
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: track.cpp:349
Definition: pad.h:60
wxPoint GetPosition() const override
Definition: track.h:412
DrillMarksType GetDrillMarksType() const
int GetWidth() const
TRACKS & Tracks()
Definition: board.h:283
Definition: track.h:83
VECTOR2I B
Definition: seg.h:48

References SEG::A, arrayDim(), SEG::B, SHAPE_POLY_SET::CHole(), PLOTTER::Circle(), BOARD::ConvertBrdLayerToPolygonalContours(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), BOARD::Footprints(), ADVANCED_CFG::GetCfg(), PCB_PLOT_PARAMS::GetDrillMarksType(), VIA::GetDrillValue(), VIA::GetPosition(), SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), SHAPE_POLY_SET::HoleCount(), VIA::IsOnLayer(), ADVANCED_CFG::m_SmallDrillMarkSize, PCB_PLOT_PARAMS::NO_DRILL_SHAPE, NO_FILL, NULL, 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, PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE, PLOTTER::ThickSegment(), and BOARD::Tracks().

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 63 of file plot_board_layers.cpp.

65 {
66  PCB_PLOT_PARAMS plotOpt = aPlotOpt;
67  int soldermask_min_thickness = aBoard->GetDesignSettings().m_SolderMaskMinWidth;
68 
69  // Set a default color and the text mode for this layer
70  aPlotter->SetColor( BLACK );
71  aPlotter->SetTextMode( aPlotOpt.GetTextMode() );
72 
73  // Specify that the contents of the "Edges Pcb" layer are to be plotted in addition to the
74  // contents of the currently specified layer.
75  LSET layer_mask( aLayer );
76 
77  if( !aPlotOpt.GetExcludeEdgeLayer() )
78  layer_mask.set( Edge_Cuts );
79 
80  if( IsCopperLayer( aLayer ) )
81  {
82  // Skip NPTH pads on copper layers ( only if hole size == pad size ):
83  // Drill mark will be plotted if drill mark is SMALL_DRILL_SHAPE or FULL_DRILL_SHAPE
84  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF )
85  {
86  plotOpt.SetSkipPlotNPTH_Pads( false );
87  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
88  }
89  else
90  {
91  plotOpt.SetSkipPlotNPTH_Pads( true );
92  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
93  }
94  }
95  else
96  {
97  switch( aLayer )
98  {
99  case B_Mask:
100  case F_Mask:
101  plotOpt.SetSkipPlotNPTH_Pads( false );
102  // Disable plot pad holes
104 
105  // Plot solder mask:
106  if( soldermask_min_thickness == 0 )
107  {
108  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF )
109  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
110  else
111  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
112  }
113  else
114  PlotSolderMaskLayer( aBoard, aPlotter, layer_mask, plotOpt,
115  soldermask_min_thickness );
116 
117  break;
118 
119  case B_Adhes:
120  case F_Adhes:
121  case B_Paste:
122  case F_Paste:
123  plotOpt.SetSkipPlotNPTH_Pads( false );
124  // Disable plot pad holes
126 
127  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF )
128  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
129  else
130  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
131  break;
132 
133  case F_SilkS:
134  case B_SilkS:
135  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF && plotOpt.GetDXFPlotPolygonMode() )
136  // PlotLayerOutlines() is designed only for DXF plotters.
137  // and must not be used for other plot formats
138  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
139  else
140  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
141 
142  // Gerber: Subtract soldermask from silkscreen if enabled
143  if( aPlotter->GetPlotterType() == PLOT_FORMAT::GERBER
144  && plotOpt.GetSubtractMaskFromSilk() )
145  {
146  if( aLayer == F_SilkS )
147  layer_mask = LSET( F_Mask );
148  else
149  layer_mask = LSET( B_Mask );
150 
151  // Create the mask to subtract by creating a negative layer polarity
152  aPlotter->SetLayerPolarity( false );
153 
154  // Disable plot pad holes
156 
157  // Plot the mask
158  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
159  }
160  break;
161 
162  // These layers are plotted like silk screen layers.
163  // Mainly, pads on these layers are not filled.
164  // This is not necessary the best choice.
165  case Dwgs_User:
166  case Cmts_User:
167  case Eco1_User:
168  case Eco2_User:
169  case Edge_Cuts:
170  case Margin:
171  case F_CrtYd:
172  case B_CrtYd:
173  case F_Fab:
174  case B_Fab:
175  plotOpt.SetSkipPlotNPTH_Pads( false );
177 
178  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF && plotOpt.GetDXFPlotPolygonMode() )
179  // PlotLayerOutlines() is designed only for DXF plotters.
180  // and must not be used for other plot formats
181  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
182  else
183  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
184  break;
185 
186  default:
187  plotOpt.SetSkipPlotNPTH_Pads( false );
189 
190  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF && plotOpt.GetDXFPlotPolygonMode() )
191  // PlotLayerOutlines() is designed only for DXF plotters.
192  // and must not be used for other plot formats
193  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
194  else
195  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
196  break;
197  }
198  }
199 }
bool GetDXFPlotPolygonMode() const
virtual void SetColor(COLOR4D color)=0
virtual void SetLayerPolarity(bool aPositive)
Set the current Gerber layer polarity to positive or negative by writing %LPD*% or %LPC*% to the Gerb...
Definition: plotter.h:453
void PlotStandardLayer(BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotStandardLayer plot copper or technical layers.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
Definition: color4d.h:44
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.
LSET is a set of PCB_LAYER_IDs.
PLOT_FORMAT GetFormat() const
virtual PLOT_FORMAT GetPlotterType() const =0
Returns the effective plot engine in use.
virtual void SetTextMode(PLOT_TEXT_MODE mode)
Change the current text mode.
Definition: plotter.h:462
void SetSkipPlotNPTH_Pads(bool aSkip)
PLOT_TEXT_MODE GetTextMode() const
PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
bool GetSubtractMaskFromSilk() const
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
bool GetExcludeEdgeLayer() const

References B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, BLACK, Cmts_User, Dwgs_User, DXF, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, GERBER, 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, PlotLayerOutlines(), 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().

◆ PlotSolderMaskLayer()

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

Definition at line 708 of file plot_board_layers.cpp.

710 {
711  int maxError = aBoard->GetDesignSettings().m_MaxError;
712  PCB_LAYER_ID layer = aLayerMask[B_Mask] ? B_Mask : F_Mask;
713  SHAPE_POLY_SET buffer;
714  SHAPE_POLY_SET* boardOutline = nullptr;
715 
716  if( aBoard->GetBoardPolygonOutlines( buffer ) )
717  boardOutline = &buffer;
718 
719  // We remove 1nm as we expand both sides of the shapes, so allowing for
720  // a strictly greater than or equal comparison in the shape separation (boolean add)
721  // means that we will end up with separate shapes that then are shrunk
722  int inflate = aMinThickness/2 - 1;
723 
724  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
725  itemplotter.SetLayerSet( aLayerMask );
726 
727  // Plot edge layer and graphic items.
728  // They do not have a solder Mask margin, because they are graphic items
729  // on this layer (like logos), not actually areas around pads.
730 
731  itemplotter.PlotBoardGraphicItems();
732 
733  for( FOOTPRINT* footprint : aBoard->Footprints() )
734  {
735  for( BOARD_ITEM* item : footprint->GraphicalItems() )
736  {
737  itemplotter.PlotFootprintTextItems( footprint );
738 
739  if( item->Type() == PCB_FP_SHAPE_T && item->GetLayer() == layer )
740  itemplotter.PlotFootprintGraphicItem( (FP_SHAPE*) item );
741  }
742  }
743 
744  // Build polygons for each pad shape. The size of the shape on solder mask should be size
745  // of pad + clearance around the pad, where clearance = solder mask clearance + extra margin.
746  // Extra margin is half the min width for solder mask, which is used to merge too-close shapes
747  // (distance < aMinThickness), and will be removed when creating the actual shapes.
748 
749  // Will contain shapes inflated by inflate value that will be merged and deflated by
750  // inflate value to build final polygons
751  // After calculations the remaining polygons are polygons to plot
752  SHAPE_POLY_SET areas;
753  // Will contain exact shapes of all items on solder mask
754  SHAPE_POLY_SET initialPolys;
755 
756 #if NEW_ALGO
757  // Generate polygons with arcs inside the shape or exact shape
758  // to minimize shape changes created by arc to segment size correction.
760 #endif
761  {
762  // Plot pads
763  for( FOOTPRINT* footprint : aBoard->Footprints() )
764  {
765  // add shapes with their exact mask layer size in initialPolys
766  footprint->TransformPadsWithClearanceToPolygon( initialPolys, layer, 0, maxError,
767  ERROR_OUTSIDE );
768  // add shapes inflated by aMinThickness/2 in areas
769  footprint->TransformPadsWithClearanceToPolygon( areas, layer, inflate, maxError,
770  ERROR_OUTSIDE );
771  }
772 
773  // Plot vias on solder masks, if aPlotOpt.GetPlotViaOnMaskLayer() is true,
774  if( aPlotOpt.GetPlotViaOnMaskLayer() )
775  {
776  // The current layer is a solder mask, use the global mask clearance for vias
777  int via_clearance = aBoard->GetDesignSettings().m_SolderMaskMargin;
778  int via_margin = via_clearance + inflate;
779 
780  for( TRACK* track : aBoard->Tracks() )
781  {
782  const VIA* via = dyn_cast<const VIA*>( track );
783 
784  if( !via )
785  continue;
786 
787  // vias are plotted only if they are on the corresponding external copper layer
788  LSET via_set = via->GetLayerSet();
789 
790  if( via_set[B_Cu] )
791  via_set.set( B_Mask );
792 
793  if( via_set[F_Cu] )
794  via_set.set( F_Mask );
795 
796  if( !( via_set & aLayerMask ).any() )
797  continue;
798 
799  // add shapes with their exact mask layer size in initialPolys
800  via->TransformShapeWithClearanceToPolygon( initialPolys, layer, via_clearance,
801  maxError, ERROR_OUTSIDE );
802  // add shapes inflated by aMinThickness/2 in areas
803  via->TransformShapeWithClearanceToPolygon( areas, layer, via_margin, maxError,
804  ERROR_OUTSIDE );
805  }
806  }
807 
808  // Add filled zone areas.
809 #if 0 // Set to 1 if a solder mask margin must be applied to zones on solder mask
810  int zone_margin = aBoard->GetDesignSettings().m_SolderMaskMargin;
811 #else
812  int zone_margin = 0;
813 #endif
814 
815  for( ZONE* zone : aBoard->Zones() )
816  {
817  if( zone->GetLayer() != layer )
818  continue;
819 
820  // add shapes inflated by aMinThickness/2 in areas
821  zone->TransformSmoothedOutlineToPolygon( areas, inflate + zone_margin, boardOutline );
822  // add shapes with their exact mask layer size in initialPolys
823  zone->TransformSmoothedOutlineToPolygon( initialPolys, zone_margin, boardOutline );
824  }
825 
826  int numSegs = GetArcToSegmentCount( inflate, maxError, 360.0 );
827 
828  // Merge all polygons: After deflating, not merged (not overlapping) polygons
829  // will have the initial shape (with perhaps small changes due to deflating transform)
831  areas.Deflate( inflate, numSegs );
832  }
833 
834 #if !NEW_ALGO
835  // To avoid a lot of code, use a ZONE to handle and plot polygons, because our polygons look
836  // exactly like filled areas in zones.
837  // Note, also this code is not optimized: it creates a lot of copy/duplicate data.
838  // However it is not complex, and fast enough for plot purposes (copy/convert data is only a
839  // very small calculation time for these calculations).
840  ZONE zone( aBoard );
841  zone.SetMinThickness( 0 ); // trace polygons only
842  zone.SetLayer( layer );
843  // Combine the current areas to initial areas. This is mandatory because inflate/deflate
844  // transform is not perfect, and we want the initial areas perfectly kept
845  areas.BooleanAdd( initialPolys, SHAPE_POLY_SET::PM_FAST );
847 
848  itemplotter.PlotFilledAreas( &zone, areas );
849 #else
850 
851  // Remove initial shapes: each shape will be added later, as flashed item or region
852  // with a suitable attribute.
853  // Do not merge pads is mandatory in Gerber files: They must be identified as pads
854 
855  // we deflate areas in polygons, to avoid after subtracting initial shapes
856  // having small artifacts due to approximations during polygon transforms
858 
859  // Slightly inflate polygons to avoid any gap between them and other shapes,
860  // These gaps are created by arc to segments approximations
861  areas.Inflate( Millimeter2iu( 0.002 ),6 );
862 
863  // Now, only polygons with a too small thickness are stored in areas.
865 
866  // Plot each initial shape (pads and polygons on mask layer), with suitable attributes:
867  PlotStandardLayer( aBoard, aPlotter, aLayerMask, aPlotOpt );
868 
869  // Add shapes corresponding to areas having too small thickness.
870  std::vector<wxPoint> cornerList;
871 
872  for( int ii = 0; ii < areas.OutlineCount(); ii++ )
873  {
874  cornerList.clear();
875  const SHAPE_LINE_CHAIN& path = areas.COutline( ii );
876 
877  // polygon area in mm^2 :
878  double curr_area = path.Area() / ( IU_PER_MM * IU_PER_MM );
879 
880  // Skip very small polygons: they are certainly artifacts created by
881  // arc approximations and polygon transforms
882  // (inflate/deflate transforms)
883  constexpr double poly_min_area_mm2 = 0.01; // 0.01 mm^2 gives a good filtering
884 
885  if( curr_area < poly_min_area_mm2 )
886  continue;
887 
888  for( int jj = 0; jj < path.PointCount(); jj++ )
889  cornerList.emplace_back( (wxPoint) path.CPoint( jj ) );
890 
891  // Ensure the polygon is closed
892  if( cornerList[0] != cornerList[cornerList.size() - 1] )
893  cornerList.push_back( cornerList[0] );
894 
895  aPlotter->PlotPoly( cornerList, FILL_TYPE::FILLED_SHAPE );
896  }
897 #endif
898 }
Definition: track.h:344
int OutlineCount() const
Returns the number of outlines in the set
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
Definition: board.cpp:1855
ZONES & Zones()
Definition: board.h:292
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: track.cpp:364
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset union For aFastMode meaning, see function booleanOp
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
static constexpr double IU_PER_MM
Mock up a conversion function.
void PlotStandardLayer(BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotStandardLayer plot copper or technical layers.
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Draw a polygon ( filled or not )
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
void Inflate(int aAmount, int aCircleSegmentsCount, CORNER_STRATEGY aCornerStrategy=ROUND_ALL_CORNERS)
Performs outline inflation/deflation.
int PointCount() const
Function PointCount()
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Function TransformShapeWithClearanceToPolygon Convert the track shape to a closed polygon Used in fil...
const VECTOR2I & CPoint(int aIndex) const
Function Point()
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
SHAPE_POLY_SET.
FOOTPRINTS & Footprints()
Definition: board.h:286
void Deflate(int aAmount, int aCircleSegmentsCount, CORNER_STRATEGY aCornerStrategy=ROUND_ALL_CORNERS)
void Simplify(POLYGON_MODE aFastMode)
Simplifies the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFast...
ZONE handles a list of polygons defining a copper zone.
Definition: zone.h:57
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
SHAPE_LINE_CHAIN.
When creating polygons to create a clearance polygonal area, the polygon must be same or bigger than ...
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset difference For aFastMode meaning, see function booleanOp
static constexpr int Millimeter2iu(double mm)
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
TRACKS & Tracks()
Definition: board.h:283
Definition: track.h:83

References SHAPE_LINE_CHAIN::Area(), B_Cu, B_Mask, SHAPE_POLY_SET::BooleanAdd(), SHAPE_POLY_SET::BooleanSubtract(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), SHAPE_POLY_SET::Deflate(), ERROR_OUTSIDE, F_Cu, F_Mask, FILLED_SHAPE, BOARD::Footprints(), SHAPE_POLY_SET::Fracture(), GetArcToSegmentCount(), BOARD::GetBoardPolygonOutlines(), BOARD::GetDesignSettings(), VIA::GetLayerSet(), PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer(), SHAPE_POLY_SET::Inflate(), IU_PER_MM, BOARD_DESIGN_SETTINGS::m_MaxError, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, Millimeter2iu(), SHAPE_POLY_SET::OutlineCount(), PCB_FP_SHAPE_T, BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), BRDITEMS_PLOTTER::PlotFootprintTextItems(), PLOTTER::PlotPoly(), PlotStandardLayer(), SHAPE_POLY_SET::PM_FAST, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, SHAPE_LINE_CHAIN::PointCount(), ZONE::SetLayer(), BRDITEMS_PLOTTER::SetLayerSet(), ZONE::SetMinThickness(), SHAPE_POLY_SET::Simplify(), BOARD::Tracks(), TRACK::TransformShapeWithClearanceToPolygon(), and BOARD::Zones().

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

pads not connected to copper are optionally not drawn

Vias not connected to copper are optionally not drawn

Definition at line 206 of file plot_board_layers.cpp.

208 {
209  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
210 
211  itemplotter.SetLayerSet( aLayerMask );
212 
213  OUTLINE_MODE plotMode = aPlotOpt.GetPlotMode();
214  bool onCopperLayer = ( LSET::AllCuMask() & aLayerMask ).any();
215  bool onSolderMaskLayer = ( LSET( 2, F_Mask, B_Mask ) & aLayerMask ).any();
216  bool onSolderPasteLayer = ( LSET( 2, F_Paste, B_Paste ) & aLayerMask ).any();
217  bool onFrontFab = ( LSET( F_Fab ) & aLayerMask ).any();
218  bool onBackFab = ( LSET( B_Fab ) & aLayerMask ).any();
219  bool sketchPads = ( onFrontFab || onBackFab ) && aPlotOpt.GetSketchPadsOnFabLayers();
220 
221  // Plot edge layer and graphic items
222  itemplotter.PlotBoardGraphicItems();
223 
224  // Draw footprint texts:
225  for( FOOTPRINT* footprint : aBoard->Footprints() )
226  itemplotter.PlotFootprintTextItems( footprint );
227 
228  // Draw footprint other graphic items:
229  for( FOOTPRINT* footprint : aBoard->Footprints() )
230  itemplotter.PlotFootprintGraphicItems( footprint );
231 
232  // Plot footprint pads
233  for( FOOTPRINT* footprint : aBoard->Footprints() )
234  {
235  aPlotter->StartBlock( NULL );
236 
237  for( PAD* pad : footprint->Pads() )
238  {
239  OUTLINE_MODE padPlotMode = plotMode;
240 
241  if( !( pad->GetLayerSet() & aLayerMask ).any() )
242  {
243  if( sketchPads &&
244  ( ( onFrontFab && pad->GetLayerSet().Contains( F_Cu ) ) ||
245  ( onBackFab && pad->GetLayerSet().Contains( B_Cu ) ) ) )
246  padPlotMode = SKETCH;
247  else
248  continue;
249  }
250 
252  if( onCopperLayer && !pad->FlashLayer( aLayerMask ) )
253  continue;
254 
256 
257  if( pad->GetLayerSet()[B_Cu] )
258  color = aPlotOpt.ColorSettings()->GetColor( LAYER_PAD_BK );
259 
260  if( pad->GetLayerSet()[F_Cu] )
261  color = color.LegacyMix( aPlotOpt.ColorSettings()->GetColor( LAYER_PAD_FR ) );
262 
263  if( sketchPads && aLayerMask[F_Fab] )
264  color = aPlotOpt.ColorSettings()->GetColor( F_Fab );
265  else if( sketchPads && aLayerMask[B_Fab] )
266  color = aPlotOpt.ColorSettings()->GetColor( B_Fab );
267 
268  wxSize margin;
269  int width_adj = 0;
270 
271  if( onCopperLayer )
272  width_adj = itemplotter.getFineWidthAdj();
273 
274  if( onSolderMaskLayer )
275  margin.x = margin.y = pad->GetSolderMaskMargin();
276 
277  if( onSolderPasteLayer )
278  margin = pad->GetSolderPasteMargin();
279 
280  // Now offset the pad size by margin + width_adj
281  wxSize padPlotsSize = pad->GetSize() + margin * 2 + wxSize( width_adj, width_adj );
282 
283  // Store these parameters that can be modified to plot inflated/deflated pads shape
284  PAD_SHAPE_T padShape = pad->GetShape();
285  wxSize padSize = pad->GetSize();
286  wxSize padDelta = pad->GetDelta(); // has meaning only for trapezoidal pads
287  double padCornerRadius = pad->GetRoundRectCornerRadius();
288 
289  // Don't draw a null size item :
290  if( padPlotsSize.x <= 0 || padPlotsSize.y <= 0 )
291  continue;
292 
293  switch( pad->GetShape() )
294  {
295  case PAD_SHAPE_CIRCLE:
296  case PAD_SHAPE_OVAL:
297  pad->SetSize( padPlotsSize );
298 
299  if( aPlotOpt.GetSkipPlotNPTH_Pads() &&
301  ( pad->GetSize() == pad->GetDrillSize() ) &&
302  ( pad->GetAttribute() == PAD_ATTRIB_NPTH ) )
303  break;
304 
305  itemplotter.PlotPad( pad, color, padPlotMode );
306  break;
307 
308  case PAD_SHAPE_RECT:
309  pad->SetSize( padPlotsSize );
310 
311  if( margin.x > 0 )
312  {
313  pad->SetShape( PAD_SHAPE_ROUNDRECT );
314  pad->SetRoundRectCornerRadius( margin.x );
315  }
316 
317  itemplotter.PlotPad( pad, color, padPlotMode );
318  break;
319 
320  case PAD_SHAPE_TRAPEZOID:
321  {
322  wxSize scale( padPlotsSize.x / padSize.x, padPlotsSize.y / padSize.y );
323  pad->SetDelta( wxSize( padDelta.x * scale.x, padDelta.y * scale.y ) );
324  pad->SetSize( padPlotsSize );
325 
326  itemplotter.PlotPad( pad, color, padPlotMode );
327  }
328  break;
329 
330  case PAD_SHAPE_ROUNDRECT:
332  // Chamfer and rounding are stored as a percent and so don't need scaling
333  pad->SetSize( padPlotsSize );
334  itemplotter.PlotPad( pad, color, padPlotMode );
335  break;
336 
337  case PAD_SHAPE_CUSTOM:
338  {
339  // inflate/deflate a custom shape is a bit complex.
340  // so build a similar pad shape, and inflate/deflate the polygonal shape
341  PAD dummy( *pad );
342  SHAPE_POLY_SET shape;
343  pad->MergePrimitivesAsPolygon( &shape, UNDEFINED_LAYER );
344  // Shape polygon can have holes so use InflateWithLinkedHoles(), not Inflate()
345  // which can create bad shapes if margin.x is < 0
346  int maxError = aBoard->GetDesignSettings().m_MaxError;
347  int numSegs = GetArcToSegmentCount( margin.x, maxError, 360.0 );
348  shape.InflateWithLinkedHoles( margin.x, numSegs, SHAPE_POLY_SET::PM_FAST );
349  dummy.DeletePrimitivesList();
350  dummy.AddPrimitivePoly( shape, 0, true );
351 
352  // Be sure the anchor pad is not bigger than the deflated shape because this
353  // anchor will be added to the pad shape when plotting the pad. So now the
354  // polygonal shape is built, we can clamp the anchor size
355  if( margin.x < 0 ) // we expect margin.x = margin.y for custom pads
356  dummy.SetSize( padPlotsSize );
357 
358  itemplotter.PlotPad( &dummy, color, padPlotMode );
359  }
360  break;
361  }
362 
363  // Restore the pad parameters modified by the plot code
364  pad->SetSize( padSize );
365  pad->SetDelta( padDelta );
366  pad->SetShape( padShape );
367  pad->SetRoundRectCornerRadius( padCornerRadius );
368  }
369 
370  aPlotter->EndBlock( NULL );
371  }
372 
373  // Plot vias on copper layers, and if aPlotOpt.GetPlotViaOnMaskLayer() is true,
374  // plot them on solder mask
375 
376  GBR_METADATA gbr_metadata;
377 
378  bool isOnCopperLayer = ( aLayerMask & LSET::AllCuMask() ).any();
379 
380  if( isOnCopperLayer )
381  {
384  }
385 
386  aPlotter->StartBlock( NULL );
387 
388  for( TRACK* track : aBoard->Tracks() )
389  {
390  const VIA* via = dyn_cast<const VIA*>( track );
391 
392  if( !via )
393  continue;
394 
395  // vias are not plotted if not on selected layer, but if layer is SOLDERMASK_LAYER_BACK
396  // or SOLDERMASK_LAYER_FRONT, vias are drawn only if they are on the corresponding
397  // external copper layer
398  LSET via_mask_layer = via->GetLayerSet();
399 
400  if( aPlotOpt.GetPlotViaOnMaskLayer() )
401  {
402  if( via_mask_layer[B_Cu] )
403  via_mask_layer.set( B_Mask );
404 
405  if( via_mask_layer[F_Cu] )
406  via_mask_layer.set( F_Mask );
407  }
408 
409  if( !( via_mask_layer & aLayerMask ).any() )
410  continue;
411 
412  int via_margin = 0;
413  double width_adj = 0;
414 
415  // If the current layer is a solder mask, use the global mask clearance for vias
416  if( aLayerMask[B_Mask] || aLayerMask[F_Mask] )
417  via_margin = aBoard->GetDesignSettings().m_SolderMaskMargin;
418 
419  if( ( aLayerMask & LSET::AllCuMask() ).any() )
420  width_adj = itemplotter.getFineWidthAdj();
421 
422  int diameter = via->GetWidth() + 2 * via_margin + width_adj;
423 
425  if( onCopperLayer && !via->FlashLayer( aLayerMask ) )
426  continue;
427 
428  // Don't draw a null size item :
429  if( diameter <= 0 )
430  continue;
431 
432  // Some vias can be not connected (no net).
433  // Set the m_NotInNet for these vias to force a empty net name in gerber file
434  gbr_metadata.m_NetlistMetadata.m_NotInNet = via->GetNetname().IsEmpty();
435 
436  gbr_metadata.SetNetName( via->GetNetname() );
437 
438  COLOR4D color = aPlotOpt.ColorSettings()->GetColor(
439  LAYER_VIAS + static_cast<int>( via->GetViaType() ) );
440  // Set plot color (change WHITE to LIGHTGRAY because the white items are not seen on a
441  // white paper or screen
442  aPlotter->SetColor( color != WHITE ? color : LIGHTGRAY );
443  aPlotter->FlashPadCircle( via->GetStart(), diameter, plotMode, &gbr_metadata );
444  }
445 
446  aPlotter->EndBlock( NULL );
447  aPlotter->StartBlock( NULL );
449 
450  // Plot tracks (not vias) :
451  for( TRACK* track : aBoard->Tracks() )
452  {
453  if( track->Type() == PCB_VIA_T )
454  continue;
455 
456  if( !aLayerMask[track->GetLayer()] )
457  continue;
458 
459  // Some track segments can be not connected (no net).
460  // Set the m_NotInNet for these segments to force a empty net name in gerber file
461  gbr_metadata.m_NetlistMetadata.m_NotInNet = track->GetNetname().IsEmpty();
462 
463  gbr_metadata.SetNetName( track->GetNetname() );
464  int width = track->GetWidth() + itemplotter.getFineWidthAdj();
465  aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) );
466 
467  if( track->Type() == PCB_ARC_T )
468  {
469  ARC* arc = static_cast<ARC*>( track );
470  VECTOR2D center( arc->GetCenter() );
471  int radius = arc->GetRadius();
472  double start_angle = arc->GetArcAngleStart();
473  double end_angle = start_angle + arc->GetAngle();
474 
475  aPlotter->ThickArc( wxPoint( center.x, center.y ), -end_angle, -start_angle,
476  radius, width, plotMode, &gbr_metadata );
477  }
478  else
479  {
480  aPlotter->ThickSegment( track->GetStart(), track->GetEnd(), width, plotMode,
481  &gbr_metadata );
482  }
483 
484  }
485 
486  aPlotter->EndBlock( NULL );
487 
488  // Plot filled ares
489  aPlotter->StartBlock( NULL );
490 
491  NETINFO_ITEM nonet( aBoard );
492 
493  for( ZONE* zone : aBoard->Zones() )
494  {
495  for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
496  {
497  if( !aLayerMask[layer] )
498  continue;
499 
500  SHAPE_POLY_SET mainArea = zone->GetFilledPolysList( layer );
501  SHAPE_POLY_SET islands;
502 
503  for( int i = mainArea.OutlineCount() - 1; i >= 0; i-- )
504  {
505  if( zone->IsIsland( layer, i ) )
506  {
507  islands.AddOutline( mainArea.CPolygon( i )[0] );
508  mainArea.DeletePolygon( i );
509  }
510  }
511 
512  itemplotter.PlotFilledAreas( zone, mainArea );
513 
514  if( !islands.IsEmpty() )
515  {
516  ZONE dummy( *zone );
517  dummy.SetNet( &nonet );
518  itemplotter.PlotFilledAreas( &dummy, islands );
519  }
520  }
521  }
522 
523  aPlotter->EndBlock( NULL );
524 
525  // Adding drill marks, if required and if the plotter is able to plot them:
527  itemplotter.PlotDrillMarks();
528 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
OUTLINE_MODE GetPlotMode() const
OUTLINE_MODE
Definition: outline_mode.h:24
Definition: track.h:344
virtual wxPoint GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition: track.h:302
const POLYGON & CPolygon(int aIndex) const
int OutlineCount() const
Returns the number of outlines in the set
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:493
ZONES & Zones()
Definition: board.h:292
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: track.cpp:364
virtual void SetColor(COLOR4D color)=0
const wxPoint & GetStart() const
Definition: track.h:116
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:219
int color
Definition: DXF_plotter.cpp:60
bool IsEmpty() const
Returns true if the set is empty (no polygons at all)
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
Definition: plotter.h:484
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
wxString GetNetname() const
Function GetNetname.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
Definition: color4d.h:44
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:506
PAD_SHAPE_T
The set of pad shapes, used with PAD::{Set,Get}Shape()
Definition: pad_shapes.h:32
void DeletePolygon(int aIdx)
Deletes aIdx-th polygon from the set
bool FlashLayer(int aLayer, bool aIncludeZones=false) const
Checks to see whether the via should have a pad on the specific layer.
Definition: track.cpp:482
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
#define NULL
SHAPE_POLY_SET.
FOOTPRINTS & Footprints()
Definition: board.h:286
bool GetSkipPlotNPTH_Pads() const
ZONE handles a list of polygons defining a copper zone.
Definition: zone.h:57
double GetRadius() const
Definition: track.cpp:894
Metadata which can be added in a gerber file as attribute in X2 format.
Definition: gbr_metadata.h:204
Definition: color4d.h:48
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index
double GetAngle() const
Definition: track.cpp:900
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:229
COLOR4D GetColor(int aLayer) const
bool GetSketchPadsOnFabLayers() const
NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
bool GetPlotViaOnMaskLayer() const
const int scale
smd pads, front layer
int GetWidth() const
Definition: track.h:110
Meta control for all vias opacity/visibility.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
Definition: track.h:262
VIATYPE GetViaType() const
Definition: track.h:374
void InflateWithLinkedHoles(int aFactor, int aCircleSegmentsCount, POLYGON_MODE aFastMode)
Performs outline inflation/deflation, using round corners.
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:530
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:209
COLOR_SETTINGS * ColorSettings() const
double GetArcAngleStart() const
Definition: track.cpp:912
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
GBR_NETLIST_METADATA m_NetlistMetadata
An item to handle object attribute.
Definition: gbr_metadata.h:262
Definition: pad.h:60
DrillMarksType GetDrillMarksType() const
print info associated to a net (TO.N attribute)
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
TRACKS & Tracks()
Definition: board.h:283
Definition: track.h:83
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData)=0
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98

References SHAPE_POLY_SET::AddOutline(), LSET::AllCuMask(), B_Cu, B_Fab, B_Mask, B_Paste, BLACK, color, PCB_PLOT_PARAMS::ColorSettings(), SHAPE_POLY_SET::CPolygon(), SHAPE_POLY_SET::DeletePolygon(), dummy(), PLOTTER::EndBlock(), F_Cu, F_Fab, F_Mask, F_Paste, VIA::FlashLayer(), PLOTTER::FlashPadCircle(), BOARD::Footprints(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_VIAPAD, GBR_NETLIST_METADATA::GBR_NETINFO_NET, ARC::GetAngle(), ARC::GetArcAngleStart(), GetArcToSegmentCount(), ARC::GetCenter(), COLOR_SETTINGS::GetColor(), BRDITEMS_PLOTTER::getColor(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetDrillMarksType(), BRDITEMS_PLOTTER::getFineWidthAdj(), VIA::GetLayerSet(), BOARD_CONNECTED_ITEM::GetNetname(), PCB_PLOT_PARAMS::GetPlotMode(), PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer(), ARC::GetRadius(), PCB_PLOT_PARAMS::GetSketchPadsOnFabLayers(), PCB_PLOT_PARAMS::GetSkipPlotNPTH_Pads(), TRACK::GetStart(), VIA::GetViaType(), TRACK::GetWidth(), SHAPE_POLY_SET::InflateWithLinkedHoles(), SHAPE_POLY_SET::IsEmpty(), LAYER_PAD_BK, LAYER_PAD_FR, LAYER_VIAS, LIGHTGRAY, BOARD_DESIGN_SETTINGS::m_MaxError, GBR_METADATA::m_NetlistMetadata, GBR_NETLIST_METADATA::m_NotInNet, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, PCB_PLOT_PARAMS::NO_DRILL_SHAPE, NULL, SHAPE_POLY_SET::OutlineCount(), PAD_ATTRIB_NPTH, PAD_SHAPE_CHAMFERED_RECT, PAD_SHAPE_CIRCLE, PAD_SHAPE_CUSTOM, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, PCB_ARC_T, PCB_VIA_T, BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotDrillMarks(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotFootprintGraphicItems(), BRDITEMS_PLOTTER::PlotFootprintTextItems(), BRDITEMS_PLOTTER::PlotPad(), SHAPE_POLY_SET::PM_FAST, scale, GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), BRDITEMS_PLOTTER::SetLayerSet(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetNetName(), SKETCH, PLOTTER::StartBlock(), PLOTTER::ThickArc(), PLOTTER::ThickSegment(), BOARD::Tracks(), UNDEFINED_LAYER, WHITE, and BOARD::Zones().

Referenced by PlotOneBoardLayer(), and PlotSolderMaskLayer().

◆ 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 1024 of file plot_board_layers.cpp.

1026 {
1027  // Create the plotter driver and set the few plotter specific options
1028  PLOTTER* plotter = NULL;
1029 
1030  switch( aPlotOpts->GetFormat() )
1031  {
1032  case PLOT_FORMAT::DXF:
1033  DXF_PLOTTER* DXF_plotter;
1034  DXF_plotter = new DXF_PLOTTER();
1035  DXF_plotter->SetUnits( aPlotOpts->GetDXFPlotUnits() );
1036 
1037  plotter = DXF_plotter;
1038  break;
1039 
1040  case PLOT_FORMAT::POST:
1041  PS_PLOTTER* PS_plotter;
1042  PS_plotter = new PS_PLOTTER();
1043  PS_plotter->SetScaleAdjust( aPlotOpts->GetFineScaleAdjustX(),
1044  aPlotOpts->GetFineScaleAdjustY() );
1045  plotter = PS_plotter;
1046  break;
1047 
1048  case PLOT_FORMAT::PDF:
1049  plotter = new PDF_PLOTTER();
1050  break;
1051 
1052  case PLOT_FORMAT::HPGL:
1053  HPGL_PLOTTER* HPGL_plotter;
1054  HPGL_plotter = new HPGL_PLOTTER();
1055 
1056  // HPGL options are a little more convoluted to compute, so they get their own function
1057  ConfigureHPGLPenSizes( HPGL_plotter, aPlotOpts );
1058  plotter = HPGL_plotter;
1059  break;
1060 
1061  case PLOT_FORMAT::GERBER:
1062  plotter = new GERBER_PLOTTER();
1063  break;
1064 
1065  case PLOT_FORMAT::SVG:
1066  plotter = new SVG_PLOTTER();
1067  break;
1068 
1069  default:
1070  wxASSERT( false );
1071  return NULL;
1072  }
1073 
1075  renderSettings->LoadColors( aPlotOpts->ColorSettings() );
1076  renderSettings->SetDefaultPenWidth( Millimeter2iu( 0.0212 ) ); // Hairline at 1200dpi
1077  plotter->SetRenderSettings( renderSettings );
1078 
1079  // Compute the viewport and set the other options
1080 
1081  // page layout is not mirrored, so temporarily change mirror option for the page layout
1082  PCB_PLOT_PARAMS plotOpts = *aPlotOpts;
1083 
1084  if( plotOpts.GetPlotFrameRef() && plotOpts.GetMirror() )
1085  plotOpts.SetMirror( false );
1086 
1087  initializePlotter( plotter, aBoard, &plotOpts );
1088 
1089  if( plotter->OpenFile( aFullFileName ) )
1090  {
1091  plotter->ClearHeaderLinesList();
1092 
1093  // For the Gerber "file function" attribute, set the layer number
1094  if( plotter->GetPlotterType() == PLOT_FORMAT::GERBER )
1095  {
1096  bool useX2mode = plotOpts.GetUseGerberX2format();
1097 
1098  GERBER_PLOTTER* gbrplotter = static_cast <GERBER_PLOTTER*> ( plotter );
1099  gbrplotter->DisableApertMacros( plotOpts.GetDisableGerberMacros() );
1100  gbrplotter->UseX2format( useX2mode );
1101  gbrplotter->UseX2NetAttributes( plotOpts.GetIncludeGerberNetlistInfo() );
1102 
1103  // Attributes can be added using X2 format or as comment (X1 format)
1104  AddGerberX2Attribute( plotter, aBoard, aLayer, not useX2mode );
1105  }
1106 
1107  plotter->StartPlot();
1108 
1109  // Plot the frame reference if requested
1110  if( aPlotOpts->GetPlotFrameRef() )
1111  {
1112  PlotWorkSheet( plotter, aBoard->GetProject(), aBoard->GetTitleBlock(),
1113  aBoard->GetPageSettings(), "1", 1, aSheetDesc, aBoard->GetFileName() );
1114 
1115  if( aPlotOpts->GetMirror() )
1116  initializePlotter( plotter, aBoard, aPlotOpts );
1117  }
1118 
1119  // When plotting a negative board: draw a black rectangle (background for plot board
1120  // in white) and switch the current color to WHITE; note the color inversion is actually
1121  // done in the driver (if supported)
1122  if( aPlotOpts->GetNegative() )
1123  {
1124  EDA_RECT bbox = aBoard->ComputeBoundingBox();
1125  FillNegativeKnockout( plotter, bbox );
1126  }
1127 
1128  return plotter;
1129  }
1130 
1131  delete plotter->RenderSettings();
1132  delete plotter;
1133  return NULL;
1134 }
const PAGE_INFO & GetPageSettings() const
Definition: board.h:589
virtual void LoadColors(const COLOR_SETTINGS *aSettings) override
Definition: pcb_painter.cpp:88
void UseX2NetAttributes(bool aEnable)
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:76
bool GetDisableGerberMacros() const
void SetScaleAdjust(double scaleX, double scaleY)
Set the 'fine' scaling for the postscript engine.
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:164
PROJECT * GetProject() const
Definition: board.h:413
void SetMirror(bool aFlag)
void UseX2format(bool aEnable)
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:350
void SetUnits(DXF_UNITS aUnit)
Set the units to use for plotting the DXF file.
const wxString & GetFileName() const
Definition: board.h:281
bool GetUseGerberX2format() const
bool GetMirror() const
PCB_RENDER_SETTINGS Stores PCB specific render settings.
Definition: pcb_painter.h:64
PLOT_FORMAT GetFormat() const
#define NULL
virtual PLOT_FORMAT GetPlotterType() const =0
Returns the effective plot engine in use.
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.
PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
double GetFineScaleAdjustX() const
void DisableApertMacros(bool aDisable)
Disable Aperture Macro (AM) command, only for broken Gerber Readers Regions will be used instead of A...
Base plotter engine class.
Definition: plotter.h:131
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:165
TITLE_BLOCK & GetTitleBlock()
Definition: board.h:595
Handle the component boundary box.
Definition: eda_rect.h:42
void ClearHeaderLinesList()
Remove all lines from the list of free lines to print at the beginning of the file.
Definition: plotter.h:198
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1022
double GetFineScaleAdjustY() const
COLOR_SETTINGS * ColorSettings() const
DXF_UNITS GetDXFPlotUnits() const
void PlotWorkSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, const wxString &aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor, bool aIsFirstPage)
bool GetNegative() const
void SetDefaultPenWidth(int aWidth)
static constexpr int Millimeter2iu(double mm)

References AddGerberX2Attribute(), PLOTTER::ClearHeaderLinesList(), PCB_PLOT_PARAMS::ColorSettings(), BOARD::ComputeBoundingBox(), ConfigureHPGLPenSizes(), GERBER_PLOTTER::DisableApertMacros(), DXF, FillNegativeKnockout(), GERBER, PCB_PLOT_PARAMS::GetDisableGerberMacros(), PCB_PLOT_PARAMS::GetDXFPlotUnits(), 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::GetProject(), BOARD::GetTitleBlock(), PCB_PLOT_PARAMS::GetUseGerberX2format(), HPGL, initializePlotter(), KIGFX::PCB_RENDER_SETTINGS::LoadColors(), Millimeter2iu(), NULL, PLOTTER::OpenFile(), PDF, PlotWorkSheet(), POST, PLOTTER::RenderSettings(), KIGFX::RENDER_SETTINGS::SetDefaultPenWidth(), PCB_PLOT_PARAMS::SetMirror(), PLOTTER::SetRenderSettings(), PSLIKE_PLOTTER::SetScaleAdjust(), DXF_PLOTTER::SetUnits(), PLOTTER::StartPlot(), SVG, 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 532 of file plot_board_layers.cpp.

Referenced by PlotLayerOutlines().