Questions tagged [l-systems]

A Lindenmayer System (l-system) is a way of representing growth processes, most commonly associated with plant development and fractals.

An L-system works off of the principal of recursive application of some production rules to a given axiom.

For example, given some axiom:

ω = "ABCDEFG"

And the production rules:

P = {p(1),p(2),p(3)}

p(1) : "A" -> "CA"
p(2) : "B" -> "BH"
p(3) : "F" -> "XYF" 

Applying the production rules to the axiom for 3 iterations would give the following output:

i = 1 : ω = "CABHCDEXYFG"
i = 2 : ω = "CCABHHCDEXYXYFG"
i = 3 : ω = "CCCABHHHCDEXYXYXYFG"

After generating the L-system output, the string is sent to a geometry generator, Turtle geometry being one of the most commonly used. The turtle geometry parses the string and according to each individual symbol in the string will perform some maneuvers in the Cartesian coordinate space it occupies.

For example, the turtle may turn left/right, pitch up/down, roll left/right, and move forward or backwards. The turtle often incorporates symbols to save it's current state to a stack in order to return to its previous positions.

The Wikipedia article describes the systems for 1-D Algae population growth, Pythagoras Tree, Cantor Dust, Koch Curve, Sierpinski Triangle, Dragon Curve, and a simple Fractal Plant.

The classic text, The Algorithmic Beauty of Plants by Lindenmayer and Prusinkiewicz is available here along with many, many related papers all of which are copiously and beautifully illustrated.

61 questions
7
votes
3 answers

Information on L-Systems

I am about to start a project for university to build a procedural city for a pre existing project. I was wondering if any of you have had any experience coding L-Systems before and know a good place for me to start out. I have done a bit of work…
5
votes
1 answer

L System Node Rewriting example

This is my first post in stackover flow. Recently I started reading the book called "Algorithmic beauty of plants" where, in chapter 1, he explains L system. (You can read the chapter here). So as I understand there are two types of L systems. Edge…
5
votes
2 answers

J and L-systems

I'm going to create a program that can generate strings from L-system grammars. Astrid Lindenmayer's original L-System for modelling the growth of algae is: variables : A B constants : none axiom : A rules : (A → AB), (B → A) which…
Dan Oak
  • 704
  • 1
  • 7
  • 26
4
votes
2 answers

Overlapping trees in L-system forest

I created an a program using python's turtle graphics that simulates tree growth in a forest. There's 3 tree patterns that are randomly chosen, and their starting coordinates and angles are randomly chosen as well. I chose some cool looking tree…
mdegges
  • 963
  • 3
  • 18
  • 39
4
votes
1 answer

restoring recorded state in l-system code using turtle graphics

I'm using turtle graphics to reproduce l-systems (TurtleWorld library). The rules I have tried to apply work well when they don't involve going back to a previous saved state, but whenever there is a [ and ] (see rule below), things break and the…
L-R
  • 1,214
  • 1
  • 19
  • 40
4
votes
2 answers

Designing L-System data structures (C++)

I'm trying to design data structure for an implementation of L-System rewriting engine in C++ and I just can't seem to get anywhere :(. I need to store a string of symbols (characters). There are be several types of symbols (that's specified by the…
4
votes
1 answer

Fractal tree in modern OpenGL (OpenGL 3.3 and above)

I need an approach to draw a 3D fractal tree with modern OpenGL. Any suggestions? I don’t necessarily require full source code, just an idea how to do it. What I'm trying to do is to make a 3D tree. In fixed-function OpenGL it's not so difficult to…
Zoltán
  • 678
  • 4
  • 15
3
votes
0 answers

Is there a known algorithm to convert L-Systems to Iterated Function Systems?

The problem statement is as follows: "Given an L-System with an alphabet set, an axiom, a set of rewriting rules, and a set of geometric rules in bijection with the alphabet set, how do we find the equivalent set of Iterated Function System (IFS)…
3
votes
2 answers

Resources on realistic procedural leaf generation with variegation

I know there exists a lot of material on the procedural generation of plants and the like, especially using L-systems etc. But after a quick research, I haven't been able to find any good / in-depth material on the structure of leaves. Specifically,…
Kelley van Evert
  • 1,063
  • 2
  • 9
  • 17
3
votes
2 answers

Applying a (possibly unary) function recursively onto itself

I am trying to express an L-system in Haskell https://en.m.wikipedia.org/wiki/L-system, specifically Lindenmayer's original L-system for modelling the growth of algae. variables : A B constants : none axiom : A rules : (A → AB), (B → A) …
Filip Allberg
  • 3,941
  • 3
  • 20
  • 37
3
votes
1 answer

Ogre Rendering + Vertex Shaders

Assuming I have a 3d object in my world looking like something below.. http://en.wikipedia.org/wiki/File:Graftal3.png I also have a node storing the information on how to draw for example... http://en.wikipedia.org/wiki/File:Graftal4.png How do I go…
Chris Condy
  • 626
  • 2
  • 9
  • 25
2
votes
1 answer

Dragon Curve in Python

I created a program to draw a dragon curve using turtle graphics.. but my result doesn't really look like the picture does in the link: One problem I noticed is that I want to save the produced string into the variable newWord.. but I can't use…
mdegges
  • 963
  • 3
  • 18
  • 39
2
votes
1 answer

problem converting LSystems code from p5js to HTML Canvas javascript

I'm trying to convert this Daniel Shiffman tutorial from p5js to html5 canvas without a library: var angle; var axiom = "F"; var sentence = axiom; var len = 100; var rules = []; rules[0] = { a: "F", b: "FF+[+F-F-F]-[-F+F+F]" } function…
2
votes
1 answer

How do I find beginning/end vertices of branches on an L-Systems tree? (p5.js)

I'm trying to get the x, y coordinates of branch endpoints on a simple L-Systems tree. The idea is to create a p5.Vector(x, y) and push it to an array. Right now, I'm able to draw ellipses marking the desired points by setting their origin to (0,…
2
votes
1 answer

Tree generation using L-systems and Python turtle

I'm trying to generate a simple tree using an L-system. However, when I run the code that I have: import turtle def generate(length): sentence = "F" for j in range(1, length): for i in sentence: if i == "F": …
Newbie
  • 23
  • 5
1
2 3 4 5