A comprehensive graphical and command-line editor for creating, manipulating, and visualizing Lindenmayer systems (L-systems).
This project was initially developed as part of a university project.
L-systems (Lindenmayer systems) are a type of formal grammar introduced by biologist Aristid Lindenmayer in 1968. They are particularly useful for modeling plant growth and generating fractals. An L-system consists of:
- An alphabet of symbols that can be used to make strings
- An axiom (initial string) to start with
- A set of production rules that expand each symbol into a larger string of symbols
Through recursive application of these rules, complex structures can be generated from simple initial conditions.
- Interactive GUI for creating and editing L-systems
- Command-line interface for batch processing and automated workflows
- Real-time visualization of the L-system at different development levels
- Export capabilities to PS (PostScript) format for now
- Customizable rendering with adjustable parameters (colors, margins, dimensions)
- Save and load L-system definitions using
.ls
files
alr install lsystem_editor
- Ensure you have Ada and GtkAda installed. This project depends on GNAT Lib.
- Clone the repository:
git clone https://github.com/Heziode/lsystem-editor.git
- Build with Alire:
alr build
or manually withmake
Launch the graphical interface:
./bin/lsystem_editor
# Or
alr run
The GUI offers:
- A text editor area for defining L-system rules
- Controls to adjust the development level
- Real-time visualization of the L-system
- Export options
- Customization of colors and rendering parameters
For automated processing or batch operations:
lsystem_editor --no-gui [OPTIONS]
Option | Long Form | Description |
---|---|---|
-i |
--input=FILE |
Input file containing an L-system definition |
-o |
--output=FILE |
Output file to store an L-system definition |
-e |
--export=FORMAT |
Export format for the L-system representation |
-p |
--export-file=FILE |
Output file for the exported representation |
-d |
--develop=N |
Number of development steps to apply |
-w |
--width=N |
Width of the output representation |
-h |
--height=N |
Height of the output representation |
-b |
--background-color=COLOR |
Background color in hex format (e.g., #AABBCC) |
-f |
--foreground-color=COLOR |
Foreground color in hex format (e.g., #AABBCC) |
-mt |
--margin-top=N |
Top margin for rendering |
-mr |
--margin-right=N |
Right margin for rendering |
-mb |
--margin-bottom=N |
Bottom margin for rendering |
-ml |
--margin-left=N |
Left margin for rendering |
L-system definitions are stored in .ls
files with the following syntax:
<angle> [angle in degrees]
<axiom> [initial string]
<rules>
[symbol] [replacement string]
[symbol] [replacement string]
...
</rules>
60.0
-F++F++F
F F-F++F-F
Where:
F
means "draw forward"+
means "turn left by angle"-
means "turn right by angle"
- Text Editor: Define and edit your L-system
- Validate Button: Check if your L-system definition is valid
- Level Spinner: Adjust the development level
- Color Controls: Change foreground and background colors
- Export Options: Save visualizations
L-System Editor is distributed under the MIT License.
Copyright (c) 2018 Quentin Dauprat (Heziode)
See the LICENSE file for full details.