KiCad PCB EDA Suite
PLACEFILE_GERBER_WRITER Class Reference

Used to create Gerber drill files. More...

#include <gerber_placefile_writer.h>

Public Member Functions

 PLACEFILE_GERBER_WRITER (BOARD *aPcb)
 
virtual ~PLACEFILE_GERBER_WRITER ()
 
void SetOptions (const wxPoint &aOffset)
 Initialize internal parameters to match drill options. More...
 
int CreatePlaceFile (wxString &aFullFilename, PCB_LAYER_ID aLayer, bool aIncludeBrdEdges)
 Create an pnp gerber file. More...
 
const wxString GetPlaceFileName (const wxString &aFullBaseFilename, PCB_LAYER_ID aLayer) const
 

Private Member Functions

double mapRotationAngle (double aAngle)
 Convert a KiCad footprint orientation to gerber rotation both are in degrees. More...
 
void findPads1 (std::vector< PAD * > &aPadList, FOOTPRINT *aFootprint) const
 Find the pad(s) 1 (or pad "A1") of a footprint. More...
 

Private Attributes

BOARDm_pcb
 
PCB_LAYER_ID m_layer
 
wxPoint m_offset
 
bool m_plotPad1Marker
 
bool m_plotOtherPadsMarker
 

Detailed Description

Used to create Gerber drill files.

Definition at line 39 of file gerber_placefile_writer.h.

Constructor & Destructor Documentation

◆ PLACEFILE_GERBER_WRITER()

PLACEFILE_GERBER_WRITER::PLACEFILE_GERBER_WRITER ( BOARD aPcb)

Definition at line 45 of file gerber_placefile_writer.cpp.

46 {
47  m_pcb = aPcb;
48  m_plotPad1Marker = true; // Place a marker to pin 1 (or A1) position
49  m_plotOtherPadsMarker = true; // Place a marker to other pins position
50  m_layer = PCB_LAYER_ID::UNDEFINED_LAYER; // No layer set
51 }

References m_layer, m_pcb, m_plotOtherPadsMarker, m_plotPad1Marker, and UNDEFINED_LAYER.

◆ ~PLACEFILE_GERBER_WRITER()

virtual PLACEFILE_GERBER_WRITER::~PLACEFILE_GERBER_WRITER ( )
inlinevirtual

Definition at line 44 of file gerber_placefile_writer.h.

45  {
46  }

Member Function Documentation

◆ CreatePlaceFile()

int PLACEFILE_GERBER_WRITER::CreatePlaceFile ( wxString &  aFullFilename,
PCB_LAYER_ID  aLayer,
bool  aIncludeBrdEdges 
)

Create an pnp gerber file.

Parameters
aFullFilenameis the full filename.
aLayeris the layer (F_Cu or B_Cu) to generate.
aIncludeBrdEdgesuse true to include board outlines.
Returns
component count, or -1 if the file cannot be created.

Definition at line 54 of file gerber_placefile_writer.cpp.

