upverter/schematic-file-converter — pull request #5 by patrickyeon (2011-11-23 03:06:50+00:00)
Title: Improving Shapes

Most of the code is to give a more consistent treatment of the classes in core/shape.py, treat them more like objects and less like thin wrappers around JSON dicts and lists. JSON output should look the same, and the only method that would need to be changed at the caller would be core.net.shape.Polygon.addPoint().

I've added .bounds() methods where I found them to be applicable. An object's .bounds() method returns ((x0, y0), (x1, y1)) which define two diagonally opposite points of a rectangle that encloses all the elements in that object. It won't work properly for text, I don't know how I would get a measure of the space rendered text would take up. That's probably even writer-dependent.