KiCAD pcbnew scripting
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
pcbnew.GERBER_PLOTTER Class Reference
Inheritance diagram for pcbnew.GERBER_PLOTTER:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self)
 
def GetPlotterType (self)
 
def GetDefaultFileExtension ()
 
def StartPlot (self)
 
def EndPlot (self)
 
def SetCurrentLineWidth
 
def SetDefaultLineWidth (self, width)
 
def SetDash (self, dashed)
 
def SetColor (self, color)
 
def SetViewport (self, aOffset, aIusPerDecimil, aScale, aMirror)
 
def Rect (self, args)
 
def Circle (self, args)
 
def Arc (self, args)
 
def ThickSegment (self, start, end, width, tracemode, aData)
 
def ThickArc (self, centre, StAngle, EndAngle, rayon, width, tracemode, aData)
 
def ThickRect (self, p1, p2, width, tracemode, aData)
 
def ThickCircle (self, pos, diametre, width, tracemode, aData)
 
def PlotPoly (self, args)
 
def PenTo (self, pos, plume)
 
def Text
 
def FlashPadCircle (self, pos, diametre, trace_mode, aData)
 
def FlashPadOval (self, pos, size, orient, trace_mode, aData)
 
def FlashPadRect (self, pos, size, orient, trace_mode, aData)
 
def FlashPadRoundRect (self, aPadPos, aSize, aCornerRadius, aOrient, aTraceMode, aData)
 
def FlashPadCustom (self, aPadPos, aSize, aPolygons, aTraceMode, aData)
 
def FlashPadTrapez (self, aPadPos, aCorners, aPadOrient, aTrace_Mode, aData)
 
def SetLayerPolarity (self, aPositive)
 
def SetGerberCoordinatesFormat
 
def UseX2Attributes (self, aEnable)
 
def UseX2NetAttributes (self, aEnable)
 
def StartBlock (self, aData)
 
def EndBlock (self, aData)
 
- Public Member Functions inherited from pcbnew.PLOTTER
def __init__ (self, args, kwargs)
 
def GetPlotterType (self)
 
def StartPlot (self)
 
def EndPlot (self)
 
def SetNegative (self, _negative)
 
def SetColorMode (self, _color_mode)
 
def GetColorMode (self)
 
def SetPageSettings (self, aPageSettings)
 
def SetCurrentLineWidth
 
def SetDefaultLineWidth (self, width)
 
def GetCurrentLineWidth (self)
 
def SetColor (self, color)
 
def SetDash (self, dashed)
 
def SetCreator (self, aCreator)
 
def SetTitle (self, aTitle)
 
def AddLineToHeader (self, aExtraString)
 
def ClearHeaderLinesList (self)
 
def SetViewport (self, aOffset, aIusPerDecimil, aScale, aMirror)
 
def OpenFile (self, aFullFilename)
 
def GetIUsPerDecimil (self)
 
def Rect (self, args)
 
def Circle (self, args)
 
def Arc (self, args)
 
def PenTo (self, pos, plume)
 
def MoveTo (self, pos)
 
def LineTo (self, pos)
 
def FinishTo (self, pos)
 
def PenFinish (self)
 
def PlotPoly (self, args)
 
def PlotImage (self, aImage, aPos, aScaleFactor)
 
def ThickSegment (self, start, end, width, tracemode, aData)
 
def ThickArc (self, centre, StAngle, EndAngle, rayon, width, tracemode, aData)
 
def ThickRect (self, p1, p2, width, tracemode, aData)
 
def ThickCircle (self, pos, diametre, width, tracemode, aData)
 
def FlashPadCircle (self, aPadPos, aDiameter, aTraceMode, aData)
 
def FlashPadOval (self, aPadPos, aSize, aPadOrient, aTraceMode, aData)
 
def FlashPadRect (self, aPadPos, aSize, aPadOrient, aTraceMode, aData)
 
def FlashPadRoundRect (self, aPadPos, aSize, aCornerRadius, aOrient, aTraceMode, aData)
 
def FlashPadCustom (self, aPadPos, aSize, aPolygons, aTraceMode, aData)
 
def FlashPadTrapez (self, aPadPos, aCorners, aPadOrient, aTraceMode, aData)
 
def Text
 
def Marker (self, position, diametre, aShapeId)
 
def SetLayerPolarity (self, aPositive)
 
