- The Wikipedia page of L-systems: https://en.wikipedia.org/wiki/L-system
- Turtle library: https://docs.python.org/3/library/turtle.html
An L-system is defined by: V: the alphabet, a set of symbols that contains variables and constants W: the axiom, it defines the initial state of the system, it's a string P: which defines the rules and ways that we can transfrom symbols.
So we will formalize this in classes, which will contain fundamental information about the fractal object, such as the actions that have to be taken when a symbol is fond or the axiom. As an example, values from the SierpinskiRules class would be:
axiom = "A"
constants = ["+", "-"]
angle = 60
mov_value = 3
rules = {
"A": "B-A-B",
"B": "A+B+A",
}
actions = {
"A":["FORW"],
"B":["FORW"],
"+":["ROTL"],
"-":["ROTR"],
}The particular curves available are:
- Sierpinski's triangle
- Dragon curve
- Koch curve
- Hilbert curve
- Koch snowflake