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

Public Member Functions

def __init__ (self)
 
def GetPlotterType (self)
 
def GetDefaultFileExtension ()
 
def OpenFile (self, aFullFilename)
 
def StartPlot (self)
 
def EndPlot (self)
 
def StartPage (self)
 
def ClosePage (self)
 
def SetCurrentLineWidth
 
def SetDash (self, dashed)
 
def SetPageSettings (self, aPageSettings)
 
def SetViewport (self, aOffset, aIusPerDecimil, aScale, aMirror)
 
def Rect (self, args)
 
def Circle (self, args)
 
def Arc (self, args)
 
def PlotPoly (self, args)
 
def PenTo (self, pos, plume)
 
def Text
 
def PlotImage (self, aImage, aPos, aScaleFactor)
 
- Public Member Functions inherited from pcbnew.PSLIKE_PLOTTER
def __init__ (self, args, kwargs)
 
def SetTextMode (self, mode)
 
def SetDefaultLineWidth (self, width)
 
def SetScaleAdjust (self, scaleX, scaleY)
 
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 SetColor (self, color)
 
- 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: class_plotter.h 

Definition at line 12246 of file pcbnew.py.

Constructor & Destructor Documentation

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

PDF_PLOTTER::PDF_PLOTTER() 

Definition at line 12258 of file pcbnew.py.

Member Function Documentation

def pcbnew.PDF_PLOTTER.Arc (   self,
  args 
)
Arc(PDF_PLOTTER self, wxPoint centre, double StAngle, double EndAngle, int rayon, FILL_T fill, int width)
Arc(PDF_PLOTTER self, wxPoint centre, double StAngle, double EndAngle, int rayon, FILL_T fill)

void PDF_PLOTTER::Arc(const
wxPoint &centre, double StAngle, double EndAngle, int rayon, FILL_T
fill, int width=USE_DEFAULT_LINE_WIDTH) override

The PDF engine can't directly plot arcs, it uses the base emulation.

So no filled arcs (not a great loss... ) 

Definition at line 12467 of file pcbnew.py.

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

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

Circle drawing for PDF.

They're approximated by curves, but fill is supported 

Definition at line 12451 of file pcbnew.py.

def pcbnew.PDF_PLOTTER.ClosePage (   self)
ClosePage(PDF_PLOTTER self)

void
PDF_PLOTTER::ClosePage()

Close the current page in the PDF document (and emit its compressed
stream) 

Definition at line 12352 of file pcbnew.py.

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

bool
PDF_PLOTTER::EndPlot() override 

Definition at line 12330 of file pcbnew.py.

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

Definition at line 12286 of file pcbnew.py.

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

virtual
PlotFormat PDF_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 12270 of file pcbnew.py.

def pcbnew.PDF_PLOTTER.OpenFile (   self,
  aFullFilename 
)
OpenFile(PDF_PLOTTER self, wxString aFullFilename) -> bool

bool
PDF_PLOTTER::OpenFile(const wxString &aFullFilename) override

Open or create the plot file aFullFilename.

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

aFullFilename:  = the full file name of the file to create

true if success, false if the file cannot be created/opened  The base
class open the file in text mode, so we should have this function
overlaid for PDF files, which are binary files 

Definition at line 12294 of file pcbnew.py.

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

void
PDF_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 12511 of file pcbnew.py.

def pcbnew.PDF_PLOTTER.PlotImage (   self,
  aImage,
  aPos,
  aScaleFactor 
)
PlotImage(PDF_PLOTTER self, wxImage const & aImage, wxPoint aPos, double aScaleFactor)

void
PDF_PLOTTER::PlotImage(const wxImage &aImage, const wxPoint &aPos,
double aScaleFactor) override

PDF images are handles as inline, not XObject streams... 

Definition at line 12588 of file pcbnew.py.

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

void
PLOTTER::PlotPoly(const SHAPE_LINE_CHAIN &aCornerList, FILL_T aFill,
int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)

Function PlotPoly.

Draw a polygon ( filled or not )

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

aCornerList:  = corners list (a SHAPE_LINE_CHAIN)

aFill:  = type of fill

aWidth:  = line width

aData:  an auxiliary info (mainly for gerber format) 

Definition at line 12483 of file pcbnew.py.

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

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

Rectangles in PDF.

Supported by the native operator 

Definition at line 12435 of file pcbnew.py.

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

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

Pen width setting for PDF.

Since the specs explicitly says that a 0 width is a bad thing to use
(since it results in 1 pixel traces), we convert such requests to the
minimal width (like 1) Note pen width = 0 is used in plot polygons to
plot filled polygons with no outline thickness use in this case pen
width = 1 does not actally change the polygon 

Definition at line 12365 of file pcbnew.py.

Here is the caller graph for this function:

def pcbnew.PDF_PLOTTER.SetDash (   self,
  dashed 
)
SetDash(PDF_PLOTTER self, int dashed)

void
PDF_PLOTTER::SetDash(int dashed) override

PDF supports dashed lines. 

Definition at line 12384 of file pcbnew.py.

def pcbnew.PDF_PLOTTER.SetPageSettings (   self,
  aPageSettings 
)
SetPageSettings(PDF_PLOTTER self, PAGE_INFO const & aPageSettings)

void
PDF_PLOTTER::SetPageSettings(const PAGE_INFO &aPageSettings) override

PDF can have multiple pages, so SetPageSettings can be called with the
outputFile open (but not inside a page stream!) 

Definition at line 12396 of file pcbnew.py.

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

void
PDF_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 12409 of file pcbnew.py.

def pcbnew.PDF_PLOTTER.StartPage (   self)
StartPage(PDF_PLOTTER self)

void
PDF_PLOTTER::StartPage()

Starts a new page in the PDF document. 

Definition at line 12340 of file pcbnew.py.

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

bool
PDF_PLOTTER::StartPlot() override

The PDF engine supports multiple pages; the first one is opened 'for
free' the following are to be closed and reopened.

Between each page parameters can be set 

Definition at line 12315 of file pcbnew.py.

def pcbnew.PDF_PLOTTER.Text (   self,
  aPos,
  aColor,
  aText,
  aOrient,
  aSize,
  aH_justify,
  aV_justify,
  aWidth,
  aItalic,
  aBold,
  aMultilineAllowed = False,
  aData = None 
)
Text(PDF_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(PDF_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(PDF_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
PDF_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

aData:  = a parameter used by some plotters in SetCurrentLineWidth(),
not directly used here. 

Definition at line 12532 of file pcbnew.py.

Member Data Documentation

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

Definition at line 12291 of file pcbnew.py.

pcbnew.PDF_PLOTTER.this

Definition at line 12268 of file pcbnew.py.


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