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

Public Member Functions

def __init__ (self, args)
 
def GetRelativeIndices (self, aGlobalIdx, aRelativeIndices)
 
def GetGlobalIndex (self, aRelativeIndices, aGlobalIdx)
 
def Clone (self)
 
def NewOutline (self)
 
def NewHole
 
def AddOutline (self, aOutline)
 
def AddHole
 
def Append (self, args)
 
def InsertVertex (self, aGlobalIndex, aNewVertex)
 
def Vertex (self, args)
 
def CVertex (self, args)
 
def GetNeighbourIndexes (self, aGlobalIndex, aPrevious, aNext)
 
def IsPolygonSelfIntersecting (self, aPolygonIndex)
 
def IsSelfIntersecting (self)
 
def OutlineCount (self)
 
def VertexCount
 
def HoleCount (self, aOutline)
 
def Outline (self, aIndex)
 
def Subset (self, aFirstPolygon, aLastPolygon)
 
def UnitSet (self, aPolygonIndex)
 
def Hole (self, aOutline, aHole)
 
def Polygon (self, aIndex)
 
def COutline (self, aIndex)
 
def CHole (self, aOutline, aHole)
 
def CPolygon (self, aIndex)
 
def Iterate (self, args)
 
def IterateWithHoles (self, args)
 
def CIterate (self, args)
 
def CIterateWithHoles (self, args)
 
def IterateFromVertexWithHoles (self, aGlobalIdx)
 
def IterateSegments (self, args)
 
def IterateSegmentsWithHoles (self, args)
 
def BooleanAdd (self, args)
 
def BooleanSubtract (self, args)
 
def BooleanIntersection (self, args)
 
def Inflate (self, aFactor, aCircleSegmentsCount)
 
def Fracture (self, aFastMode)
 
def HasHoles (self)
 
def Simplify (self, aFastMode)
 
def NormalizeAreaOutlines (self)
 
def Format (self)
 
def Parse (self, aStream)
 
def Move (self, aVector)
 
def IsSolid (self)
 
def BBox
 
def PointOnEdge (self, aP)
 
def Collide (self, args)
 
def CollideVertex
 
def CollideEdge
 
def Contains
 
def IsEmpty (self)
 
def RemoveVertex (self, args)
 
def RemoveAllContours (self)
 
def RemoveContour
 
def RemoveNullSegments (self)
 
def TotalVertices (self)
 
def DeletePolygon (self, aIdx)
 
def ChamferPolygon
 
def FilletPolygon
 
def Chamfer (self, aDistance)
 
def Fillet (self, aRadius, aSegments)
 
def DistanceToPolygon (self, args)
 
def Distance (self, args)
 
def IsVertexInHole (self, aGlobalIdx)
 
- Public Member Functions inherited from pcbnew.SHAPE
def __init__ (self, args, kwargs)
 
def Type (self)
 
def Clone (self)
 
def Collide (self, args)
 
def BBox
 
def Centre (self)
 
def Move (self, aVector)
 
def IsSolid (self)
 
def Parse (self, aStream)
 
def Format (self)
 

Public Attributes

 this
 

Static Public Attributes

 PM_FAST = _pcbnew.SHAPE_POLY_SET_PM_FAST
 
 PM_STRICTLY_SIMPLE = _pcbnew.SHAPE_POLY_SET_PM_STRICTLY_SIMPLE
 

Detailed Description

Class SHAPE_POLY_SET.

Represents a set of closed polygons. Polygons may be nonconvex, self-
intersecting and have holes. Provides boolean operations (using
Clipper library as the backend).

Let us define the terms used on this class to clarify methods names
and comments: Polygon: each polygon in the set.

Outline: first polyline in each polygon; represents its outer contour.

Hole: second and following polylines in the polygon.

Contour: each polyline of each polygon in the set, whether or not it
is an outline or a hole.

Vertex (or corner): each one of the points that define a contour.

TODO: add convex partitioning & spatial index

C++ includes: shape_poly_set.h 

Definition at line 6596 of file pcbnew.py.

Constructor & Destructor Documentation

def pcbnew.SHAPE_POLY_SET.__init__ (   self,
  args 
)
__init__(SHAPE_POLY_SET self) -> SHAPE_POLY_SET
__init__(SHAPE_POLY_SET self, SHAPE_POLY_SET aOther) -> SHAPE_POLY_SET

SHAPE_POLY_SET::SHAPE_POLY_SET(const SHAPE_POLY_SET &aOther)

Copy constructor SHAPE_POLY_SET Performs a deep copy of aOther into
this.

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

aOther:  is the SHAPE_POLY_SET object that will be copied. 

Definition at line 6632 of file pcbnew.py.

Member Function Documentation

