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

Public Member Functions

def __init__ (self)
 
def GetPlotterType (self)
 
def GetDefaultFileExtension ()
 
def SetTextMode (self, mode)
 
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 PlotPoly (self, args)
 
def ThickSegment (self, start, end, width, tracemode, aData)
 
def Arc (self, args)
 
def PenTo (self, pos, plume)
 
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, aTraceMode, aData)
 
def Text
 
- 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 13457 of file pcbnew.py.

Constructor & Destructor Documentation

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

DXF_PLOTTER::DXF_PLOTTER() 

Definition at line 13469 of file pcbnew.py.

Member Function Documentation

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

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

Generic fallback: arc rendered as a polyline. 

Definition at line 13681 of file pcbnew.py.

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

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

DXF circle: full functionality; it even does 'fills' drawing a circle
with a dual-arc polyline wide as the radius.

I could use this trick to do other filled primitives 

Definition at line 13633 of file pcbnew.py.

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

bool
DXF_PLOTTER::EndPlot() override 

Definition at line 13529 of file pcbnew.py.

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

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

DXF round pad: always done in sketch mode; it could be filled but it
isn't pretty if other kinds of pad aren't... 

Definition at line 13716 of file pcbnew.py.

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

void
DXF_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 attributes) 

Definition at line 13785 of file pcbnew.py.

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

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

DXF oval pad: always done in sketch mode. 

Definition at line 13730 of file pcbnew.py.

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

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

DXF rectangular pad: alwayd done in sketch mode. 

Definition at line 13743 of file pcbnew.py.

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

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

virtual function FlashPadRoundRect

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

aPadPos:  Position of the shape (center of the rectangle

aSize:  = size of rounded rect

aCornerRadius:  Radius of the rounded corners

aOrient:  The rotation of the shape

aTraceMode:  FILLED or SKETCH

aData:  an auxiliary info (mainly for gerber format attributes) 

Definition at line 13756 of file pcbnew.py.

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

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

DXF trapezoidal pad: only sketch mode is supported. 

Definition at line 13812 of file pcbnew.py.

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

Definition at line 13497 of file pcbnew.py.

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

virtual
PlotFormat DXF_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 13481 of file pcbnew.py.

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

void
DXF_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 13695 of file pcbnew.py.

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

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

DXF polygon: doesn't fill it but at least it close the filled ones DXF
does not know thick outline.

It does not know thhick segments, therefore filled polygons with thick
outline are converted to inflated polygon by aWidth/2 

Definition at line 13650 of file pcbnew.py.

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

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

DXF rectangle: fill not supported. 

Definition at line 13619 of file pcbnew.py.

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

void
DXF_PLOTTER::SetColor(COLOR4D color) override

The DXF exporter handles 'colors' as layers... 

Definition at line 13591 of file pcbnew.py.

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

virtual void
DXF_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 13539 of file pcbnew.py.

Here is the caller graph for this function:

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

void
DXF_PLOTTER::SetDash(bool dashed) override

Dashed lines are not (yet) supported by DXF_PLOTTER. 

Definition at line 13579 of file pcbnew.py.

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

virtual void
DXF_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 13559 of file pcbnew.py.

def pcbnew.DXF_PLOTTER.SetTextMode (   self,
  mode 
)
SetTextMode(DXF_PLOTTER self, PlotTextMode mode)

virtual void
DXF_PLOTTER::SetTextMode(PlotTextMode mode) override

DXF handles NATIVE text emitting TEXT entities. 

Definition at line 13505 of file pcbnew.py.

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

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

Set the scale/position for the DXF plot The DXF engine doesn't support
line widths and mirroring.

The output coordinate system is in the first quadrant (in mm) 

Definition at line 13603 of file pcbnew.py.

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

bool
DXF_PLOTTER::StartPlot() override

Opens the DXF plot with a skeleton header. 

Definition at line 13517 of file pcbnew.py.

def pcbnew.DXF_PLOTTER.Text (   self,
  aPos,
  aColor,
  aText,
  aOrient,
  aSize,
  aH_justify,
  aV_justify,
  aWidth,
  aItalic,
  aBold,
  aMultilineAllowed = False,
  aData = None 
)
Text(DXF_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(DXF_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(DXF_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
DXF_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 13826 of file pcbnew.py.

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

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

Definition at line 13670 of file pcbnew.py.

Member Data Documentation

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

Definition at line 13502 of file pcbnew.py.

pcbnew.DXF_PLOTTER.this

Definition at line 13479 of file pcbnew.py.


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