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

Public Member Functions

def __init__ (self, args)
 
def ImportSettings (self, aPoly)
 
def Start (self, layer, x, y, hatch)
 
def AppendCorner (self, x, y)
 
def InsertCorner (self, ic, x, y)
 
def DeleteCorner (self, ic)
 
def MoveCorner (self, ic, x, y)
 
def CloseLastContour (self)
 
def RemoveContour (self, icont)
 
def IsPolygonSelfIntersecting (self)
 
def Chamfer (self, aDistance)
 
def Fillet (self, aRadius, aSegments)
 
def RemoveNullSegments (self)
 
def RemoveAllContours (self)
 
def UnHatch (self)
 
def Hatch (self)
 
def MoveOrigin (self, x_off, y_off)
 
def GetBoundingBox (self, args)
 
def Copy (self, src)
 
def TestPointInside (self, x, y)
 
def IsCutoutContour (self, aCornerIdx)
 
def AppendArc (self, xi, yi, xf, yf, xc, yc, num)
 
def SetLayer (self, aLayer)
 
def GetLayer (self)
 
def GetCornersCount (self)
 
def GetClosed (self)
 
def GetContoursCount (self)
 
def GetContour (self, ic)
 
def GetContourStart (self, icont)
 
def GetContourEnd (self, icont)
 
def GetContourSize (self, icont)
 
def GetX (self, ic)
 
def GetY (self, ic)
 
def IsEndContour (self, ic)
 
def GetPos (self, ic)
 
def GetHatchPitch (self)
 
def GetDefaultHatchPitchMils ()
 
def GetHatchStyle (self)
 
def SetHatch (self, aHatchStyle, aHatchPitch, aRebuildHatch)
 
def SetX (self, ic, x)
 
def SetY (self, ic, y)
 
def SetHatchStyle (self, style)
 
def SetHatchPitch (self, pitch)
 
def NormalizeAreaOutlines (self, aNewPolygonList)
 
def AppendBezier (self, args)
 
def Distance (self, args)
 
def HitTestForEdge (self, aPos, aDistMax)
 
def HitTestForCorner (self, aPos, aDistMax)
 

Public Attributes

 this
 

Static Public Attributes

 NO_HATCH = _pcbnew.CPolyLine_NO_HATCH
 
 DIAGONAL_FULL = _pcbnew.CPolyLine_DIAGONAL_FULL
 
 DIAGONAL_EDGE = _pcbnew.CPolyLine_DIAGONAL_EDGE
 
tuple GetDefaultHatchPitchMils = staticmethod(GetDefaultHatchPitchMils)
 
tuple m_CornersList = _swig_property(_pcbnew.CPolyLine_m_CornersList_get, _pcbnew.CPolyLine_m_CornersList_set)
 

Detailed Description

C++ includes: PolyLine.h 

Definition at line 5694 of file pcbnew.py.

Constructor & Destructor Documentation

def pcbnew.CPolyLine.__init__ (   self,
  args 
)
__init__(CPolyLine self) -> CPolyLine
__init__(CPolyLine self, CPolyLine aCPolyLine) -> CPolyLine

CPolyLine::CPolyLine(const CPolyLine &aCPolyLine) 

Definition at line 5705 of file pcbnew.py.

Member Function Documentation

def pcbnew.CPolyLine.AppendArc (   self,
  xi,
  yi,
  xf,
  yf,
  xc,
  yc,
  num 
)
AppendArc(CPolyLine self, int xi, int yi, int xf, int yf, int xc, int yc, int num)

void
CPolyLine::AppendArc(int xi, int yi, int xf, int yf, int xc, int yc,
int num)

Function AppendArc.

Adds segments to current contour to approximate the given arc 

Definition at line 6007 of file pcbnew.py.

def pcbnew.CPolyLine.AppendBezier (   self,
  args 
)
AppendBezier(CPolyLine self, int x1, int y1, int x2, int y2, int x3, int y3)
AppendBezier(CPolyLine self, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)

void
CPolyLine::AppendBezier(int x1, int y1, int x2, int y2, int x3, int
y3, int x4, int y4) 

Definition at line 6306 of file pcbnew.py.

