Trees | Indices | Toggle frames |
---|
Represents an abstract geometric shape in the 2D space, and can answer questions about proximity or intersection with other shapes.
Implementations are free to restrict the type of geometrical shapes that will accept, by example circles or axis aligned rectangles.
bool |
overlaps(self,
other)
Returns True if overlapping other, False otherwise
|
float |
distance(self,
other)
Returns a float, distance from itself to other;
|
bool |
near_than(self,
other,
near_distance)
Returns a boolean, True if distance(self, other)<=near_distance
|
bool |
touches_point(self,
x,
y)
Returns True if the point (x,y) overlaps the shape, False otherwise
|
bool |
fits_in_box(self,
packed_box)
Returns a boolean, True if the shape fully fits into the axis aligned
rectangle defined by packed_box, False otherwise.
|
4-tuple of floats |
minmax(self)
Returns the smallest axis aligned rectangle that contains all shape points.
|
Cshape |
copy(self)
Returns a copy of itself
|
Returns a float, distance from itself to other;
Not necessarily euclidean distance. It is distances between boundaries.
Returns the smallest axis aligned rectangle that contains all shape points.
The rectangle is expressed as a 4-tuple of floats (minx, maxx, miny, maxy) Such a rectangle is also know as the Axis Aligned Bounding Box for shape; AABB for short.
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Wed Oct 26 10:00:13 2011 | http://epydoc.sourceforge.net |