8.2.2 Functions defined in the coords module

bbox( objects)
Compute the bounding box of a list of objects.

All the objects in list should have This is like the bbox() method of the Coords class, but the resulting box encloses all the Coords in the list. Objects returning a None bbox are ignored.

coordsmethod( f)
Decorator to apply a Coords method to a 'coords' attribute.

Many classes that model geometry use a 'coords' attribute to store the coordinates. This decorator can be used to apply the Coords method to that attribute, thus making the Coords transformations available to other classes.

The following lines show how to use the decorator. These lines make the 'scale' method of the Coords class available in your class, with the same arguments.

@coordsmethod def scale(self,*args,**kargs): pass

The coordinates are changed inplane, so if you want to save the original ones, you need to copy them before you use the transformation.