def pcbnew.CPolyLine.AppendCorner (   self,
  x,
  y 
)
AppendCorner(CPolyLine self, int x, int y)

void
CPolyLine::AppendCorner(int x, int y) 

Definition at line 5748 of file pcbnew.py.

def pcbnew.CPolyLine.Chamfer (   self,
  aDistance 
)
Chamfer(CPolyLine self, unsigned int aDistance) -> CPolyLine

CPolyLine *
CPolyLine::Chamfer(unsigned int aDistance)

Function Chamfer returns a chamfered version of a polygon.

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

aDistance:  is the chamfering distance.

CPolyLine* - Pointer to new polygon. 

Definition at line 5856 of file pcbnew.py.

def pcbnew.CPolyLine.CloseLastContour (   self)
CloseLastContour(CPolyLine self)

void
CPolyLine::CloseLastContour()

function CloseLastContour Set the .end_contour member of the last
corner of the last contour to true 

Definition at line 5808 of file pcbnew.py.

def pcbnew.CPolyLine.Copy (   self,
  src 
)
Copy(CPolyLine self, CPolyLine src)

void CPolyLine::Copy(const
CPolyLine *src) 

Definition at line 5974 of file pcbnew.py.

def pcbnew.CPolyLine.DeleteCorner (   self,
  ic 
)
DeleteCorner(CPolyLine self, int ic)

void
CPolyLine::DeleteCorner(int ic)

Function DeleteCorner remove the given corner.

if it is the last point of a contour keep the controur closed by
modifying the previous corner

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

ic:  = the index of the corner to delete 

Definition at line 5778 of file pcbnew.py.

def pcbnew.CPolyLine.Distance (   self,
  args 
)
Distance(CPolyLine self, wxPoint aPoint) -> int
Distance(CPolyLine self, wxPoint aStart, wxPoint aEnd, int aWidth) -> int

int
CPolyLine::Distance(wxPoint aStart, wxPoint aEnd, int aWidth)

Function Distance Calculates the distance between a segment and the
zone:

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

aStart:  the starting point of the segment.

aEnd:  the ending point of the segment.

aWidth:  the width of the segment.

int = distance between the segment and outline. 0 if segment
intersects or is inside 

Definition at line 6318 of file pcbnew.py.

def pcbnew.CPolyLine.Fillet (   self,
  aRadius,
  aSegments 
)
Fillet(CPolyLine self, unsigned int aRadius, unsigned int aSegments) -> CPolyLine

CPolyLine *
CPolyLine::Fillet(unsigned int aRadius, unsigned int aSegments)

Function Fillet returns a filleted version of a polygon.

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

aRadius:  is the fillet radius.

aSegments:  is the number of segments / fillet.

CPolyLine* - Pointer to new polygon. 

Definition at line 5875 of file pcbnew.py.

def pcbnew.CPolyLine.GetBoundingBox (   self,
  args 
)
GetBoundingBox(CPolyLine self) -> EDA_RECT
GetBoundingBox(CPolyLine self, int icont) -> EDA_RECT

const EDA_RECT
CPolyLine::GetBoundingBox(int icont)

the bounding box of a given polygon

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

icont:  = the index of the polygon contour (0 = main contour, 1 ... n
= other contours, usually holes) 

Definition at line 5955 of file pcbnew.py.

def pcbnew.CPolyLine.GetClosed (   self)
GetClosed(CPolyLine self) -> bool

bool
CPolyLine::GetClosed()

true if the last corner in corners list is flagged end_contour 

Definition at line 6052 of file pcbnew.py.

def pcbnew.CPolyLine.GetContour (   self,
  ic 
)
GetContour(CPolyLine self, int ic) -> int

int
CPolyLine::GetContour(int ic)

Function GetContour.

the contour number containing the corner ic

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

ic:  = the index of the corner in the corner list 

Definition at line 6079 of file pcbnew.py.

def pcbnew.CPolyLine.GetContourEnd (   self,
  icont 
)
GetContourEnd(CPolyLine self, int icont) -> int

int
CPolyLine::GetContourEnd(int icont)

Function GetContourEnd.

the index of the last corner (in corners list) of a contour

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

