Skip to main content

A package for creating and drawing trees

Project description

https://img.shields.io/pypi/v/tree.svg?style=flat-square https://img.shields.io/pypi/l/Tree.svg?style=flat-square

Python package, which you can use to generate and drawing trees, realistic or fractal ones.

Usage

$ pip install Tree
from math import pi, radians as rad
from Tree.core import Tree
from PIL import Image

branches = (
    (.5, rad(-30)),
    (.6, rad(30)),
    (.4, rad(60))
)

def main():
    tree = Tree(
        pos=(0, 0, 0, -500),
        branches=branches
    )

    # Let the tree grow
    tree.grow(10)

    # Move the tree in the right position, so that the tree is completly in the image
    tree.move_in_rectangle()

    im = Image.new("RGB", tree.get_size(), (239, 239, 239))
    tree.draw_on(im, (85, 25, 0, 128, 53, 21), (0, 62, 21), 10)
    im.show()

if __name__ == '__main__':
    main()
https://raw.githubusercontent.com/PixelwarStudio/PyTree/master/images/example.png

Documentation

The documentation is hosted on Readthedocs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Tree-0.2.4.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file Tree-0.2.4.tar.gz.

File metadata

  • Download URL: Tree-0.2.4.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Tree-0.2.4.tar.gz
Algorithm Hash digest
SHA256 f84d8ec9bf50dd69f551da78925a23d110864e7706551f590cdade27646f7883
MD5 590864875614d427a8f913776941259c
BLAKE2b-256 293f63cbed2909786f0e5ac30a4ae5791ad597c6b5fec7167e161c55bba511ce

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page