Module pinky :: Class BoundingBox

Class BoundingBox

object --+    
         |    
     Shape --+
             |
            BoundingBox

An axis-aligned rectangle for representing shape boundaries.

See: http://www.w3.org/TR/SVG/coords.html#ObjectBoundingBox

Instance Methods
 
__init__(self, min_x=inf, min_y=inf, max_x=-inf, max_y=-inf)
Initialize a bounding box from the given minima and maxima.
 
__nonzero__(self)
Is the bounding box non-empty?
 
__repr__(self)
repr(x)
 
add(self, shape)
Expand the bounding box to contain the given shape.
 
intersects(self, other)
Do the two bounding boxes intersect?

Inherited from Shape: transform

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  bounding_box
The bounding box itself.
  width
The width of the bounding box.
  height
The height of the bounding box.
  area
The area of the shape.
  centroid
The mass center of the shape.

Inherited from object: __class__

Method Details

__init__(self, min_x=inf, min_y=inf, max_x=-inf, max_y=-inf)
(Constructor)

 

Initialize a bounding box from the given minima and maxima.

Overrides: object.__init__

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

Property Details

bounding_box

The bounding box itself.

Get Method:
unreachable.bounding_box(self) - The bounding box itself.

width

The width of the bounding box.

Get Method:
unreachable.width(self) - The width of the bounding box.

height

The height of the bounding box.

Get Method:
unreachable.height(self) - The height of the bounding box.

area

The area of the shape.

Get Method:
unreachable.area(self)

centroid

The mass center of the shape.

Get Method:
unreachable.centroid(self)