KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 VECTOR2I &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, bool aIsFlipped)
 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
 
VECTOR2I 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 42 of file gerber_placefile_writer.cpp.

References m_layer, m_pcb, m_plotOtherPadsMarker, and m_plotPad1Marker.

◆ ~PLACEFILE_GERBER_WRITER()

virtual PLACEFILE_GERBER_WRITER::~PLACEFILE_GERBER_WRITER ( )
inlinevirtual

Definition at line 44 of file gerber_placefile_writer.h.

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 51 of file gerber_placefile_writer.cpp.

References AddGerberX2Header(), PLOTTER::AddLineToHeader(), ANGLE_0, SHAPE_LINE_CHAIN::Append(), B_Cu, GERBER_PLOTTER::ClearAllAttributes(), GBR_NETLIST_METADATA::ClearExtraData(), ConvertNotAllowedCharsInGerber(), BOARD::Drawings(), 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_POS, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PADOTHER_POS, GBR_NETLIST_METADATA::GBR_NETINFO_CMP, GBR_NETLIST_METADATA::GBR_NETINFO_PAD, BOARD_DESIGN_SETTINGS::GetAuxOrigin(), BOX2< Vec >::GetBottom(), BOARD::GetCopperLayerCount(), BOARD::GetDesignSettings(), BOX2< Vec >::GetLeft(), BOARD::GetPlotOptions(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), EDA_IU_SCALE::IU_PER_MILS, 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(), EDA_IU_SCALE::mmToIU(), 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(), PLOTTER::OpenFile(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), pad, PCB_SHAPE_T, pcbIUScale, BRDITEMS_PLOTTER::PlotBoardGraphicItem(), BRDITEMS_PLOTTER::PlotShape(), 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(), and PCBNEW_JOBS_HANDLER::JobExportPos().

◆ 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 344 of file gerber_placefile_writer.cpp.

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 361 of file gerber_placefile_writer.cpp.

References B_Cu, and FILEEXT::GerberFileExtension.

Referenced by DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles().

◆ mapRotationAngle()

double PLACEFILE_GERBER_WRITER::mapRotationAngle ( double  aAngle,
bool  aIsFlipped 
)
private

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

Parameters
aAngleis the Pcbnew angle in degrees
aIsFlipped= false for footprints on top side, true on bottom side (flipped)
Returns
the angle in degrees in Gerber convention: same as Pcbnew for top side 180 + angle for bottom side

Definition at line 317 of file gerber_placefile_writer.cpp.

Referenced by CreatePlaceFile().

◆ SetOptions()

void PLACEFILE_GERBER_WRITER::SetOptions ( const VECTOR2I 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.

References m_offset.

Member Data Documentation

◆ m_layer

PCB_LAYER_ID PLACEFILE_GERBER_WRITER::m_layer
private

Definition at line 102 of file gerber_placefile_writer.h.

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

◆ m_offset

VECTOR2I PLACEFILE_GERBER_WRITER::m_offset
private

Definition at line 103 of file gerber_placefile_writer.h.

Referenced by CreatePlaceFile(), and SetOptions().

◆ m_pcb

BOARD* PLACEFILE_GERBER_WRITER::m_pcb
private

Definition at line 101 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 106 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 105 of file gerber_placefile_writer.h.

Referenced by CreatePlaceFile(), and PLACEFILE_GERBER_WRITER().


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