https://github.com/undertherain/pycontextfree
Pythonic generative art tool
https://github.com/undertherain/pycontextfree
art fractal generative-art
Last synced: 6 months ago
JSON representation
Pythonic generative art tool
- Host: GitHub
- URL: https://github.com/undertherain/pycontextfree
- Owner: undertherain
- License: mpl-2.0
- Created: 2017-09-08T08:53:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-30T05:46:50.000Z (about 1 year ago)
- Last Synced: 2024-12-27T18:03:52.673Z (6 months ago)
- Topics: art, fractal, generative-art
- Language: Python
- Homepage: http://pycontextfree.blackbird.pw/
- Size: 5.08 MB
- Stars: 38
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. role:: bash(code)
:language: bash.. role:: python(code)
:language: python=============
pycontextfree
=============.. image:: https://api.travis-ci.org/undertherain/pycontextfree.svg?branch=master
:target: https://travis-ci.org/undertherain/pycontextfree
:alt: build status from Travis CI.. image:: https://coveralls.io/repos/github/undertherain/pycontextfree/badge.svg?branch=master
:target: https://coveralls.io/github/undertherain/pycontextfree?branch=master.. image:: https://badge.fury.io/py/contextfree.svg
:target: https://badge.fury.io/py/contextfree
:alt: pypi version`CFDG
`_-inspired cairo-based pythonic generative art toolHere is an example of simple code producing stochastic fractal tree:
.. code:: python
from contextfree.contextfree import *
@check_limits
def branch():
line(0,1)
with translate(0,0.9):
with scale(0.7 + rnd(0.15)):
with color(alpha=0.95):
with rotate(-0.3 + rnd(0.3)):
branch()
with rotate(0.3 + rnd(0.3)):
branch()init(canvas_size=(300,300), background_color="#FFFFFF")
with scale(3):
branch()
display_ipython()Here is the output:
.. image:: https://user-images.githubusercontent.com/1635907/30413703-9e585f54-995a-11e7-8566-bdded386be8d.png
:alt: [tree_example]
:align: centerCheck examples folder for more fun stuff.
How do I get set up?
--------------------* ``pip3 install contextfree`` for latest stable release
* ``pip3 install git+https://github.com/undertherain/pycontextfree.git`` for recent development version
* Python 3.6 or later is required