L-System art generator with graphical user interface in Gtk+3 and using Cairo drawing library.
Program reads L-System description from text file in ini
format, generates production string according to it and renders a drawing by interpreting this string with turtle graphics.
Program is intended to work under Linux operating system. Program must be run from bin
folder within directory structure.
src
- source code filesl-systems
- input text files describing L-Systemssvg
- folder for storing drawings as svg filesobj
- compiled object filesbin
- folder with final executable
obj
and bin
folders are created by make
program before compiling source codes.
Program reads from ../l-systems
folder files with .ls
extension and having ini
format:
# Sierpinski triangle
[L-System]
name=Sierpinski triangle
axiom=F-G-G
numRules=2
rule0=F>F-G+F+G-F
rule1=G>GG
angle=120
iterations=6
lineLength=30
closed=1
, where closed
(value can be 0, or 1) means, if drawing path should be closed, i.e. start and end point connected
and other parameters are common for L-System definition.
Drawings can be stored as SVG files in ../svg
folder.
- GNU Make
- pkg-config
- g++
Development packages for GTK3 and Cairo2 libraries - libgtk-3-dev
and libcairo2-dev
packages on Debian-based systems.
Normal packages for those libraries should be installed by default on modern Linux OS.
$ make
Feel free to fork and play with project. Pull requests with enhancements or fixes are also welcome!
For reading ini
files ini-parser is used.
Distributed under the MIT License.