def pcbnew.SHAPE_POLY_SET.AddHole (   self,
  aHole,
  aOutline = -1 
)
AddHole(SHAPE_POLY_SET self, SHAPE_LINE_CHAIN const & aHole, int aOutline=-1) -> int
AddHole(SHAPE_POLY_SET self, SHAPE_LINE_CHAIN const & aHole) -> int

int
SHAPE_POLY_SET::AddHole(const SHAPE_LINE_CHAIN &aHole, int
aOutline=-1)

Adds a new hole to the given outline (default: last) and returns its
index 

Definition at line 6765 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.AddOutline (   self,
  aOutline 
)
AddOutline(SHAPE_POLY_SET self, SHAPE_LINE_CHAIN const & aOutline) -> int

int
SHAPE_POLY_SET::AddOutline(const SHAPE_LINE_CHAIN &aOutline)

Adds a new outline to the set and returns its index 

Definition at line 6753 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Append (   self,
  args 
)
Append(SHAPE_POLY_SET self, int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=False) -> int
Append(SHAPE_POLY_SET self, int x, int y, int aOutline=-1, int aHole=-1) -> int
Append(SHAPE_POLY_SET self, int x, int y, int aOutline=-1) -> int
Append(SHAPE_POLY_SET self, int x, int y) -> int
Append(SHAPE_POLY_SET self, SHAPE_POLY_SET aSet)
Append(SHAPE_POLY_SET self, VECTOR2I const & aP, int aOutline=-1, int aHole=-1)
Append(SHAPE_POLY_SET self, VECTOR2I const & aP, int aOutline=-1)
Append(SHAPE_POLY_SET self, VECTOR2I const & aP)

void
SHAPE_POLY_SET::Append(const VECTOR2I &aP, int aOutline=-1, int
aHole=-1)

Appends a vertex at the end of the given outline/hole (default: the
last outline) 

Definition at line 6780 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.BBox (   self,
  aClearance = 0 
)
BBox(SHAPE_POLY_SET self, int aClearance=0) -> BOX2I const
BBox(SHAPE_POLY_SET self) -> BOX2I const

const BOX2I
SHAPE_POLY_SET::BBox(int aClearance=0) const override

Function BBox()

Computes a bounding box of the shape, with a margin of aClearance a
collision.

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

aClearance:  how much the bounding box is expanded wrs to the minimum
enclosing rectangle for the shape.

the bounding box. 

Definition at line 7308 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.BooleanAdd (   self,
  args 
)
BooleanAdd(SHAPE_POLY_SET self, SHAPE_POLY_SET b, SHAPE_POLY_SET::POLYGON_MODE aFastMode)
BooleanAdd(SHAPE_POLY_SET self, SHAPE_POLY_SET a, SHAPE_POLY_SET b, SHAPE_POLY_SET::POLYGON_MODE aFastMode)

void
SHAPE_POLY_SET::BooleanAdd(const SHAPE_POLY_SET &a, const
SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)

Performs boolean polyset union between a and b, store the result in it
self For aFastMode meaning, see function booleanOp 

Definition at line 7155 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.BooleanIntersection (   self,
  args 
)
BooleanIntersection(SHAPE_POLY_SET self, SHAPE_POLY_SET b, SHAPE_POLY_SET::POLYGON_MODE aFastMode)
BooleanIntersection(SHAPE_POLY_SET self, SHAPE_POLY_SET a, SHAPE_POLY_SET b, SHAPE_POLY_SET::POLYGON_MODE aFastMode)

void
SHAPE_POLY_SET::BooleanIntersection(const SHAPE_POLY_SET &a, const
SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)

Performs boolean polyset intersection between a and b, store the
result in it self For aFastMode meaning, see function booleanOp 

Definition at line 7185 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.BooleanSubtract (   self,
  args 
)
BooleanSubtract(SHAPE_POLY_SET self, SHAPE_POLY_SET b, SHAPE_POLY_SET::POLYGON_MODE aFastMode)
BooleanSubtract(SHAPE_POLY_SET self, SHAPE_POLY_SET a, SHAPE_POLY_SET b, SHAPE_POLY_SET::POLYGON_MODE aFastMode)

void
SHAPE_POLY_SET::BooleanSubtract(const SHAPE_POLY_SET &a, const
SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)

Performs boolean polyset difference between a and b, store the result
in it self For aFastMode meaning, see function booleanOp 

Definition at line 7170 of file pcbnew.py.

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

SHAPE_POLY_SET
SHAPE_POLY_SET::Chamfer(int aDistance)

Function Chamfer returns a chamfered version of the polygon set.

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

aDistance:  is the chamfering distance.

SHAPE_POLY_SET - A set containing the chamfered version of this set.

