https://github.com/lqr471814/fractal-turtle
A python turtle program that can render fractals using L-Systems. Customization is handled with .json files and there are a few presets included.
https://github.com/lqr471814/fractal-turtle
fractals l-systems python turtle
Last synced: 2 days ago
JSON representation
A python turtle program that can render fractals using L-Systems. Customization is handled with .json files and there are a few presets included.
- Host: GitHub
- URL: https://github.com/lqr471814/fractal-turtle
- Owner: LQR471814
- Created: 2020-05-23T22:42:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-21T02:54:09.000Z (over 4 years ago)
- Last Synced: 2025-06-08T09:05:31.433Z (4 months ago)
- Topics: fractals, l-systems, python, turtle
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fractal-Turtle
A python turtle program that can render fractals using L-Systems. Customization is handled with .json files and there are a few presets included.
## Command Line Arguments
### **Required**
#### `-s | --settings Ex. ./presets/plants/seaweed.json`
Path to your fractal configuration JSON file.
### **With Defaults**
#### `-l | --length Default: 20`
Length of each line drawn
#### `-i | --iterations Default: 5`
The number of fractal iterations
#### `-eH | --export-scale-horizontal Default: 10000`
Specify the horizontal scale of the .svg file (Yes this is a thing)
#### `-eV | --export-scale-vertical Default: 10000`
Specify the vertical scale
### **Optional**
#### `-e | --export Ex. True`
Export the fractal as an .svg file
#### `-v | --verbose Ex. True`
Enable debugging
## L-System Configuration Files
Using configuration files one can create custom fractals in the format of L-Systems and render them with Fractal Turtle.
JSON Format
```JSON
{
"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.
## External Dependencies
svgwrite -