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
0
votes
1 answer

How do I instantiate an object based on the ending of a string? (This is for an L System)

So I'm working on this L system, and I have it set up like this: private const string axiom = "X"; private string currentString = string.Empty; I am calling a method called Generate. private void Generate() { currentString = axiom;…
0
votes
1 answer

Assembling a string and returning it with lifetime parameters for a l-system

I'm trying to implement a L-System struct and am struggling with it. I already tried different approaches but my main struggle comes from lifetime of references. What I'm trying to achieve is passing the value of the applied axioms back to my system…
0
votes
1 answer

How to do recursion in a L-system inspired rewrite System, without DCG

I am trying to write a tiny recursive rewrite system inspired by Aristid Lindenmayers L-System basically to learn Prolog as well as to think about generative concepts in Prolog. I would like to achieve this without DCG. Due to the initial generate.…
Carsten H
  • 831
  • 15
  • 32
0
votes
0 answers

What is the appropriate usage of the length factor in an L-System?

I'm just starting out with procedural generation and I've made a program that generates lines using a D0L-systems by following Paul Bourke's website. For the first two simple examples it works great, but when I input the rules of the L-System Leaf,…
B4RN154N
  • 51
  • 2
  • 7
0
votes
1 answer

dragon curve with L system using recursion in java

I want to compute dragon curve till n = 10 in java with L system using recursion. For example, Replace all F characters with F-H Replace all H characters with F+H dragon(0) = F-H (this is the input) dragon(1) = F-H-F+H dragon(2) =…
pikaraider
  • 187
  • 1
  • 14
0
votes
2 answers

Why is this L-System only drawing a straight line?

I'm trying to write a program that generates strings, and then draws certain lines based on what character in the string is next. I believe it is generating the strings correctly as I've checked a few iterations by hand, but the turtle I'm using…
Eli Rees
  • 178
  • 2
  • 14
0
votes
2 answers

How to make a Java GUI paint on demand only?

My application is meant to draw a tree using L-Systems. I start with an axiom, provide a rule for what should replace what in the next generation. I use a combination of JFrame/JPanel for one button (maybe more in the future)/JComponent for the…
Hajduk
  • 1
  • 1
0
votes
1 answer

Create the Sierpinski Pyramid with a L-system

The Wikipedia page for L-Systems describes many of them, including a couple rules that converge toward the Sierpinski triangle. That particular fractal also has a 3D version, which basically uses pyramids instead of triangles. Is there a way to…
Kaito Kid
  • 983
  • 4
  • 15
  • 34
0
votes
1 answer

OpenMusic: L-System tree generation using lisp

I am trying to work with a compositional tool called OpenMusic, which is a graphical development environment based on common lisp, and it uses something called "rhythm trees". I am trying to create rhythm trees using a set of rules and in OM this…
kureta
  • 478
  • 4
  • 15
0
votes
2 answers

Strange L-system in python turtle graphics

I tried to use the turtles module in Python 3 to recreate the fractal found here: https://en.wikipedia.org/wiki/L-system#Example_7:_Fractal_plant but whenever I try it it gives me a very strange result... Here's my code: import turtle wn =…
Vladimir Shevyakov
  • 2,511
  • 4
  • 19
  • 40
0
votes
1 answer

GNU parser Optimization Using L-System

Any suggestion on how to use Lindenmeyer System approach (L-System) to make the GNU parser faster through parallelism. I also need to compare the normal execution time and execution time when the L-system is implemented for the C language. Any…
Ankush Singh
  • 560
  • 7
  • 17
0
votes
1 answer

Swift L-System Algae

So this is just something I'm doing for fun in the IBM Swift sandbox. I did a L-system algae in Scala recently and though it would be cool to do it in Swift to see how the language…
I2obiN
  • 181
  • 3
  • 18
0
votes
0 answers

Image similarity index for plant images produced by L-system fractal

I have read all that staff about image similarity index on that forum but i think that my subject is kind different because images that i want to compare comes from an L-system generator and as you can see bellow it's hard to find obvious…
F.N
  • 401
  • 4
  • 21
0
votes
1 answer

Dragon Curve in Python Order 10

Why does my Dragon curve not look like a dragon curve? Here is the implementation in python with order 10: def setupForDragonCurve(): turtle.hideturtle() turtle.tracer(1e3, 0) turtle.penup() turtle.goto(0,…
jsetting32
  • 1,632
  • 2
  • 20
  • 45
-1
votes
1 answer

Why doesn't my program generate the dragon curve?

I've written a program that uses an L-System to draw fractals. It appears to work for the Sierpinski triangle, but not for the dragon curve. I'm aware there are a few questions on the site about using turtle graphics to create a dragon curve but…
Eli Rees
  • 178
  • 2
  • 14