def SetTextMode (self, mode)
 
def SetGerberCoordinatesFormat
 
def StartBlock (self, aData)
 
def EndBlock (self, aData)
 

Public Attributes

 this
 

Static Public Attributes

tuple GetDefaultFileExtension = staticmethod(GetDefaultFileExtension)
 
- Static Public Attributes inherited from pcbnew.PLOTTER
 DO_NOT_SET_LINE_WIDTH = _pcbnew.PLOTTER_DO_NOT_SET_LINE_WIDTH
 
 USE_DEFAULT_LINE_WIDTH = _pcbnew.PLOTTER_USE_DEFAULT_LINE_WIDTH
 
 MARKER_COUNT = _pcbnew.PLOTTER_MARKER_COUNT
 

Detailed Description

C++ includes: plot_common.h 

Definition at line 11296 of file pcbnew.py.

Constructor & Destructor Documentation

def pcbnew.GERBER_PLOTTER.__init__ (   self)
__init__(GERBER_PLOTTER self) -> GERBER_PLOTTER

GERBER_PLOTTER::GERBER_PLOTTER() 

Definition at line 11308 of file pcbnew.py.

Member Function Documentation

def pcbnew.GERBER_PLOTTER.Arc (   self,
  args 
)
Arc(GERBER_PLOTTER self, wxPoint aCenter, double aStAngle, double aEndAngle, int aRadius, FILL_T aFill, int aWidth)
Arc(GERBER_PLOTTER self, wxPoint aCenter, double aStAngle, double aEndAngle, int aRadius, FILL_T aFill)

void
GERBER_PLOTTER::Arc(const wxPoint &aCenter, double aStAngle, double
aEndAngle, int aRadius, FILL_T aFill, int
aWidth=USE_DEFAULT_LINE_WIDTH) override

Generic fallback: arc rendered as a polyline. 

Definition at line 11478 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.Circle (   self,
  args 
)
Circle(GERBER_PLOTTER self, wxPoint pos, int diametre, FILL_T fill, int width)
Circle(GERBER_PLOTTER self, wxPoint pos, int diametre, FILL_T fill)

void
GERBER_PLOTTER::Circle(const wxPoint &pos, int diametre, FILL_T fill,
int width=USE_DEFAULT_LINE_WIDTH) override 

Definition at line 11466 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.EndBlock (   self,
  aData 
)
EndBlock(GERBER_PLOTTER self, void * aData)

void
GERBER_PLOTTER::EndBlock(void *aData) override

calling this function allows to define the end of a group of drawing
items the group is started by StartBlock() (used in X2 format with
netlist attributes)

Parameters:
-----------

aData:  can define any parameter 

Definition at line 11806 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.EndPlot (   self)
EndPlot(GERBER_PLOTTER self) -> bool

bool
GERBER_PLOTTER::EndPlot() override 

Definition at line 11357 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.FlashPadCircle (   self,
  pos,
  diametre,
  trace_mode,
  aData 
)
FlashPadCircle(GERBER_PLOTTER self, wxPoint pos, int diametre, EDA_DRAW_MODE_T trace_mode, void * aData)

void
GERBER_PLOTTER::FlashPadCircle(const wxPoint &pos, int diametre,
EDA_DRAW_MODE_T trace_mode, void *aData) override

Filled circular flashes are stored as apertures. 

Definition at line 11629 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.FlashPadCustom (   self,
  aPadPos,
  aSize,
  aPolygons,
  aTraceMode,
  aData 
)
FlashPadCustom(GERBER_PLOTTER self, wxPoint aPadPos, wxSize aSize, SHAPE_POLY_SET * aPolygons, EDA_DRAW_MODE_T aTraceMode, void * aData)

void
GERBER_PLOTTER::FlashPadCustom(const wxPoint &aPadPos, const wxSize
&aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void
*aData) override

virtual function FlashPadCustom

Parameters:
-----------

