A naive implementation of the touching perimeter packing algorithm in python.
The example.py
script runs a simple matplotlib animation showing the packing process.
A list of rectangles representing the free space is maintained. For each box the free space with the maximum touching perimeter (left plus bottom) is chosen and the free space updated. The touching perimeter is calculated against previously packed boxes and the initial free space rectangle.