icont:  = the index of the contour 

Definition at line 6117 of file pcbnew.py.

def pcbnew.CPolyLine.GetContoursCount (   self)
GetContoursCount(CPolyLine self) -> int

int
CPolyLine::GetContoursCount() const

Function GetContoursCount.

the number of polygons stored in list (number of corners flagged
"end_contour" 

Definition at line 6064 of file pcbnew.py.

def pcbnew.CPolyLine.GetContourSize (   self,
  icont 
)
GetContourSize(CPolyLine self, int icont) -> int

int
CPolyLine::GetContourSize(int icont)

Function GetContourSize.

the corners count of a contour

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

icont:  = the index of the contour 

Definition at line 6136 of file pcbnew.py.

def pcbnew.CPolyLine.GetContourStart (   self,
  icont 
)
GetContourStart(CPolyLine self, int icont) -> int

int
CPolyLine::GetContourStart(int icont)

Function GetContourStart.

the index of the first corner (in corners list) of a contour

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

icont:  = the index of the contour 

Definition at line 6098 of file pcbnew.py.

def pcbnew.CPolyLine.GetCornersCount (   self)
GetCornersCount(CPolyLine self) -> int

int
CPolyLine::GetCornersCount() const 

Definition at line 6042 of file pcbnew.py.

def pcbnew.CPolyLine.GetDefaultHatchPitchMils ( )
GetDefaultHatchPitchMils() -> int

Definition at line 6214 of file pcbnew.py.

def pcbnew.CPolyLine.GetHatchPitch (   self)
GetHatchPitch(CPolyLine self) -> int

int
CPolyLine::GetHatchPitch() const 

Definition at line 6204 of file pcbnew.py.

def pcbnew.CPolyLine.GetHatchStyle (   self)
GetHatchStyle(CPolyLine self) -> enum CPolyLine::HATCH_STYLE

enum HATCH_STYLE
CPolyLine::GetHatchStyle() const 

Definition at line 6222 of file pcbnew.py.

def pcbnew.CPolyLine.GetLayer (   self)
GetLayer(CPolyLine self) -> LAYER_NUM

LAYER_NUM
CPolyLine::GetLayer() const 

Definition at line 6032 of file pcbnew.py.

def pcbnew.CPolyLine.GetPos (   self,
  ic 
)
GetPos(CPolyLine self, int ic) -> wxPoint

const wxPoint&
CPolyLine::GetPos(int ic) const 

Definition at line 6194 of file pcbnew.py.

def pcbnew.CPolyLine.GetX (   self,
  ic 
)
GetX(CPolyLine self, int ic) -> int

int CPolyLine::GetX(int ic)
const 

Definition at line 6155 of file pcbnew.py.

def pcbnew.CPolyLine.GetY (   self,
  ic 
)
GetY(CPolyLine self, int ic) -> int

int CPolyLine::GetY(int ic)
const 

Definition at line 6165 of file pcbnew.py.

def pcbnew.CPolyLine.Hatch (   self)
Hatch(CPolyLine self)

void CPolyLine::Hatch() 

Definition at line 5936 of file pcbnew.py.

def pcbnew.CPolyLine.HitTestForCorner (   self,
  aPos,
  aDistMax 
)
HitTestForCorner(CPolyLine self, wxPoint aPos, int aDistMax) -> int

int
CPolyLine::HitTestForCorner(const wxPoint &aPos, int aDistMax) const

Function HitTestForCorner test is the point aPos is near (< aDistMax )
a corner.

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

aPos:  = the reference point

aDistMax:  = the max distance between a vertex and the corner

int = the index of corner of the, or -1 if not found. 

Definition at line 6367 of file pcbnew.py.

def pcbnew.CPolyLine.HitTestForEdge (   self,
  aPos,
  aDistMax 
)
HitTestForEdge(CPolyLine self, wxPoint aPos, int aDistMax) -> int

int
CPolyLine::HitTestForEdge(const wxPoint &aPos, int aDistMax) const

Function HitTestForEdge test is the point aPos is near (< aDistMax ) a
vertex.

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

aPos:  = the reference point

aDistMax:  = the max distance between a vertex and the reference point

int = the index of the first corner of the vertex, or -1 if not found.

Definition at line 6344 of file pcbnew.py.

def pcbnew.CPolyLine.ImportSettings (   self,
  aPoly 
)
ImportSettings(CPolyLine self, CPolyLine aPoly)

void
CPolyLine::ImportSettings(const CPolyLine *aPoly)

Function ImportSettings Copy settings (layer, hatch styles) from
aPoly.

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

aPoly:  is the CPolyLine to import settings 

Definition at line 5720 of file pcbnew.py.

def pcbnew.CPolyLine.InsertCorner (   self,
  ic,
  x,
  y 
)
InsertCorner(CPolyLine self, int ic, int x, int y)

void
CPolyLine::InsertCorner(int ic, int x, int y)

Function InsertCorner insert a new corner between two existing
corners.

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

ic:  = index for the insertion point: the corner is inserted AFTER ic

x:  y:  = coordinates corner to insert 

Definition at line 5758 of file pcbnew.py.

def pcbnew.CPolyLine.IsCutoutContour (   self,
  aCornerIdx 
)
IsCutoutContour(CPolyLine self, int aCornerIdx) -> bool

bool
CPolyLine::IsCutoutContour(int aCornerIdx)

true if the corner aCornerIdx is on a hole inside the main outline and
false if it is on the main outline 

Definition at line 5994 of file pcbnew.py.

def pcbnew.CPolyLine.IsEndContour (   self,
  ic 
)
IsEndContour(CPolyLine self, int ic) -> bool

bool
CPolyLine::IsEndContour(int ic) const

Function IsEndContour.

true if a corner is flagged end_contour

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

ic=:  the index (in corners list) of the corner 

Definition at line 6175 of file pcbnew.py.

def pcbnew.CPolyLine.IsPolygonSelfIntersecting (   self)
IsPolygonSelfIntersecting(CPolyLine self) -> bool

bool
CPolyLine::IsPolygonSelfIntersecting()

Function IsPolygonSelfIntersecting Test a CPolyLine for self-
intersection of vertex (all contours).

: false if no intersecting sides true if intersecting sides When a
CPolyLine is self intersectic, it need to be normalized. (converted to
non intersecting polygons) 

Definition at line 5839 of file pcbnew.py.

def pcbnew.CPolyLine.MoveCorner (   self,
  ic,
  x,
  y 
)
MoveCorner(CPolyLine self, int ic, int x, int y)

void
CPolyLine::MoveCorner(int ic, int x, int y) 

Definition at line 5798 of file pcbnew.py.

def pcbnew.CPolyLine.MoveOrigin (   self,
  x_off,
  y_off 
)
MoveOrigin(CPolyLine self, int x_off, int y_off)

void
CPolyLine::MoveOrigin(int x_off, int y_off) 

Definition at line 5945 of file pcbnew.py.

def pcbnew.CPolyLine.NormalizeAreaOutlines (   self,
  aNewPolygonList 
)
NormalizeAreaOutlines(CPolyLine self, std::vector< CPolyLine *,std::allocator< CPolyLine * > > * aNewPolygonList) -> int

int
CPolyLine::NormalizeAreaOutlines(std::vector< CPolyLine * >
*aNewPolygonList)

Function NormalizeAreaOutlines Convert a self-intersecting polygon to
one (or more) non self-intersecting polygon(s) Removes null segments.

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

aNewPolygonList:  = a std::vector<CPolyLine*> reference where to store
new CPolyLine needed by the normalization

the polygon count (always >= 1, because there is at least one polygon)
There are new polygons only if the polygon count is > 1 

Definition at line 6283 of file pcbnew.py.

def pcbnew.CPolyLine.RemoveAllContours (   self)
RemoveAllContours(CPolyLine self)

void
CPolyLine::RemoveAllContours(void)

function RemoveAllContours removes all corners from the list.

Others params are not changed 

Definition at line 5912 of file pcbnew.py.

def pcbnew.CPolyLine.RemoveContour (   self,
  icont 
)
RemoveContour(CPolyLine self, int icont)

void
CPolyLine::RemoveContour(int icont)

Function RemoveContour.

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

icont:  = contour number to remove remove a contour only if there is
more than 1 contour 

Definition at line 5821 of file pcbnew.py.

def pcbnew.CPolyLine.RemoveNullSegments (   self)
RemoveNullSegments(CPolyLine self) -> int

int
CPolyLine::RemoveNullSegments()

Function RemoveNullSegments Removes corners which create a null
segment edge (i.e.

when 2 successive corners are at the same location) the count of
removed corners. 

Definition at line 5896 of file pcbnew.py.

def pcbnew.CPolyLine.SetHatch (   self,
  aHatchStyle,
  aHatchPitch,
  aRebuildHatch 
)
SetHatch(CPolyLine self, int aHatchStyle, int aHatchPitch, bool aRebuildHatch)

void
CPolyLine::SetHatch(int aHatchStyle, int aHatchPitch, bool
aRebuildHatch) 

Definition at line 6232 of file pcbnew.py.

def pcbnew.CPolyLine.SetHatchPitch (   self,
  pitch 
)
SetHatchPitch(CPolyLine self, int pitch)

void
CPolyLine::SetHatchPitch(int pitch) 

Definition at line 6273 of file pcbnew.py.

def pcbnew.CPolyLine.SetHatchStyle (   self,
  style 
)
SetHatchStyle(CPolyLine self, enum CPolyLine::HATCH_STYLE style)

void
CPolyLine::SetHatchStyle(enum HATCH_STYLE style) 

Definition at line 6263 of file pcbnew.py.

def pcbnew.CPolyLine.SetLayer (   self,
  aLayer 
)
SetLayer(CPolyLine self, LAYER_NUM aLayer)

void
CPolyLine::SetLayer(LAYER_NUM aLayer) 

Definition at line 6022 of file pcbnew.py.

def pcbnew.CPolyLine.SetX (   self,
  ic,
  x 
)
SetX(CPolyLine self, int ic, int x)

void CPolyLine::SetX(int ic,
int x) 

Definition at line 6243 of file pcbnew.py.

def pcbnew.CPolyLine.SetY (   self,
  ic,
  y 
)
SetY(CPolyLine self, int ic, int y)

void CPolyLine::SetY(int ic,
int y) 

Definition at line 6253 of file pcbnew.py.

def pcbnew.CPolyLine.Start (   self,
  layer,
  x,
  y,
  hatch 
)
Start(CPolyLine self, LAYER_NUM layer, int x, int y, int hatch)

void
CPolyLine::Start(LAYER_NUM layer, int x, int y, int hatch) 

Definition at line 5738 of file pcbnew.py.

def pcbnew.CPolyLine.TestPointInside (   self,
  x,
  y 
)
TestPointInside(CPolyLine self, int x, int y) -> bool

bool
CPolyLine::TestPointInside(int x, int y) 

Definition at line 5984 of file pcbnew.py.

def pcbnew.CPolyLine.UnHatch (   self)
UnHatch(CPolyLine self)

void CPolyLine::UnHatch()

Definition at line 5926 of file pcbnew.py.

Member Data Documentation

pcbnew.CPolyLine.DIAGONAL_EDGE = _pcbnew.CPolyLine_DIAGONAL_EDGE
static

Definition at line 5703 of file pcbnew.py.

pcbnew.CPolyLine.DIAGONAL_FULL = _pcbnew.CPolyLine_DIAGONAL_FULL
static

Definition at line 5702 of file pcbnew.py.

tuple pcbnew.CPolyLine.GetDefaultHatchPitchMils = staticmethod(GetDefaultHatchPitchMils)
static

Definition at line 6219 of file pcbnew.py.

tuple pcbnew.CPolyLine.m_CornersList = _swig_property(_pcbnew.CPolyLine_m_CornersList_get, _pcbnew.CPolyLine_m_CornersList_set)
static

Definition at line 6391 of file pcbnew.py.

pcbnew.CPolyLine.NO_HATCH = _pcbnew.CPolyLine_NO_HATCH
static

Definition at line 5701 of file pcbnew.py.

pcbnew.CPolyLine.this

Definition at line 5716 of file pcbnew.py.


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