A python turtle program that can render fractals using L-Systems. Customization is handled with .json files and there are a few presets included.
Path to your fractal configuration JSON file.
Length of each line drawn
The number of fractal iterations
Specify the horizontal scale of the .svg file (Yes this is a thing)
Specify the vertical scale
Export the fractal as an .svg file
Enable debugging
Using configuration files one can create custom fractals in the format of L-Systems and render them with Fractal Turtle.
JSON Format
{
"line":["F"],
"axiom":"F--F--F",
"angle":60,
"rules":[
{"value":"F", "equation":"F+F--F+F"}
]
}
Example from snowflake.json
The line
array defines which variables will make the turtle draw a line.
The axiom
string defines the starting value of the fractal.
The angle
integer defines the angle left or right at each turn.
The rules
array holds the rules that the fractal will follow.
Each map inside of the rules
array has a key named value and a key named equation. Value holds the value that will be replaced by the equation every iteration.
svgwrite - https://pypi.org/project/svgwrite/