qbouniot / l-system

2D and 3D drawing of L-system on python, using the turtle module of python for 2D drawings and "Géotortue" (http://geotortue.free.fr/index.php) for 3D drawings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

L-system with python

2D and 3D drawing of L-system on python, using the turtle module of python for 2D drawings and "Géotortue" (http://geotortue.free.fr/index.php) for 3D drawings

The code of the project is in python/ and the book (pdf version) on which the project is based is located in doc/.

Examples of figures obtained :

With bracketed L-system:

fig2

With stochastic L-system:

  • Two examples at level 4 :

fig3-1 fig3-2

  • And two examples of the same l-system at level 7 :

fig4-1 fig4-2

In 3D:

We can extend the L-system to 3D by adding new symbols to control the rotation of the turtle :

vectors

With this we can now draw flowers :

fig5-1 fig5-2

And by adding parameters to the different growth functions, we can draw real plants. Here we draw the Capsella bursa-pastoris :

  • At level 15 :

fig6-1

  • At level 25 :

fig6-2

About

2D and 3D drawing of L-system on python, using the turtle module of python for 2D drawings and "Géotortue" (http://geotortue.free.fr/index.php) for 3D drawings

License:MIT License


Languages

Language:Python 100.0%