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
1
vote
0 answers

Procedural modelling classical Chinese visions of political order

The problem I’m dealing with at the moment involves a system described in the Guanzi. A large section of the book is about how governments should work to extract a surplus from the economy which they can redistribute to ensure the loyalty of…
Jen
  • 21
  • 4
1
vote
1 answer

Can I use a regex capturing group to prevent successive matches of that group?

I have written a Javascript interpreter based on regular expressions. Is it possible to use capturing groups to prevent a successive match from evaluating any previously captured matches. Example: I start with a string X. Here are two replacement…
dugla
  • 12,774
  • 26
  • 88
  • 136
1
vote
1 answer

L-Systems and the stack in Maya

So I understand the rules of an L-System and I've managed to create a Sierpinski Triangle. I'm now moving onto making different styles of trees. The basic rules of this would be: F: Draw forward +: Rotate right by angle -: Rotate left by angle [:…
TheCoder95
  • 44
  • 7
1
vote
0 answers

Using SVG "pixels" for retina displays

So I want to make a tool like this http://www.kevs3d.co.uk/dev/lsystems/ Each of the pixels in these l-systems are meaningful, so ideally I would want to be able to be able to pan/zoom and I would want it to look good on retina. My idea for this…
1
vote
1 answer

"Maximum call stack size exceeded" error while implementing Fractal plant in processing JS

I am trying to implement a fractal plant (up-till level - 6) in processing javascript. I get "Maximum call stack size exceeded" error even though the base conditions are being met. Here is the code: First function custom draw line draws line on…
1
vote
3 answers

How to create a simple l-system in Processing

I want to create a simple l-system in Processing. I want to change every letter 'A' to 'AB' and every letter 'B' to 'A', starting with 'A'. The result should look something like this: A → AB → ABA → ABAAB → ABAABABA → etc... (P.S. I don't know…
m.prcssng
  • 43
  • 1
  • 5
1
vote
2 answers

Find right scale to draw an iteration of L-system

I made an OCaml program which draws on a Graphics window the representation of a given l-system using his definition,his commands interpretation and iteration. The drawing is made using Turtle graphics(the turtle can draw a line,move to a given…
user3129482
  • 109
  • 1
  • 7
1
vote
1 answer

Writing (translating) from L-Systems production rules (theory) to Python's turtle graphics (practice)

The problem is that I don't really know how to start writing the code. I need a starting point. I do know how to apply an rewriting production rule to one single parametre, for instance the Koch curve. The problem comes when the number of production…
Ramon Blanquer
  • 392
  • 3
  • 8
  • 22
1
vote
2 answers

How to generate 3d trees in any given point and direction in space with C++ and L-Systems?

I am programming in C++ a 3d scene in which trees can be "grown" in any point and in any direction. I find the L-systems trees/planets look very nice but I cannot google some function or library that can let me pass a point coordinate, a direction…
Gagiel
  • 45
  • 5
0
votes
0 answers

Generate L-System training data with automated labelling

I am posting this because I am clueless on how to proceed and I am sure there is an easy solution to my problem. I want to generate training data for a YOLOv7 network. My data is based on L-system grammar. The basic idea is that I have 8 (or more)…
Anna
  • 1
0
votes
1 answer

p5js Layering issue with createGraphics in WEBGL

I am having some difficulty placing assets and objects into my sketch. Currently the two issues that I am having are that the plant needs to display in front of the plane, and that there is a slight issue without how I am clearing the canvas. For…
Jean
  • 35
  • 5
0
votes
0 answers

Inverting / Reversing an L-system fractal

Inverting / Reversing an L-system fractal I have a fractal created by the Rule set below What Rules / Axioms do I need to change to reverse the points so the points facing outward face inward and vice a versa. See animation below on the right that…
Rick T
  • 3,349
  • 10
  • 54
  • 119
0
votes
0 answers

Is there an easy way to draw in Elm using the L-system?

I found little information about drawing using the L-system in Elm. There is an L-system library but it is not up do date really, all I have found that could be useful is a turtle graphics library (https://github.com/mrdimosthenis/turtle-graphics)…
hunorg
  • 31
  • 3
0
votes
1 answer

How do I instantiate a 3D game object around line renderer(for an L system)

I'm working on a 3D tree generation using l systems. I got my L system to generate trees using line renderers. But I don't know how to generate it as a 3D mesh. I tried taking the transform.position of each line and instantiating a mesh in their…
0
votes
1 answer

How do I replace Line Renderers with meshes or prefabs/Instantiate meshes or prefabs on top of Line Renderers?

I am working on an L system to generate trees, and my algorithm works fine. I made it so that that the L-System I'm working on displays itself as Line Renderers. The full code is as follows: public class TransformInfo{ public Vector3 position; …