Uranium
Application Framework
UM.Math.Polygon.Polygon Class Reference

Public Member Functions

def __init__
 
def __eq__ (self, other)
 
def __repr__ (self)
 
def isValid (self)
 
def getPoints (self)
 
def project (self, normal)
 
def translate
 
def mirror
 
def scale
 
def intersectionConvexHulls
 
def unionConvexHulls
 
def intersectsPolygon
 
def getConvexHull (self)
 
def getMinkowskiSum
 
def getMinkowskiHull
 
def isInside (self, point)
 

Static Public Member Functions

def approximatedCircle
 

Detailed Description

A class representing an immutable arbitrary 2-dimensional polygon.

Member Function Documentation

def UM.Math.Polygon.Polygon.__repr__ (   self)
Gives a debugging representation of the polygon.

This lists the polygon's coordinates, like so::
[[0,0], [1,3], [3,0]]

:return: A representation of the polygon that is useful for debugging.
def UM.Math.Polygon.Polygon.approximatedCircle (   radius,
  num_segments = 8 
)
static
Return vertices from an approximate circle.

An octagon is returned, which comes close enough to a circle.

:param radius: The radius of the circle.
:return: A polygon that approximates a circle.
def UM.Math.Polygon.Polygon.getConvexHull (   self,
  Polygon 
)
Calculate the convex hull around the set of points of this polygon.

:return: The convex hull around the points of this polygon.
def UM.Math.Polygon.Polygon.isInside (   self,
  point,
  bool 
)
Whether the specified point is inside this polygon.

If the point is exactly on the border or on a vector, it does not count
as being inside the polygon.

:param point: The point to check of whether it is inside.
:return: True if it is inside, or False otherwise.
def UM.Math.Polygon.Polygon.project (   self,
  normal,
  Tuple,
  float,
  float 
)
Project this polygon on a line described by a normal.

:param normal: The normal to project on.
:return: A tuple describing the line segment of this Polygon projected on to the infinite line described by normal.
The first element is the minimum value, the second the maximum.

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