Definition at line 7594 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.ChamferPolygon (   self,
  aDistance,
  aIndex = 0 
)
ChamferPolygon(SHAPE_POLY_SET self, unsigned int aDistance, int aIndex=0) -> SHAPE_POLY_SET::POLYGON
ChamferPolygon(SHAPE_POLY_SET self, unsigned int aDistance) -> SHAPE_POLY_SET::POLYGON

SHAPE_POLY_SET::POLYGON SHAPE_POLY_SET::ChamferPolygon(unsigned int
aDistance, int aIndex=0)

Function Chamfer returns a chamfered version of the aIndex-th polygon.

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

aDistance:  is the chamfering distance.

aIndex:  is the index of the polygon to be chamfered.

POLYGON - A polygon containing the chamfered version of the aIndex-th
polygon. 

Definition at line 7546 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.CHole (   self,
  aOutline,
  aHole 
)
CHole(SHAPE_POLY_SET self, int aOutline, int aHole) -> SHAPE_LINE_CHAIN const &

const SHAPE_LINE_CHAIN&
SHAPE_POLY_SET::CHole(int aOutline, int aHole) const 

Definition at line 7039 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.CIterate (   self,
  args 
)
CIterate(SHAPE_POLY_SET self, int aFirst, int aLast, bool aIterateHoles=False) -> SHAPE_POLY_SET::CONST_ITERATOR
CIterate(SHAPE_POLY_SET self, int aFirst, int aLast) -> SHAPE_POLY_SET::CONST_ITERATOR
CIterate(SHAPE_POLY_SET self, int aOutline) -> SHAPE_POLY_SET::CONST_ITERATOR
CIterate(SHAPE_POLY_SET self) -> SHAPE_POLY_SET::CONST_ITERATOR

CONST_ITERATOR
SHAPE_POLY_SET::CIterate() const 

Definition at line 7093 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.CIterateWithHoles (   self,
  args 
)
CIterateWithHoles(SHAPE_POLY_SET self, int aOutline) -> SHAPE_POLY_SET::CONST_ITERATOR
CIterateWithHoles(SHAPE_POLY_SET self) -> SHAPE_POLY_SET::CONST_ITERATOR

CONST_ITERATOR SHAPE_POLY_SET::CIterateWithHoles() const 

Definition at line 7106 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Clone (   self)
Clone(SHAPE_POLY_SET self) -> SHAPE

SHAPE *
SHAPE_POLY_SET::Clone() const override

Function Clone()

Returns a dynamically allocated copy of the shape

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

copy:  of the shape 

Definition at line 6709 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Collide (   self,
  args 
)
Collide(SHAPE_POLY_SET self, VECTOR2I const & aP, int aClearance=0) -> bool
Collide(SHAPE_POLY_SET self, VECTOR2I const & aP) -> bool
Collide(SHAPE_POLY_SET self, SEG const & aSeg, int aClearance=0) -> bool
Collide(SHAPE_POLY_SET self, SEG const & aSeg) -> bool

bool
SHAPE::Collide(const SHAPE *aShape, int aClearance=0) const 

Definition at line 7354 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.CollideEdge (   self,
  aPoint,
  aClosestVertex,
  aClearance = 0 
)
CollideEdge(SHAPE_POLY_SET self, VECTOR2I const & aPoint, SHAPE_POLY_SET::VERTEX_INDEX & aClosestVertex, int aClearance=0) -> bool
CollideEdge(SHAPE_POLY_SET self, VECTOR2I const & aPoint, SHAPE_POLY_SET::VERTEX_INDEX & aClosestVertex) -> bool

bool
SHAPE_POLY_SET::CollideEdge(const VECTOR2I &aPoint, VERTEX_INDEX
&aClosestVertex, int aClearance=0)

Function CollideEdge Checks whether aPoint collides with any edge of
any of the contours of the polygon.

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

aPoint:  is the VECTOR2I point whose collision with respect to the
polygon will be tested.

aClearance:  is the security distance; if aPoint lies closer to a
vertex than aClearance distance, then there is a collision.

aClosestVertex:  is the index of the closes vertex to aPoint.

bool - true if there is a collision, false in any other case. 

Definition at line 7395 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.CollideVertex (   self,
  aPoint,
  aClosestVertex,
  aClearance = 0 
)
CollideVertex(SHAPE_POLY_SET self, VECTOR2I const & aPoint, SHAPE_POLY_SET::VERTEX_INDEX & aClosestVertex, int aClearance=0) -> bool
CollideVertex(SHAPE_POLY_SET self, VECTOR2I const & aPoint, SHAPE_POLY_SET::VERTEX_INDEX & aClosestVertex) -> bool

bool
SHAPE_POLY_SET::CollideVertex(const VECTOR2I &aPoint, VERTEX_INDEX
&aClosestVertex, int aClearance=0)

Function CollideVertex Checks whether aPoint collides with any vertex
of any of the contours of the polygon.

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

aPoint:  is the VECTOR2I point whose collision with respect to the
polygon will be tested.

aClearance:  is the security distance; if aPoint lies closer to a
vertex than aClearance distance, then there is a collision.

aClosestVertex:  is the index of the closes vertex to aPoint.

bool - true if there is a collision, false in any other case. 

Definition at line 7367 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Contains (   self,
  aP,
  aSubpolyIndex = -1 
)
Contains(SHAPE_POLY_SET self, VECTOR2I const & aP, int aSubpolyIndex=-1) -> bool
Contains(SHAPE_POLY_SET self, VECTOR2I const & aP) -> bool

bool
SHAPE_POLY_SET::Contains(const VECTOR2I &aP, int aSubpolyIndex=-1)
const

Returns true if a given subpolygon contains the point aP.

If aSubpolyIndex < 0 (default value), checks all polygons in the set

Definition at line 7423 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.COutline (   self,
  aIndex 
)
COutline(SHAPE_POLY_SET self, int aIndex) -> SHAPE_LINE_CHAIN const &

const
SHAPE_LINE_CHAIN& SHAPE_POLY_SET::COutline(int aIndex) const 

Definition at line 7029 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.CPolygon (   self,
  aIndex 
)
CPolygon(SHAPE_POLY_SET self, int aIndex) -> SHAPE_POLY_SET::POLYGON const &

const POLYGON&
SHAPE_POLY_SET::CPolygon(int aIndex) const 

Definition at line 7049 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.CVertex (   self,
  args 
)
CVertex(SHAPE_POLY_SET self, int aIndex, int aOutline, int aHole) -> VECTOR2I const
CVertex(SHAPE_POLY_SET self, int aGlobalIndex) -> VECTOR2I const
CVertex(SHAPE_POLY_SET self, SHAPE_POLY_SET::VERTEX_INDEX aIndex) -> VECTOR2I const &

const VECTOR2I &
SHAPE_POLY_SET::CVertex(VERTEX_INDEX aIndex) const

Returns the index-th vertex in a given hole outline within a given
outline 

Definition at line 6837 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.DeletePolygon (   self,
  aIdx 
)
DeletePolygon(SHAPE_POLY_SET self, int aIdx)

void
SHAPE_POLY_SET::DeletePolygon(int aIdx)

Deletes aIdx-th polygon from the set 

Definition at line 7534 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Distance (   self,
  args 
)
Distance(SHAPE_POLY_SET self, VECTOR2I aPoint) -> int
Distance(SHAPE_POLY_SET self, SEG aSegment, int aSegmentWidth=0) -> int
Distance(SHAPE_POLY_SET self, SEG aSegment) -> int

int
SHAPE_POLY_SET::Distance(SEG aSegment, int aSegmentWidth=0)

Function DistanceToPolygon computes the minimum distance between
aSegment and all the polygons in the set.

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

aSegment:  is the segment whose distance to the polygon set has to be
measured.

aSegmentWidth:  is the width of the segment; defaults to zero.

int - The minimum distance between aSegment and all the polygons in
the set. If the point is contained in the polygon, the distance is
zero. 

Definition at line 7666 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.DistanceToPolygon (   self,
  args 
)
DistanceToPolygon(SHAPE_POLY_SET self, VECTOR2I aPoint, int aIndex) -> int
DistanceToPolygon(SHAPE_POLY_SET self, SEG aSegment, int aIndex, int aSegmentWidth=0) -> int
DistanceToPolygon(SHAPE_POLY_SET self, SEG aSegment, int aIndex) -> int

int
SHAPE_POLY_SET::DistanceToPolygon(SEG aSegment, int aIndex, int
aSegmentWidth=0)

Function DistanceToPolygon computes the minimum distance between the
aIndex-th polygon and aSegment with a possible width.

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

aSegment:  is the segment whose distance to the aIndex-th polygon has
to be measured.

aIndex:  is the index of the polygon whose distace to aPoint has to be
measured.

aSegmentWidth:  is the width of the segment; defaults to zero.

int - The minimum distance between aSegment and all the segments of
the aIndex-th polygon. If the point is contained in the polygon, the
distance is zero. 

Definition at line 7635 of file pcbnew.py.

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

SHAPE_POLY_SET
SHAPE_POLY_SET::Fillet(int aRadius, int aSegments)

Function Fillet returns a filleted version of the polygon set.

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

aRadius:  is the fillet radius.

aSegments:  is the number of segments / fillet.

SHAPE_POLY_SET - A set containing the filleted version of this set. 

Definition at line 7614 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.FilletPolygon (   self,
  aRadius,
  aSegments,
  aIndex = 0 
)
FilletPolygon(SHAPE_POLY_SET self, unsigned int aRadius, unsigned int aSegments, int aIndex=0) -> SHAPE_POLY_SET::POLYGON
FilletPolygon(SHAPE_POLY_SET self, unsigned int aRadius, unsigned int aSegments) -> SHAPE_POLY_SET::POLYGON

SHAPE_POLY_SET::POLYGON SHAPE_POLY_SET::FilletPolygon(unsigned int
aRadius, unsigned int aSegments, int aIndex=0)

Function Fillet returns a filleted version of the aIndex-th polygon.

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

aRadius:  is the fillet radius.

aSegments:  is the number of segments / fillet.

aIndex:  is the index of the polygon to be filleted

POLYGON - A polygon containing the filleted version of the aIndex-th
polygon. 

Definition at line 7569 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Format (   self)
Format(SHAPE_POLY_SET self) -> string

const std::string
SHAPE_POLY_SET::Format() const override 

Definition at line 7268 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Fracture (   self,
  aFastMode 
)
Fracture(SHAPE_POLY_SET self, SHAPE_POLY_SET::POLYGON_MODE aFastMode)

void
SHAPE_POLY_SET::Fracture(POLYGON_MODE aFastMode)

Converts a set of polygons with holes to a singe outline with
"slits"/"fractures" connecting the outer ring to the inner holes
For aFastMode meaning, see function booleanOp 

Definition at line 7212 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.GetGlobalIndex (   self,
  aRelativeIndices,
  aGlobalIdx 
)
GetGlobalIndex(SHAPE_POLY_SET self, SHAPE_POLY_SET::VERTEX_INDEX aRelativeIndices, int & aGlobalIdx) -> bool

bool
SHAPE_POLY_SET::GetGlobalIndex(VERTEX_INDEX aRelativeIndices, int
&aGlobalIdx)

Function GetGlobalIndex computes the global index of a vertex from the
relative indices of polygon, contour and vertex.

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

aRelativeIndices:  is the set of relative indices.

aGlobalIdx:  [out] is the computed global index.

bool - true if the relative indices are correct; false otherwise. The
computed global index is returned in the aGlobalIdx reference. 

Definition at line 6685 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.GetNeighbourIndexes (   self,
  aGlobalIndex,
  aPrevious,
  aNext 
)
GetNeighbourIndexes(SHAPE_POLY_SET self, int aGlobalIndex, int * aPrevious, int * aNext) -> bool

bool
SHAPE_POLY_SET::GetNeighbourIndexes(int aGlobalIndex, int *aPrevious,
int *aNext)

Returns the global indexes of the previous and the next corner of the
aGlobalIndex-th corner of a contour in the polygon set.

they are often aGlobalIndex-1 and aGlobalIndex+1, but not for the
first and last corner of the contour.

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

aGlobalIndex:  is index of the corner, globally indexed between all
edges in all contours

aPrevious:  - the globalIndex of the previous corner of the same
contour.

aNext:  - the globalIndex of the next corner of the same contour.

true if OK, false if aGlobalIndex is out of range 

Definition at line 6852 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.GetRelativeIndices (   self,
  aGlobalIdx,
  aRelativeIndices 
)
GetRelativeIndices(SHAPE_POLY_SET self, int aGlobalIdx, SHAPE_POLY_SET::VERTEX_INDEX * aRelativeIndices) -> bool

bool
SHAPE_POLY_SET::GetRelativeIndices(int aGlobalIdx, VERTEX_INDEX
*aRelativeIndices) const

Function GetRelativeIndices.

Converts a global vertex indexi.e., a number that globally identifies
a vertex in a concatenated list of all vertices in all contours and
get the index of the vertex relative to the contour relative to the
polygon in which it is.

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

aGlobalIdx:  is the global index of the corner whose structured index
wants to be found

aRelativeIndices:  is a pointer to the set of relative indices to
store.

bool - true if the global index is correct and the information in
aRelativeIndices is valid; false otherwise. 

Definition at line 6655 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.HasHoles (   self)
HasHoles(SHAPE_POLY_SET self) -> bool

bool
SHAPE_POLY_SET::HasHoles() const

Returns true if the polygon set has any holes. 

Definition at line 7226 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Hole (   self,
  aOutline,
  aHole 
)
Hole(SHAPE_POLY_SET self, int aOutline, int aHole) -> SHAPE_LINE_CHAIN &

SHAPE_LINE_CHAIN&
SHAPE_POLY_SET::Hole(int aOutline, int aHole)

Returns the reference to aHole-th hole in the aIndex-th outline 

Definition at line 7005 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.HoleCount (   self,
  aOutline 
)
HoleCount(SHAPE_POLY_SET self, int aOutline) -> int

int
SHAPE_POLY_SET::HoleCount(int aOutline) const

Returns the number of holes in a given outline 

Definition at line 6946 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Inflate (   self,
  aFactor,
  aCircleSegmentsCount 
)
Inflate(SHAPE_POLY_SET self, int aFactor, int aCircleSegmentsCount)

void
SHAPE_POLY_SET::Inflate(int aFactor, int aCircleSegmentsCount)

Performs outline inflation/deflation, using round corners. 

Definition at line 7200 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.InsertVertex (   self,
  aGlobalIndex,
  aNewVertex 
)
InsertVertex(SHAPE_POLY_SET self, int aGlobalIndex, VECTOR2I aNewVertex)

void
SHAPE_POLY_SET::InsertVertex(int aGlobalIndex, VECTOR2I aNewVertex)

Function InsertVertex Adds a vertex in the globally indexed position
aGlobalIndex.

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

aGlobalIndex:  is the global index of the position in which teh new
vertex will be inserted.

aNewVertex:  is the new inserted vertex. 

Definition at line 6801 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.IsEmpty (   self)
IsEmpty(SHAPE_POLY_SET self) -> bool

bool
SHAPE_POLY_SET::IsEmpty() const

Returns true if the set is empty (no polygons at all) 

Definition at line 7440 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.IsPolygonSelfIntersecting (   self,
  aPolygonIndex 
)
IsPolygonSelfIntersecting(SHAPE_POLY_SET self, int aPolygonIndex) -> bool

bool SHAPE_POLY_SET::IsPolygonSelfIntersecting(int aPolygonIndex)

Function IsPolygonSelfIntersecting.

Checks whether the aPolygonIndex-th polygon in the set is self
intersecting.

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

aPolygonIndex:  index of the polygon that wants to be checked.

bool - true if the aPolygonIndex-th polygon is self intersecting,
false otherwise. 

Definition at line 6882 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.IsSelfIntersecting (   self)
IsSelfIntersecting(SHAPE_POLY_SET self) -> bool

bool
SHAPE_POLY_SET::IsSelfIntersecting()

Function IsSelfIntersecting Checks whether any of the polygons in the
set is self intersecting.

bool - true if any of the polygons is self intersecting, false
otherwise. 

Definition at line 6904 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.IsSolid (   self)
IsSolid(SHAPE_POLY_SET self) -> bool

bool
SHAPE_POLY_SET::IsSolid() const override 

Definition at line 7298 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.IsVertexInHole (   self,
  aGlobalIdx 
)
IsVertexInHole(SHAPE_POLY_SET self, int aGlobalIdx) -> bool

bool
SHAPE_POLY_SET::IsVertexInHole(int aGlobalIdx)

Function IsVertexInHole.

checks whether the aGlobalIndex-th vertex belongs to a hole.

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

aGlobalIdx:  is the index of the vertex.

bool - true if the globally indexed aGlobalIdx-th vertex belongs to a
hole. 

Definition at line 7693 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Iterate (   self,
  args 
)
Iterate(SHAPE_POLY_SET self, int aFirst, int aLast, bool aIterateHoles=False) -> SHAPE_POLY_SET::ITERATOR
Iterate(SHAPE_POLY_SET self, int aFirst, int aLast) -> SHAPE_POLY_SET::ITERATOR
Iterate(SHAPE_POLY_SET self, int aOutline) -> SHAPE_POLY_SET::ITERATOR
Iterate(SHAPE_POLY_SET self) -> SHAPE_POLY_SET::ITERATOR

ITERATOR
SHAPE_POLY_SET::Iterate()

Function Iterate.

ITERATOR - an iterator object to visit all points in all outlines of
the set, without visiting the points in the holes. 

Definition at line 7059 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.IterateFromVertexWithHoles (   self,
  aGlobalIdx 
)
IterateFromVertexWithHoles(SHAPE_POLY_SET self, int aGlobalIdx) -> SHAPE_POLY_SET::ITERATOR

ITERATOR SHAPE_POLY_SET::IterateFromVertexWithHoles(int aGlobalIdx) 

Definition at line 7116 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.IterateSegments (   self,
  args 
)
IterateSegments(SHAPE_POLY_SET self, int aFirst, int aLast, bool aIterateHoles=False) -> SHAPE_POLY_SET::SEGMENT_ITERATOR
IterateSegments(SHAPE_POLY_SET self, int aFirst, int aLast) -> SHAPE_POLY_SET::SEGMENT_ITERATOR
IterateSegments(SHAPE_POLY_SET self, int aPolygonIdx) -> SHAPE_POLY_SET::SEGMENT_ITERATOR
IterateSegments(SHAPE_POLY_SET self) -> SHAPE_POLY_SET::SEGMENT_ITERATOR

SEGMENT_ITERATOR SHAPE_POLY_SET::IterateSegments()

Returns an iterator object, for all outlines in the set (no holes) 

Definition at line 7125 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.IterateSegmentsWithHoles (   self,
  args 
)
IterateSegmentsWithHoles(SHAPE_POLY_SET self) -> SHAPE_POLY_SET::SEGMENT_ITERATOR
IterateSegmentsWithHoles(SHAPE_POLY_SET self, int aOutline) -> SHAPE_POLY_SET::SEGMENT_ITERATOR

SEGMENT_ITERATOR SHAPE_POLY_SET::IterateSegmentsWithHoles(int
aOutline)

Returns an iterator object, for the aOutline-th outline in the set
(with holes) 

Definition at line 7139 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.IterateWithHoles (   self,
  args 
)
IterateWithHoles(SHAPE_POLY_SET self, int aOutline) -> SHAPE_POLY_SET::ITERATOR
IterateWithHoles(SHAPE_POLY_SET self) -> SHAPE_POLY_SET::ITERATOR

ITERATOR
SHAPE_POLY_SET::IterateWithHoles()

Function IterateWithHoles.

ITERATOR - an iterator object to visit all points in all outlines of
the set, visiting also the points in the holes. 

Definition at line 7077 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Move (   self,
  aVector 
)
Move(SHAPE_POLY_SET self, VECTOR2I const & aVector)

void
SHAPE_POLY_SET::Move(const VECTOR2I &aVector) override 

Definition at line 7288 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.NewHole (   self,
  aOutline = -1 
)
NewHole(SHAPE_POLY_SET self, int aOutline=-1) -> int
NewHole(SHAPE_POLY_SET self) -> int

int
SHAPE_POLY_SET::NewHole(int aOutline=-1)

Creates a new hole in a given outline 

Definition at line 6740 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.NewOutline (   self)
NewOutline(SHAPE_POLY_SET self) -> int

int
SHAPE_POLY_SET::NewOutline()

Creates a new empty polygon in the set and returns its index 

Definition at line 6728 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.NormalizeAreaOutlines (   self)
NormalizeAreaOutlines(SHAPE_POLY_SET self) -> int

int
SHAPE_POLY_SET::NormalizeAreaOutlines()

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

int - 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 7252 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Outline (   self,
  aIndex 
)
Outline(SHAPE_POLY_SET self, int aIndex) -> SHAPE_LINE_CHAIN &

SHAPE_LINE_CHAIN&
SHAPE_POLY_SET::Outline(int aIndex)

Returns the reference to aIndex-th outline in the set 

Definition at line 6958 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.OutlineCount (   self)
OutlineCount(SHAPE_POLY_SET self) -> int

int
SHAPE_POLY_SET::OutlineCount() const

Returns the number of outlines in the set 

Definition at line 6920 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Parse (   self,
  aStream 
)
Parse(SHAPE_POLY_SET self, std::stringstream & aStream) -> bool

bool
SHAPE_POLY_SET::Parse(std::stringstream &aStream) override 

Definition at line 7278 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.PointOnEdge (   self,
  aP 
)
PointOnEdge(SHAPE_POLY_SET self, VECTOR2I const & aP) -> bool

bool
SHAPE_POLY_SET::PointOnEdge(const VECTOR2I &aP) const

Function PointOnEdge()

Checks if point aP lies on an edge or vertex of some of the outlines
or holes.

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

aP:  is the point to check.

bool - true if the point lies on the edge of any polygon. 

Definition at line 7332 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Polygon (   self,
  aIndex 
)
Polygon(SHAPE_POLY_SET self, int aIndex) -> SHAPE_POLY_SET::POLYGON &

POLYGON&
SHAPE_POLY_SET::Polygon(int aIndex)

Returns the aIndex-th subpolygon in the set 

Definition at line 7017 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.RemoveAllContours (   self)
RemoveAllContours(SHAPE_POLY_SET self)

void
SHAPE_POLY_SET::RemoveAllContours()

Removes all outlines & holes (clears) the polygon set. 

Definition at line 7472 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.RemoveContour (   self,
  aContourIdx,
  aPolygonIdx = -1 
)
RemoveContour(SHAPE_POLY_SET self, int aContourIdx, int aPolygonIdx=-1)
RemoveContour(SHAPE_POLY_SET self, int aContourIdx)

void
SHAPE_POLY_SET::RemoveContour(int aContourIdx, int aPolygonIdx=-1)

Function RemoveContour deletes the aContourIdx-th contour of the
aPolygonIdx-th polygon in the set.

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

aContourIdx:  is the index of the contour in the aPolygonIdx-th
polygon to be removed.

aPolygonIdx:  is the index of the polygon in which the to-be-removed
contour is. Defaults to the last polygon in the set. 

Definition at line 7484 of file pcbnew.py.

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

int
SHAPE_POLY_SET::RemoveNullSegments()

Function RemoveNullSegments looks for null segments; ie, segments
whose ends are exactly the same and deletes them.

int - the number of deleted segments. 

Definition at line 7507 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.RemoveVertex (   self,
  args 
)
RemoveVertex(SHAPE_POLY_SET self, int aGlobalIndex)
RemoveVertex(SHAPE_POLY_SET self, SHAPE_POLY_SET::VERTEX_INDEX aRelativeIndices)

void
SHAPE_POLY_SET::RemoveVertex(VERTEX_INDEX aRelativeIndices)

Function RemoveVertex deletes the vertex indexed by aIndex (index of
polygon, contour and vertex).

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

aRelativeIndices:  is the set of relative indices of the to-be-removed
vertex. 

Definition at line 7452 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Simplify (   self,
  aFastMode 
)
Simplify(SHAPE_POLY_SET self, SHAPE_POLY_SET::POLYGON_MODE aFastMode)

void
SHAPE_POLY_SET::Simplify(POLYGON_MODE aFastMode)

Simplifies the polyset (merges overlapping polys, eliminates
degeneracy/self-intersections) For aFastMode meaning, see function
booleanOp 

Definition at line 7238 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Subset (   self,
  aFirstPolygon,
  aLastPolygon 
)
Subset(SHAPE_POLY_SET self, int aFirstPolygon, int aLastPolygon) -> SHAPE_POLY_SET

SHAPE_POLY_SET
SHAPE_POLY_SET::Subset(int aFirstPolygon, int aLastPolygon)

Function Subset returns a subset of the polygons in this set, the ones
between aFirstPolygon and aLastPolygon.

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

aFirstPolygon:  is the first polygon to be included in the returned
set.

aLastPolygon:  is the first polygon to be excluded of the returned
set.

SHAPE_POLY_SET - a set containing the polygons between aFirstPolygon
(included) and aLastPolygon (excluded). 

Definition at line 6970 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.TotalVertices (   self)
TotalVertices(SHAPE_POLY_SET self) -> int

int
SHAPE_POLY_SET::TotalVertices() const

Returns total number of vertices stored in the set. 

Definition at line 7522 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.UnitSet (   self,
  aPolygonIndex 
)
UnitSet(SHAPE_POLY_SET self, int aPolygonIndex) -> SHAPE_POLY_SET

SHAPE_POLY_SET
SHAPE_POLY_SET::UnitSet(int aPolygonIndex) 

Definition at line 6995 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.Vertex (   self,
  args 
)
Vertex(SHAPE_POLY_SET self, int aIndex, int aOutline, int aHole) -> VECTOR2I
Vertex(SHAPE_POLY_SET self, int aGlobalIndex) -> VECTOR2I
Vertex(SHAPE_POLY_SET self, SHAPE_POLY_SET::VERTEX_INDEX aIndex) -> VECTOR2I &

VECTOR2I &
SHAPE_POLY_SET::Vertex(VERTEX_INDEX aIndex)

Returns the index-th vertex in a given hole outline within a given
outline 

Definition at line 6822 of file pcbnew.py.

def pcbnew.SHAPE_POLY_SET.VertexCount (   self,
  aOutline = -1,
  aHole = -1 
)
VertexCount(SHAPE_POLY_SET self, int aOutline=-1, int aHole=-1) -> int
VertexCount(SHAPE_POLY_SET self, int aOutline=-1) -> int
VertexCount(SHAPE_POLY_SET self) -> int

int
SHAPE_POLY_SET::VertexCount(int aOutline=-1, int aHole=-1) const

Returns the number of vertices in a given outline/hole 

Definition at line 6932 of file pcbnew.py.

Member Data Documentation

pcbnew.SHAPE_POLY_SET.PM_FAST = _pcbnew.SHAPE_POLY_SET_PM_FAST
static

Definition at line 7152 of file pcbnew.py.

pcbnew.SHAPE_POLY_SET.PM_STRICTLY_SIMPLE = _pcbnew.SHAPE_POLY_SET_PM_STRICTLY_SIMPLE
static

Definition at line 7153 of file pcbnew.py.

pcbnew.SHAPE_POLY_SET.this

Definition at line 6651 of file pcbnew.py.


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