70 hole_sets.emplace_back(
F_Cu,
B_Cu );
72 for( std::vector<DRILL_LAYER_PAIR>::const_iterator it = hole_sets.begin();
73 it != hole_sets.end(); ++it )
77 bool doing_npth = ( it == hole_sets.end() - 1 );
88 fn.SetPath( aPlotDirectory );
92 wxString fullFilename = fn.GetFullPath();
100 msg.Printf(
_(
"** Unable to create %s **\n" ), fullFilename );
109 msg.Printf(
_(
"Create file %s\n" ), fullFilename );
151 text =
"%TF.FilePolarity,Positive*%";
154 if( !plotter.
OpenFile( aFullFilename ) )
162 bool last_item_is_via =
true;
179 if( !last_item_is_via )
185 last_item_is_via =
true;
187 else if( dyn_cast<const PAD*>( hole_descr.
m_ItemParent ) )
189 last_item_is_via =
false;
213 #if 0 // set to 1 to use flashed oblong holes. 229 width,
FILLED, &gbr_metadata );
249 wxSize size( aSize );
250 double orient = aOrient;
255 if( size.x > size.y )
257 std::swap( size.x, size.y );
261 int deltaxy = size.y - size.x;
264 int cy = deltaxy / 2;
266 aStart = wxPoint( cx, cy );
267 cx = 0; cy = -deltaxy / 2;
269 aEnd = wxPoint( cx, cy );
285 bool aMerge_PTH_NPTH )
const 290 fname.SetName( fname.GetName() +
"-drl" );
292 return fname.GetFullPath();
BOARD_ITEM * m_ItemParent
virtual const wxString getDrillFileName(DRILL_LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH) const
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
virtual void SetCreator(const wxString &aCreator)
void UseX2NetAttributes(bool aEnable)
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
virtual void EndBlock(void *aData) override
calling this function allows one to define the end of a group of drawing items the group is started b...
Plotting engines (PostScript, Gerber, HPGL and DXF)
static constexpr double IU_PER_MM
Mock up a conversion function.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode, void *aData) override
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
static void convertOblong2Segment(wxSize aSize, double aOrient, wxPoint &aStart, wxPoint &aEnd)
void AddGerberX2Header(PLOTTER *aPlotter, const BOARD *aBoard, bool aUseX1CompatibilityMode)
Calculates some X2 attributes, as defined in the Gerber file format specification J4 (chapter 5) and ...
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
void UseX2format(bool aEnable)
void SetFormat(int aRightDigits=6)
Function SetFormat Initialize internal parameters to match the given format.
void AddLineToHeader(const wxString &aExtraString)
Add a line to the list of free lines to print at the beginning of the file.
std::vector< DRILL_LAYER_PAIR > getUniqueLayerPairs() const
Get unique layer pairs by examining the micro and blind_buried vias.
void RotatePoint(int *pX, int *pY, double angle)
A pure virtual class used to derive REPORTER objects from.
void CreateMapFilesSet(const wxString &aPlotDirectory, REPORTER *aReporter=NULL)
Function CreateMapFilesSet Creates the full set of map files for the board, in PS,...
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
virtual bool StartPlot() override
Function StartPlot Write GERBER header to file initialize global variable g_Plot_PlotOutputFile.
int getHolesCount() const
a pad with a castellated through hole
Board plot function definition file.
T AddAngles(T a1, T2 a2)
Add two angles (keeping the result normalized). T2 is here.
DRILL_PRECISION m_precision
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > DRILL_LAYER_PAIR
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &size, double orient, OUTLINE_MODE trace_mode, void *aData) override
const wxString BuildFileFunctionAttributeString(DRILL_LAYER_PAIR aLayerPair, bool aIsNpth, bool aCompatNCdrill=false) const
PAD_PROP_T GetProperty() const
void buildHolesList(DRILL_LAYER_PAIR aLayerPair, bool aGenerateNPTH_list)
Function BuildHolesList Create the list of holes and tools for a given board The list is sorted by in...
FOOTPRINT * GetParent() const
void CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, REPORTER *aReporter=NULL)
Function CreateDrillandMapFilesSet Creates the full set of Excellon drill file for the board filename...
Information pertinent to a Pcbnew printed circuit board.
virtual const wxString getDrillFileName(DRILL_LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH) const override
virtual bool EndPlot() override
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false) override
Function SetGerberCoordinatesFormat selection of Gerber units and resolution (number of digits in man...
virtual void FlashPadCircle(const wxPoint &pos, int diametre, OUTLINE_MODE trace_mode, void *aData) override
Filled circular flashes are stored as apertures.
Classes used in drill files, map files and report files generation.
GERBER_WRITER(BOARD *aPcb)
wxString m_drillFileExtension
std::vector< HOLE_INFO > m_holeListBuffer
int createDrillFile(wxString &aFullFilename, bool aIsNpth, DRILL_LAYER_PAIR aLayerPair)
Function createDrillFile Creates an Excellon drill file.
GENDRILL_WRITER_BASE is a class to create drill maps and drill report, and a helper class to created ...