Tiling can turns the following code, from README:
from tile import Model, Shape model = Model() model.append(Shape(6, fill=RED)) a = model.add(0, range(6), 4, fill=ORANGE) b = model.add(a, 1, 3, fill=BLUE) c = model.add(a, 2, 6, fill=RED) model.repeat(c) surface = model.render() surface.write_to_png('output.png')
Into this beautiful pattern:
It has some other examples:
There is also a couple of wallpapers ready to be used on 16:9 or 16:10 screen. I can imagine that someone wrapping up a randomly generated wallpaper that changes your desktop wallpaper every now and then.
Unfortunately, it doesn’t work with Python 3, but funny thing is, it still can run, but errors may occur. I ran the main.py and got this error:
$ python3 main.py Traceback (most recent call last): File "main.py", line 137, in <module> main() File "main.py", line 131, in main surface = render(pattern, False) File "main.py", line 76, in render a = model.add(0, [0, 2], 4) + [0] TypeError: unsupported operand type(s) for +: 'range' and 'list'
I thought it just didn’t work, but it turned out still making 14 out of 26 images and they look quite interesting:
An unexpected surprise, if you will.
Tiling is written by Michael Fogleman under the MIT License, currently git-1b41f3b1f169af59d27357262037b4fc34839464 (2014-06-16), works for Python 2 with Pycairo.
Excellent project -I used the surface generated with this tool with some additional code that bridges Pycairo and pygame to display the images in a window (rather than just saving them to a file). Works very well. Thanks for publishing this.
ReplyDelete