aPadPos:  Position of the shape (center of the rectangle

aSize:  = size of round reference pad

aPolygons:  the shape as polygon set

aTraceMode:  FILLED or SKETCH

aData:  an auxiliary info (mainly for gerber format) 

Definition at line 11687 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.FlashPadOval (   self,
  pos,
  size,
  orient,
  trace_mode,
  aData 
)
FlashPadOval(GERBER_PLOTTER self, wxPoint pos, wxSize size, double orient, EDA_DRAW_MODE_T trace_mode, void * aData)

void
GERBER_PLOTTER::FlashPadOval(const wxPoint &pos, const wxSize &size,
double orient, EDA_DRAW_MODE_T trace_mode, void *aData) override

Filled oval flashes are handled as aperture in the 90 degree positions
only. 

Definition at line 11642 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.FlashPadRect (   self,
  pos,
  size,
  orient,
  trace_mode,
  aData 
)
FlashPadRect(GERBER_PLOTTER self, wxPoint pos, wxSize size, double orient, EDA_DRAW_MODE_T trace_mode, void * aData)

void
GERBER_PLOTTER::FlashPadRect(const wxPoint &pos, const wxSize &size,
double orient, EDA_DRAW_MODE_T trace_mode, void *aData) override

Filled rect flashes are handled as aperture in the 0 90 180 or 270
degree orientation only and as polygon for other orientations TODO:
always use flashed shapes (aperture macros) 

Definition at line 11656 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.FlashPadRoundRect (   self,
  aPadPos,
  aSize,
  aCornerRadius,
  aOrient,
  aTraceMode,
  aData 
)
FlashPadRoundRect(GERBER_PLOTTER self, wxPoint aPadPos, wxSize aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void * aData)

void
GERBER_PLOTTER::FlashPadRoundRect(const wxPoint &aPadPos, const wxSize
&aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode,
void *aData) override

Roundrect pad at the moment are not handled as aperture, since they
require aperture macros TODO: always use flashed shapes (aperture
macros) 

Definition at line 11671 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.FlashPadTrapez (   self,
  aPadPos,
  aCorners,
  aPadOrient,
  aTrace_Mode,
  aData 
)
FlashPadTrapez(GERBER_PLOTTER self, wxPoint aPadPos, wxPoint aCorners, double aPadOrient, EDA_DRAW_MODE_T aTrace_Mode, void * aData)

void
GERBER_PLOTTER::FlashPadTrapez(const wxPoint &aPadPos, const wxPoint
*aCorners, double aPadOrient, EDA_DRAW_MODE_T aTrace_Mode, void
*aData) override

Trapezoidal pad at the moment are never handled as aperture, since
they require aperture macros TODO: always use flashed shapes (aperture
macros) 

Definition at line 11714 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.GetDefaultFileExtension ( )
GetDefaultFileExtension() -> wxString

Definition at line 11336 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.GetPlotterType (   self)
GetPlotterType(GERBER_PLOTTER self) -> PlotFormat

virtual
PlotFormat GERBER_PLOTTER::GetPlotterType() const override

Returns the effective plot engine in use.

It's not very OO but for now is required since some things are only
done with some output devices (like drill marks, emitted only for
postscript 

Definition at line 11320 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.PenTo (   self,
  pos,
  plume 
)
PenTo(GERBER_PLOTTER self, wxPoint pos, char plume)

void
GERBER_PLOTTER::PenTo(const wxPoint &pos, char plume) override

moveto/lineto primitive, moves the 'pen' to the specified direction

Parameters:
-----------

pos:  is the target position

plume:  specifies the kind of motion: 'U' only moves the pen, 'D' draw
a line from the current position and 'Z' finish the drawing and
returns the 'pen' to rest (flushes the trace) 

Definition at line 11555 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.PlotPoly (   self,
  args 
)
PlotPoly(GERBER_PLOTTER self, wxPoint_Vector aCornerList, FILL_T aFill, int aWidth, void * aData=None)
PlotPoly(GERBER_PLOTTER self, wxPoint_Vector aCornerList, FILL_T aFill, int aWidth)
PlotPoly(GERBER_PLOTTER self, wxPoint_Vector aCornerList, FILL_T aFill)

void
GERBER_PLOTTER::PlotPoly(const std::vector< wxPoint > &aCornerList,
FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)
override

Gerber polygon: they can (and should) be filled with the appropriate
G36/G37 sequence. 

Definition at line 11538 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.Rect (   self,
  args 
)
Rect(GERBER_PLOTTER self, wxPoint p1, wxPoint p2, FILL_T fill, int width)
Rect(GERBER_PLOTTER self, wxPoint p1, wxPoint p2, FILL_T fill)

void
GERBER_PLOTTER::Rect(const wxPoint &p1, const wxPoint &p2, FILL_T
fill, int width=USE_DEFAULT_LINE_WIDTH) override 

Definition at line 11454 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.SetColor (   self,
  color 
)
SetColor(GERBER_PLOTTER self, COLOR4D color)

virtual void
GERBER_PLOTTER::SetColor(COLOR4D color) override 

Definition at line 11418 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.SetCurrentLineWidth (   self,
  width,
  aData = None 
)
SetCurrentLineWidth(GERBER_PLOTTER self, int width, void * aData=None)
SetCurrentLineWidth(GERBER_PLOTTER self, int width)

void
GERBER_PLOTTER::SetCurrentLineWidth(int width, void *aData=NULL)
override

Set the line width for the next drawing.

Parameters:
-----------

width:  is specified in IUs

aData:  is an auxiliary parameter, mainly used in gerber plotter 

Definition at line 11367 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.SetDash (   self,
  dashed 
)
SetDash(GERBER_PLOTTER self, bool dashed)

virtual void
GERBER_PLOTTER::SetDash(bool dashed) override 

Definition at line 11408 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.SetDefaultLineWidth (   self,
  width 
)
SetDefaultLineWidth(GERBER_PLOTTER self, int width)

void
GERBER_PLOTTER::SetDefaultLineWidth(int width) override

Set the default line width.

Used at the beginning and when a width of -1 (USE_DEFAULT_LINE_WIDTH)
is requested.

Parameters:
-----------

width:  is specified in IUs 

Definition at line 11388 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.SetGerberCoordinatesFormat (   self,
  aResolution,
  aUseInches = False 
)
SetGerberCoordinatesFormat(GERBER_PLOTTER self, int aResolution, bool aUseInches=False)
SetGerberCoordinatesFormat(GERBER_PLOTTER self, int aResolution)

void GERBER_PLOTTER::SetGerberCoordinatesFormat(int aResolution, bool
aUseInches=false) override

Function SetGerberCoordinatesFormat selection of Gerber units and
resolution (number of digits in mantissa)

Parameters:
-----------

aResolution:  = number of digits in mantissa of coordinate use 5 or 6
for mm and 6 or 7 for inches do not use value > 6 (mm) or > 7 (in) to
avoid overflow

aUseInches:  = true to use inches, false to use mm (default)

Should be called only after SetViewport() is called 

Definition at line 11743 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.SetLayerPolarity (   self,
  aPositive 
)
SetLayerPolarity(GERBER_PLOTTER self, bool aPositive)

void
GERBER_PLOTTER::SetLayerPolarity(bool aPositive) override

Change the plot polarity and begin a new layer Used to 'scratch off'
silk screen away from solder mask. 

Definition at line 11730 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.SetViewport (   self,
  aOffset,
  aIusPerDecimil,
  aScale,
  aMirror 
)
SetViewport(GERBER_PLOTTER self, wxPoint aOffset, double aIusPerDecimil, double aScale, bool aMirror)

void
GERBER_PLOTTER::SetViewport(const wxPoint &aOffset, double
aIusPerDecimil, double aScale, bool aMirror) override

Set the plot offset and scaling for the current plot.

Parameters:
-----------

aOffset:  is the plot offset

aIusPerDecimil:  gives the scaling factor from IUs to device units

aScale:  is the user set plot scaling factor (either explicitly or
using 'fit to A4')

aMirror:  flips the plot in the Y direction (useful for toner
transfers or some kind of film) 

Definition at line 11428 of file pcbnew.py.

Here is the caller graph for this function:

def pcbnew.GERBER_PLOTTER.StartBlock (   self,
  aData 
)
StartBlock(GERBER_PLOTTER self, void * aData)

void
GERBER_PLOTTER::StartBlock(void *aData) override

calling this function allows to define the beginning of a group of
drawing items (used in X2 format with netlist attributes)

Parameters:
-----------

aData:  can define any parameter 

Definition at line 11788 of file pcbnew.py.

Here is the caller graph for this function:

def pcbnew.GERBER_PLOTTER.StartPlot (   self)
StartPlot(GERBER_PLOTTER self) -> bool

bool
GERBER_PLOTTER::StartPlot() override

Function StartPlot Write GERBER header to file initialize global
variable g_Plot_PlotOutputFile. 

Definition at line 11344 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.Text (   self,
  aPos,
  aColor,
  aText,
  aOrient,
  aSize,
  aH_justify,
  aV_justify,
  aWidth,
  aItalic,
  aBold,
  aMultilineAllowed = False,
  aData = None 
)
Text(GERBER_PLOTTER self, wxPoint aPos, COLOR4D aColor, wxString aText, double aOrient, wxSize aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=False, void * aData=None)
Text(GERBER_PLOTTER self, wxPoint aPos, COLOR4D aColor, wxString aText, double aOrient, wxSize aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=False)
Text(GERBER_PLOTTER self, wxPoint aPos, COLOR4D aColor, wxString aText, double aOrient, wxSize aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold)

void
GERBER_PLOTTER::Text(const wxPoint &aPos, const COLOR4D aColor, const
wxString &aText, double aOrient, const wxSize &aSize, enum
EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false,
void *aData=NULL) override

Draws text with the plotter.

Function PLOTTER::Text same as DrawGraphicText, but plot graphic text
insteed of draw it.

For convenience it accept the color to use for specific plotters
(GERBER) aData is used to pass extra parameters

Parameters:
-----------

aPos:  = text position (according to aH_justify, aV_justify)

aColor:  (COLOR4D) = text color

aText:  = text to draw

aOrient:  = angle in 0.1 degree

aSize:  = text size (size.x or size.y can be < 0 for mirrored texts)

aH_justify:  = horizontal justification (Left, center, right)

aV_justify:  = vertical justification (bottom, center, top)

aWidth:  = line width (pen width) (default = 0) if width < 0 : draw
segments in sketch mode, width = abs(width) Use a value min(aSize.x,
aSize.y) / 5 for a bold text

aItalic:  = true to simulate an italic font

aBold:  = true to use a bold font Useful only with default width value
(aWidth = 0)

aMultilineAllowed:  = true to plot text as multiline, otherwise single
line 

Definition at line 11576 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.ThickArc (   self,
  centre,
  StAngle,
  EndAngle,
  rayon,
  width,
  tracemode,
  aData 
)
ThickArc(GERBER_PLOTTER self, wxPoint centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void * aData)

void
GERBER_PLOTTER::ThickArc(const wxPoint &centre, double StAngle, double
EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void
*aData) override 

Definition at line 11504 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.ThickCircle (   self,
  pos,
  diametre,
  width,
  tracemode,
  aData 
)
ThickCircle(GERBER_PLOTTER self, wxPoint pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void * aData)

void
GERBER_PLOTTER::ThickCircle(const wxPoint &pos, int diametre, int
width, EDA_DRAW_MODE_T tracemode, void *aData) override 

Definition at line 11527 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.ThickRect (   self,
  p1,
  p2,
  width,
  tracemode,
  aData 
)
ThickRect(GERBER_PLOTTER self, wxPoint p1, wxPoint p2, int width, EDA_DRAW_MODE_T tracemode, void * aData)

void
GERBER_PLOTTER::ThickRect(const wxPoint &p1, const wxPoint &p2, int
width, EDA_DRAW_MODE_T tracemode, void *aData) override 

Definition at line 11516 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.ThickSegment (   self,
  start,
  end,
  width,
  tracemode,
  aData 
)
ThickSegment(GERBER_PLOTTER self, wxPoint start, wxPoint end, int width, EDA_DRAW_MODE_T tracemode, void * aData)

void
GERBER_PLOTTER::ThickSegment(const wxPoint &start, const wxPoint &end,
int width, EDA_DRAW_MODE_T tracemode, void *aData) override 

Definition at line 11493 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.UseX2Attributes (   self,
  aEnable 
)
UseX2Attributes(GERBER_PLOTTER self, bool aEnable)

void
GERBER_PLOTTER::UseX2Attributes(bool aEnable) 

Definition at line 11768 of file pcbnew.py.

def pcbnew.GERBER_PLOTTER.UseX2NetAttributes (   self,
  aEnable 
)
UseX2NetAttributes(GERBER_PLOTTER self, bool aEnable)

void
GERBER_PLOTTER::UseX2NetAttributes(bool aEnable) 

Definition at line 11778 of file pcbnew.py.

Member Data Documentation

tuple pcbnew.GERBER_PLOTTER.GetDefaultFileExtension = staticmethod(GetDefaultFileExtension)
static

Definition at line 11341 of file pcbnew.py.

pcbnew.GERBER_PLOTTER.this

Definition at line 11318 of file pcbnew.py.


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