56 {
57  m_layer = aLayer;
58 
59  PCB_PLOT_PARAMS plotOpts = m_pcb->GetPlotOptions();
60 
61  if( plotOpts.GetUseAuxOrigin() )
63 
64  // Collect footprints on the right layer
65  std::vector<FOOTPRINT*> fp_list;
66 
67  for( FOOTPRINT* footprint : m_pcb->Footprints() )
68  {
69  if( footprint->GetAttributes() & FP_EXCLUDE_FROM_POS_FILES )
70  continue;
71 
72  if( footprint->GetLayer() == aLayer )
73  fp_list.push_back( footprint );
74  }
75 
76  LOCALE_IO dummy_io; // Use the standard notation for float numbers
77 
78  GERBER_PLOTTER plotter;
79 
80  // Gerber drill file imply X2 format:
81  plotter.UseX2format( true );
82  plotter.UseX2NetAttributes( true );
83 
84  // Add the standard X2 header, without FileFunction
85  AddGerberX2Header( &plotter, m_pcb );
86  plotter.SetViewport( m_offset, IU_PER_MILS/10, /* scale */ 1.0, /* mirror */false );
87 
88  // has meaning only for gerber plotter. Must be called only after SetViewport
89  plotter.SetGerberCoordinatesFormat( 6 );
90  plotter.SetCreator( wxT( "PCBNEW" ) );
91 
92  // Add the standard X2 FileFunction for P&P files
93  // %TF.FileFunction,Component,Ln,[top][bottom]*%
94  wxString text;
95  text.Printf( "%%TF.FileFunction,Component,L%d,%s*%%",
96  aLayer == B_Cu ? m_pcb->GetCopperLayerCount() : 1,
97  aLayer == B_Cu ? "Bot" : "Top" );
98  plotter.AddLineToHeader( text );
99 
100  // Add file polarity (positive)
101  text = "%TF.FilePolarity,Positive*%";
102  plotter.AddLineToHeader( text );
103 
104  if( !plotter.OpenFile( aFullFilename ) )
105  return -1;
106 
107  // We need a BRDITEMS_PLOTTER to plot pads
108  BRDITEMS_PLOTTER brd_plotter( &plotter, m_pcb, plotOpts );
109 
110  plotter.StartPlot();
111 
112  // Some tools in P&P files have the type and size defined.
113  // they are position flash (round), pad1 flash (diamond), other pads flash (round)
114  // and component outline thickness (polyline)
115  int flash_position_shape_diam = Millimeter2iu( 0.3 ); // defined size for position shape (circle)
116  int pad1_mark_size = Millimeter2iu( 0.36 ); // defined size for pad 1 position (diamond)
117  int other_pads_mark_size = 0; // defined size for position shape (circle)
118  int line_thickness = Millimeter2iu( 0.1 ); // defined size for component outlines
119 
120  brd_plotter.SetLayerSet( LSET( aLayer ) );
121  int cmp_count = 0;
122  bool allowUtf8 = true;
123 
124  // Plot components data: position, outlines, pad1 and other pads.
125  for( FOOTPRINT* footprint : fp_list )
126  {
127  // Manage the aperture attribute component position:
128  GBR_METADATA gbr_metadata;
130 
131  // Add object attribute: component reference to flash (mainly useful for users)
132  // using quoted UTF8 string
133  wxString ref = ConvertNotAllowedCharsInGerber( footprint->Reference().GetShownText(),
134  allowUtf8, true );
135 
136  gbr_metadata.SetCmpReference( ref );
138 
139  // Add P&P specific attributes
140  GBR_CMP_PNP_METADATA pnpAttrib;
141 
142  // Add rotation info (rotation is CCW, in degrees):
143  pnpAttrib.m_Orientation = mapRotationAngle( footprint->GetOrientationDegrees() );
144 
146 
147  if( footprint->GetAttributes() & FP_THROUGH_HOLE )
149  else if( footprint->GetAttributes() & FP_SMD )
151 
152  // Add component value info:
153  pnpAttrib.m_Value = ConvertNotAllowedCharsInGerber( footprint->Value().GetShownText(),
154  allowUtf8, true );
155 
156  // Add component footprint info:
157  wxString fp_info = FROM_UTF8( footprint->GetFPID().GetLibItemName().c_str() );
158  pnpAttrib.m_Footprint = ConvertNotAllowedCharsInGerber( fp_info, allowUtf8, true );
159 
160  // Add footprint lib name:
161  fp_info = FROM_UTF8( footprint->GetFPID().GetLibNickname().c_str() );
162  pnpAttrib.m_LibraryName = ConvertNotAllowedCharsInGerber( fp_info, allowUtf8, true );
163 
164  gbr_metadata.m_NetlistMetadata.SetExtraData( pnpAttrib.FormatCmpPnPMetadata() );
165 
166  wxPoint flash_pos = footprint->GetPosition();
167 
168  plotter.FlashPadCircle( flash_pos, flash_position_shape_diam, FILLED, &gbr_metadata );
169  gbr_metadata.m_NetlistMetadata.ClearExtraData();
170 
171  // Now some extra metadata is output, avoid blindly clearing the full metadata list
173 
174  // We plot the footprint courtyard when possible.
175  // If not, the pads bounding box will be used.
176  bool useFpPadsBbox = true;
177  bool onBack = aLayer == B_Cu;
178 
179  footprint->BuildPolyCourtyards();
180 
181  int checkFlag = onBack ? MALFORMED_B_COURTYARD : MALFORMED_F_COURTYARD;
182 
183  if( ( footprint->GetFlags() & checkFlag ) == 0 )
184  {
185  gbr_metadata.SetApertureAttrib(
187 
188  const SHAPE_POLY_SET& courtyard = footprint->GetPolyCourtyard( aLayer );
189 
190  for( int ii = 0; ii < courtyard.OutlineCount(); ii++ )
191  {
192  SHAPE_LINE_CHAIN poly = courtyard.Outline( ii );
193 
194  if( !poly.PointCount() )
195  continue;
196 
197  useFpPadsBbox = false;
198  plotter.PLOTTER::PlotPoly( poly, FILL_TYPE::NO_FILL, line_thickness,
199  &gbr_metadata );
200  }
201  }
202 
203  if( useFpPadsBbox )
204  {
205  gbr_metadata.SetApertureAttrib(
207 
208  // bbox of fp pads, pos 0, rot 0, non flipped
209  EDA_RECT bbox = footprint->GetFpPadsLocalBbox();
210 
211  // negate bbox Y values if the fp is flipped (always flipped around X axis
212  // in Gerber P&P files).
213  int y_sign = aLayer == B_Cu ? -1 : 1;
214 
215  SHAPE_LINE_CHAIN poly;
216  poly.Append( bbox.GetLeft(), y_sign*bbox.GetTop() );
217  poly.Append( bbox.GetLeft(), y_sign*bbox.GetBottom() );
218  poly.Append( bbox.GetRight(), y_sign*bbox.GetBottom() );
219  poly.Append( bbox.GetRight(), y_sign*bbox.GetTop() );
220  poly.SetClosed( true );
221 
222  poly.Rotate( -footprint->GetOrientationRadians(), VECTOR2I( 0, 0 ) );
223  poly.Move( footprint->GetPosition() );
224  plotter.PLOTTER::PlotPoly( poly, FILL_TYPE::NO_FILL, line_thickness, &gbr_metadata );
225  }
226 
227  std::vector<PAD*>pad_key_list;
228 
229  if( m_plotPad1Marker )
230  {
231  findPads1( pad_key_list, footprint );
232 
233  for( PAD* pad1 : pad_key_list )
234  {
235  gbr_metadata.SetApertureAttrib(
237 
238  gbr_metadata.SetPadName( pad1->GetNumber(), allowUtf8, true );
239 
240  gbr_metadata.SetPadPinFunction( pad1->GetPinFunction(), allowUtf8, true );
241 
243 
244  // Flashes a diamond at pad position:
245  plotter.FlashRegularPolygon( pad1->GetPosition(), pad1_mark_size, 4, 0.0, FILLED,
246  &gbr_metadata );
247  }
248  }
249 
251  {
252  gbr_metadata.SetApertureAttrib(
255 
256  for( PAD* pad: footprint->Pads() )
257  {
258  bool skip_pad = false;
259 
260  for( PAD* pad1 : pad_key_list )
261  {
262  if( pad == pad1 ) // Already plotted
263  {
264  skip_pad = true;
265  break;
266  }
267  }
268 
269  if( skip_pad )
270  continue;
271 
272  // Skip also pads not on the current layer, like pads only
273  // on a tech layer
274  if( !pad->IsOnLayer( aLayer ) )
275  continue;
276 
277  gbr_metadata.SetPadName( pad->GetNumber(), allowUtf8, true );
278 
279  gbr_metadata.SetPadPinFunction( pad->GetPinFunction(), allowUtf8, true );
280 
281  // Flashes a round, 0 sized round shape at pad position
282  plotter.FlashPadCircle( pad->GetPosition(), other_pads_mark_size, FILLED,
283  &gbr_metadata );
284  }
285  }
286 
287  plotter.ClearAllAttributes(); // Unconditionally close all .TO attributes
288 
289  cmp_count++;
290  }
291 
292  // Plot board outlines, if requested
293  if( aIncludeBrdEdges )
294  {
295  brd_plotter.SetLayerSet( LSET( Edge_Cuts ) );
296 
297  // Plot edge layer and graphic items
298  brd_plotter.PlotBoardGraphicItems();
299 
300  // Draw footprint other graphic items:
301  for( FOOTPRINT* footprint : fp_list )
302  {
303  for( BOARD_ITEM* item : footprint->GraphicalItems() )
304  {
305  if( item->Type() == PCB_FP_SHAPE_T && item->GetLayer() == Edge_Cuts )
306  brd_plotter.PlotFootprintGraphicItem( (FP_SHAPE*) item );
307  }
308  }
309  }
310 
311  plotter.EndPlot();
312 
313  return cmp_count;
314 }
virtual void FlashRegularPolygon(const wxPoint &aShapePos, int aDiameter, int aCornerCount, double aOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a regular polygon.
aperture used to draw component outline courtyard in placement files.
Definition: gbr_metadata.h:161
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:174
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: board.h:538
int OutlineCount() const
Return the number of vertices in a given outline/hole.
void UseX2NetAttributes(bool aEnable)
#define MALFORMED_B_COURTYARD
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:110
aperture used for flashed pads position in placement files.
Definition: gbr_metadata.h:149
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
aperture used to draw component physical body outline without pins in placement files.
Definition: gbr_metadata.h:152
print info associated to a component (TO.C attribute)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:80
int GetTop() const
Definition: eda_rect.h:113
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:76
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:219
#define MALFORMED_F_COURTYARD
int GetLeft() const
Definition: eda_rect.h:112
void Move(const VECTOR2I &aVector) override
void AddGerberX2Header(PLOTTER *aPlotter, const BOARD *aBoard, bool aUseX1CompatibilityMode)
Calculate some X2 attributes as defined in the Gerber file format specification J4 (chapter 5) and ad...
Definition: pcbplot.cpp:282
void UseX2format(bool aEnable)
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
void AddLineToHeader(const wxString &aExtraString)
Add a line to the list of free lines to print at the beginning of the file.
Definition: plotter.h:183
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
int PointCount() const
Return the number of points (vertices) in this line chain.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:589
virtual bool StartPlot() override
Write GERBER header to file initialize global variable g_Plot_PlotOutputFile.
Information which can be added in a gerber P&P file as attribute of a component.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
int GetBottom() const
Definition: eda_rect.h:114
void SetPadPinFunction(const wxString &aPadPinFunction, bool aUseUTF8, bool aEscapeString)
Definition: gbr_metadata.h:236
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:502
void ClearAllAttributes()
Remove (clear) all attributes from object attributes dictionary (TO.
void SetExtraData(const wxString &aExtraData)
Set the extra data string printed at end of net attributes.
Represent a set of closed polygons.
void SetPadName(const wxString &aPadname, bool aUseUTF8=false, bool aEscapeString=false)
Definition: gbr_metadata.h:231
SHAPE_LINE_CHAIN & Outline(int aIndex)
FOOTPRINTS & Footprints()
Definition: board.h:233
int GetRight() const
Definition: eda_rect.h:111
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
Metadata which can be added in a gerber file as attribute in X2 format.
Definition: gbr_metadata.h:204
Parameters and options when plotting/printing a board.
void Rotate(double aAngle, const VECTOR2I &aCenter=VECTOR2I(0, 0)) override
Rotate all vertices by a given angle.
aperture used for flashed pin 1 (or A1 or AA1) position in placement files.
Definition: gbr_metadata.h:146
wxString FormatCmpPnPMetadata()
void findPads1(std::vector< PAD * > &aPadList, FOOTPRINT *aFootprint) const
Find the pad(s) 1 (or pad "A1") of a footprint.
virtual bool EndPlot() override
Represent a polyline (an zero-thickness chain of connected line segments).
int GetCopperLayerCount() const
Definition: board.cpp:454
Handle the component boundary box.
Definition: eda_rect.h:42
#define IU_PER_MILS
Definition: plotter.cpp:136
bool m_TryKeepPreviousAttributes
If true, do not clear all attributes when a attribute has changed.
wxString ConvertNotAllowedCharsInGerber(const wxString &aString, bool aAllowUtf8Chars, bool aQuoteString)
Normalize aString and convert it to a Gerber compatible wxString.
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false) override
Selection of Gerber units and resolution (number of digits in mantissa).
print info associated to a flashed pad (TO.P attribute)
double mapRotationAngle(double aAngle)
Convert a KiCad footprint orientation to gerber rotation both are in degrees.
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:209
virtual void FlashPadCircle(const wxPoint &pos, int diametre, OUTLINE_MODE trace_mode, void *aData) override
Filled circular flashes are stored as apertures.
GBR_NETLIST_METADATA m_NetlistMetadata
An item to handle object attribute.
Definition: gbr_metadata.h:262
bool GetUseAuxOrigin() const
Definition: pad.h:57
static constexpr int Millimeter2iu(double mm)
void SetCmpReference(const wxString &aComponentRef)
Definition: gbr_metadata.h:241
wxPoint m_AuxOrigin
origin for plot exports
void ClearExtraData()
Clear the extra data string printed at end of net attributes.

References AddGerberX2Header(), PLOTTER::AddLineToHeader(), SHAPE_LINE_CHAIN::Append(), B_Cu, GERBER_PLOTTER::ClearAllAttributes(), GBR_NETLIST_METADATA::ClearExtraData(), ConvertNotAllowedCharsInGerber(), Edge_Cuts, GERBER_PLOTTER::EndPlot(), FILLED, findPads1(), GERBER_PLOTTER::FlashPadCircle(), GERBER_PLOTTER::FlashRegularPolygon(), BOARD::Footprints(), GBR_CMP_PNP_METADATA::FormatCmpPnPMetadata(), FP_EXCLUDE_FROM_POS_FILES, FP_SMD, FP_THROUGH_HOLE, FROM_UTF8(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_COURTYARD, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_FOOTPRINT, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_POSITION, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PAD1_POSITION, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PADOTHER_POSITION, GBR_NETLIST_METADATA::GBR_NETINFO_CMP, GBR_NETLIST_METADATA::GBR_NETINFO_PAD, EDA_RECT::GetBottom(), BOARD::GetCopperLayerCount(), BOARD::GetDesignSettings(), EDA_RECT::GetLeft(), BOARD::GetPlotOptions(), EDA_RECT::GetRight(), EDA_RECT::GetTop(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), IU_PER_MILS, BOARD_DESIGN_SETTINGS::m_AuxOrigin, GBR_CMP_PNP_METADATA::m_Footprint, m_layer, GBR_CMP_PNP_METADATA::m_LibraryName, GBR_CMP_PNP_METADATA::m_MountType, GBR_METADATA::m_NetlistMetadata, m_offset, GBR_CMP_PNP_METADATA::m_Orientation, m_pcb, m_plotOtherPadsMarker, m_plotPad1Marker, GBR_NETLIST_METADATA::m_TryKeepPreviousAttributes, GBR_CMP_PNP_METADATA::m_Value, MALFORMED_B_COURTYARD, MALFORMED_F_COURTYARD, mapRotationAngle(), Millimeter2iu(), GBR_CMP_PNP_METADATA::MOUNT_TYPE_SMD, GBR_CMP_PNP_METADATA::MOUNT_TYPE_TH, GBR_CMP_PNP_METADATA::MOUNT_TYPE_UNSPECIFIED, SHAPE_LINE_CHAIN::Move(), NO_FILL, PLOTTER::OpenFile(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), pad, PCB_FP_SHAPE_T, BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::Rotate(), GBR_METADATA::SetApertureAttrib(), SHAPE_LINE_CHAIN::SetClosed(), GBR_METADATA::SetCmpReference(), PLOTTER::SetCreator(), GBR_NETLIST_METADATA::SetExtraData(), GERBER_PLOTTER::SetGerberCoordinatesFormat(), BRDITEMS_PLOTTER::SetLayerSet(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetPadName(), GBR_METADATA::SetPadPinFunction(), GERBER_PLOTTER::SetViewport(), GERBER_PLOTTER::StartPlot(), text, GERBER_PLOTTER::UseX2format(), and GERBER_PLOTTER::UseX2NetAttributes().

Referenced by DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles().

◆ findPads1()

void PLACEFILE_GERBER_WRITER::findPads1 ( std::vector< PAD * > &  aPadList,
FOOTPRINT aFootprint 
) const
private

Find the pad(s) 1 (or pad "A1") of a footprint.

Useful to plot a marker at this (these) position(s).

Parameters
aPadListis the list to fill.
aFootprintis the footprint to test,

Definition at line 325 of file gerber_placefile_writer.cpp.

326 {
327  // Fint the pad "1" or pad "A1"
328  // this is possible only if only one pad is found
329  // useful to place a marker in this position
330 
331  for( PAD* pad : aFootprint->Pads() )
332  {
333  if( !pad->IsOnLayer( m_layer ) )
334  continue;
335 
336  if( pad->GetNumber() == "1" || pad->GetNumber() == "A1")
337  aPadList.push_back( pad );
338  }
339 }
PADS & Pads()
Definition: footprint.h:168
Definition: pad.h:57

References m_layer, pad, and FOOTPRINT::Pads().

Referenced by CreatePlaceFile().

◆ GetPlaceFileName()

const wxString PLACEFILE_GERBER_WRITER::GetPlaceFileName ( const wxString &  aFullBaseFilename,
PCB_LAYER_ID  aLayer 
) const
Parameters
aFullBaseFilename= a full filename. it will be modified to add "-pnp" and set the extension
aLayer= layer (F_Cu or B_Cu) to generate
Returns
a filename which identify the drill file function.

Definition at line 342 of file gerber_placefile_writer.cpp.

344 {
345  // Gerber files extension is always .gbr.
346  // Therefore, to mark pnp files, add "-pnp" to the filename, and a layer id.
347  wxFileName fn = aFullBaseFilename;
348 
349  wxString post_id = "-pnp_";
350  post_id += aLayer == B_Cu ? "bottom" : "top";
351  fn.SetName( fn.GetName() + post_id );
352  fn.SetExt( GerberFileExtension );
353 
354  return fn.GetFullPath();
355 }
const std::string GerberFileExtension

References B_Cu, and GerberFileExtension.

Referenced by DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles().

◆ mapRotationAngle()

double PLACEFILE_GERBER_WRITER::mapRotationAngle ( double  aAngle)
private

Convert a KiCad footprint orientation to gerber rotation both are in degrees.

Definition at line 317 of file gerber_placefile_writer.cpp.

318 {
319  // Convert a KiCad footprint orientation to gerber rotation, depending on the layer
320  // Currently, same notation as KiCad.
321  return aAngle;
322 }

Referenced by CreatePlaceFile().

◆ SetOptions()

void PLACEFILE_GERBER_WRITER::SetOptions ( const wxPoint &  aOffset)
inline

Initialize internal parameters to match drill options.

Note
PTH and NPTH are always separate files in Gerber format.
Parameters
aOffsetis the drill coordinates offset.

Definition at line 56 of file gerber_placefile_writer.h.

57  {
58  m_offset = aOffset;
59  }

References m_offset.

Member Data Documentation

◆ m_layer

PCB_LAYER_ID PLACEFILE_GERBER_WRITER::m_layer
private

Definition at line 97 of file gerber_placefile_writer.h.

Referenced by CreatePlaceFile(), findPads1(), and PLACEFILE_GERBER_WRITER().

◆ m_offset

wxPoint PLACEFILE_GERBER_WRITER::m_offset
private

Definition at line 98 of file gerber_placefile_writer.h.

Referenced by CreatePlaceFile(), and SetOptions().

◆ m_pcb

BOARD* PLACEFILE_GERBER_WRITER::m_pcb
private

Definition at line 96 of file gerber_placefile_writer.h.

Referenced by CreatePlaceFile(), and PLACEFILE_GERBER_WRITER().

◆ m_plotOtherPadsMarker

bool PLACEFILE_GERBER_WRITER::m_plotOtherPadsMarker
private

Definition at line 101 of file gerber_placefile_writer.h.

Referenced by CreatePlaceFile(), and PLACEFILE_GERBER_WRITER().

◆ m_plotPad1Marker

bool PLACEFILE_GERBER_WRITER::m_plotPad1Marker
private

Definition at line 100 of file gerber_placefile_writer.h.

Referenced by CreatePlaceFile(), and PLACEFILE_GERBER_WRITER().


The documentation for this class was generated from the following files: