KiCAD pcbnew scripting
Public Member Functions | Public Attributes | List of all members
pcbnew.EDA_RECT Class Reference
Inheritance diagram for pcbnew.EDA_RECT:
Inheritance graph

Public Member Functions

def __init__ (self, args)
def Centre (self)
def Move (self, aMoveVector)
def Normalize (self)
def Contains (self, args)
def GetSize (self)
def GetSizeMax (self)
def GetX (self)
def GetY (self)
def GetOrigin (self)
def GetPosition (self)
def GetEnd (self)
def GetWidth (self)
def GetHeight (self)
def GetRight (self)
def GetLeft (self)
def GetTop (self)
def GetBottom (self)
def SetOrigin (self, args)
def SetSize (self, args)
def Offset (self, args)
def SetX (self, val)
def SetY (self, val)
def SetWidth (self, val)
def SetHeight (self, val)
def SetEnd (self, args)
def RevertYAxis (self)
def Intersects (self, args)
def getWxRect (self)
def getBOX2I (self)
def Inflate (self, args)
def Merge (self, args)
def GetArea (self)
def Common (self, aRect)
def GetBoundingBoxRotated (self, aRotCenter, aAngle)

Public Attributes


Detailed Description

Class EDA_RECT handles the component boundary box.

This class is similar to wxRect, but some wxRect functions are very
curious, and are working only if dimensions are >= 0 (not always the
case in KiCad) and also KiCad needs some specific method. so I prefer
this more suitable class

C++ includes: class_eda_rect.h 

Definition at line 2142 of file

Constructor & Destructor Documentation

def pcbnew.EDA_RECT.__init__ (   self,
__init__(EDA_RECT self) -> EDA_RECT
__init__(EDA_RECT self, wxPoint aPos, wxSize aSize) -> EDA_RECT

wxPoint &aPos, const wxSize &aSize) 

Definition at line 2161 of file

Member Function Documentation

def pcbnew.EDA_RECT.Centre (   self)
Centre(EDA_RECT self) -> wxPoint

wxPoint EDA_RECT::Centre()

Definition at line 2175 of file

def pcbnew.EDA_RECT.Common (   self,
Common(EDA_RECT self, EDA_RECT aRect) -> EDA_RECT

EDA_RECT::Common(const EDA_RECT &aRect) const

Function Common returns the area that is common with another


aRect:  is the rectangle to find the common area with.

The common area rect or 0-sized rectangle if there is no intersection.

Definition at line 2548 of file

def pcbnew.EDA_RECT.Contains (   self,
Contains(EDA_RECT self, wxPoint aPoint) -> bool
Contains(EDA_RECT self, int x, int y) -> bool
Contains(EDA_RECT self, EDA_RECT aRect) -> bool

EDA_RECT::Contains(const EDA_RECT &aRect) const

Function Contains.


aRect:  = the EDA_RECT to test

true if aRect is Contained. A common edge is seen as contained 

Definition at line 2214 of file

def pcbnew.EDA_RECT.GetArea (   self)
GetArea(EDA_RECT self) -> double

double EDA_RECT::GetArea()

Function GetArea returns the area of the rectangle.

The area of the rectangle. 

Definition at line 2534 of file

def pcbnew.EDA_RECT.GetBottom (   self)
GetBottom(EDA_RECT self) -> int

int EDA_RECT::GetBottom()

Definition at line 2357 of file

def pcbnew.EDA_RECT.GetBoundingBoxRotated (   self,
GetBoundingBoxRotated(EDA_RECT self, wxPoint aRotCenter, double aAngle) -> EDA_RECT

EDA_RECT EDA_RECT::GetBoundingBoxRotated(wxPoint aRotCenter, double

Function GetBoundingBoxRotated.

the bounding box of this, after rotation


aAngle:  = the rotation angle in 0.1 deg.

aRotCenter:  = the rotation point. useful to calculate bounding box of
rotated items, when rotation if not k*90 degrees 

Definition at line 2569 of file

def pcbnew.EDA_RECT.getBOX2I (   self)
getBOX2I(EDA_RECT self) -> BOX2I

Definition at line 2494 of file

def pcbnew.EDA_RECT.GetEnd (   self)
GetEnd(EDA_RECT self) -> wxPoint

const wxPoint
EDA_RECT::GetEnd() const 

Definition at line 2297 of file

def pcbnew.EDA_RECT.GetHeight (   self)
GetHeight(EDA_RECT self) -> int

int EDA_RECT::GetHeight()

Definition at line 2317 of file

def pcbnew.EDA_RECT.GetLeft (   self)
GetLeft(EDA_RECT self) -> int

int EDA_RECT::GetLeft()

Definition at line 2337 of file

def pcbnew.EDA_RECT.GetOrigin (   self)
GetOrigin(EDA_RECT self) -> wxPoint

const wxPoint&
EDA_RECT::GetOrigin() const 

Definition at line 2277 of file

def pcbnew.EDA_RECT.GetPosition (   self)
GetPosition(EDA_RECT self) -> wxPoint

const wxPoint&
EDA_RECT::GetPosition() const 

Definition at line 2287 of file

def pcbnew.EDA_RECT.GetRight (   self)
GetRight(EDA_RECT self) -> int

int EDA_RECT::GetRight()

Definition at line 2327 of file

def pcbnew.EDA_RECT.GetSize (   self)
GetSize(EDA_RECT self) -> wxSize

const wxSize&
EDA_RECT::GetSize() const 

Definition at line 2235 of file

def pcbnew.EDA_RECT.GetSizeMax (   self)
GetSizeMax(EDA_RECT self) -> int

EDA_RECT::GetSizeMax() const


the max size dimension 

Definition at line 2245 of file

def pcbnew.EDA_RECT.GetTop (   self)
GetTop(EDA_RECT self) -> int

int EDA_RECT::GetTop() const

Definition at line 2347 of file

def pcbnew.EDA_RECT.GetWidth (   self)
GetWidth(EDA_RECT self) -> int

int EDA_RECT::GetWidth()

Definition at line 2307 of file

def pcbnew.EDA_RECT.getWxRect (   self)
getWxRect(EDA_RECT self) -> wxRect

Definition at line 2489 of file

def pcbnew.EDA_RECT.GetX (   self)
GetX(EDA_RECT self) -> int

int EDA_RECT::GetX() const 

Definition at line 2259 of file

def pcbnew.EDA_RECT.GetY (   self)
GetY(EDA_RECT self) -> int

int EDA_RECT::GetY() const 

Definition at line 2268 of file

def pcbnew.EDA_RECT.Inflate (   self,
Inflate(EDA_RECT self, wxCoord dx, wxCoord dy) -> EDA_RECT
Inflate(EDA_RECT self, int aDelta) -> EDA_RECT

EDA_RECT::Inflate(int aDelta)

Function Inflate inflates the rectangle horizontally and vertically by

If aDelta is negative the rectangle is deflated. 

Definition at line 2499 of file

def pcbnew.EDA_RECT.Intersects (   self,
Intersects(EDA_RECT self, EDA_RECT aRect) -> bool
Intersects(EDA_RECT self, wxPoint aPoint1, wxPoint aPoint2) -> bool

EDA_RECT::Intersects(const wxPoint &aPoint1, const wxPoint &aPoint2)

Function Intersects tests for a common area between a segment and this


aPoint1:  First point of the segment to test intersection with.

aPoint2:  Second point of the segment to test intersection with.

bool - true if the argument segment intersects this rectangle. (i.e.
if the segment and rectangle have at least a common point) 

Definition at line 2464 of file

def pcbnew.EDA_RECT.Merge (   self,
Merge(EDA_RECT self, EDA_RECT aRect)
Merge(EDA_RECT self, wxPoint aPoint)

void EDA_RECT::Merge(const
wxPoint &aPoint)

Function Merge modifies the position and size of the rectangle in
order to contain the given point.


aPoint:  The point to merge with the rectangle. 

Definition at line 2515 of file

def pcbnew.EDA_RECT.Move (   self,
Move(EDA_RECT self, wxPoint aMoveVector)

void EDA_RECT::Move(const
wxPoint &aMoveVector)

Function Move moves the rectangle by the aMoveVector.


aMoveVector:  A wxPoint that is the value to move this rectangle 

Definition at line 2185 of file

def pcbnew.EDA_RECT.Normalize (   self)
Normalize(EDA_RECT self)


Function Normalize ensures that the height ant width are positive. 

Definition at line 2202 of file

def pcbnew.EDA_RECT.Offset (   self,
Offset(EDA_RECT self, int dx, int dy)
Offset(EDA_RECT self, wxPoint offset)

void EDA_RECT::Offset(const
wxPoint &offset) 

Definition at line 2389 of file

def pcbnew.EDA_RECT.RevertYAxis (   self)
RevertYAxis(EDA_RECT self)


Function RevertYAxis Mirror the rectangle from the X axis (negate Y
pos and size) 

Definition at line 2451 of file

def pcbnew.EDA_RECT.SetEnd (   self,
SetEnd(EDA_RECT self, int x, int y)
SetEnd(EDA_RECT self, wxPoint pos)

void EDA_RECT::SetEnd(const
wxPoint &pos) 

Definition at line 2440 of file

def pcbnew.EDA_RECT.SetHeight (   self,
SetHeight(EDA_RECT self, int val)

EDA_RECT::SetHeight(int val) 

Definition at line 2430 of file

def pcbnew.EDA_RECT.SetOrigin (   self,
SetOrigin(EDA_RECT self, wxPoint pos)
SetOrigin(EDA_RECT self, int x, int y)

EDA_RECT::SetOrigin(int x, int y) 

Definition at line 2367 of file

def pcbnew.EDA_RECT.SetSize (   self,
SetSize(EDA_RECT self, wxSize size)
SetSize(EDA_RECT self, int w, int h)

void EDA_RECT::SetSize(int
w, int h) 

Definition at line 2378 of file

def pcbnew.EDA_RECT.SetWidth (   self,
SetWidth(EDA_RECT self, int val)

EDA_RECT::SetWidth(int val) 

Definition at line 2420 of file

def pcbnew.EDA_RECT.SetX (   self,
SetX(EDA_RECT self, int val)

void EDA_RECT::SetX(int val)

Definition at line 2400 of file

def pcbnew.EDA_RECT.SetY (   self,
SetY(EDA_RECT self, int val)

void EDA_RECT::SetY(int val)

Definition at line 2410 of file

Member Data Documentation


Definition at line 2173 of file

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