Add example L-systems as JSON files
This commit is contained in:
parent
55e0f0d82c
commit
3c5ef50b13
11 changed files with 397 additions and 0 deletions
31
examples/dragon.json
Normal file
31
examples/dragon.json
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"name": "dragon",
|
||||||
|
"alphabet": "FX+-",
|
||||||
|
"axiom": "FX",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"X",
|
||||||
|
"X+YF+"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Y",
|
||||||
|
"-FX-Y"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 90.0,
|
||||||
|
"distance": 10.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"F",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
35
examples/gosper.json
Normal file
35
examples/gosper.json
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"name": "gosper",
|
||||||
|
"alphabet": "AB+-",
|
||||||
|
"axiom": "A",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
"A-B--B+A++AA+B-"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"B",
|
||||||
|
"+A-BB--B-A++A+B"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 60.0,
|
||||||
|
"distance": 10.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"B",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
31
examples/hilbert.json
Normal file
31
examples/hilbert.json
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"name": "hilbert",
|
||||||
|
"alphabet": "ABF+-",
|
||||||
|
"axiom": "A",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
"-BF+AFA+FB-"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"B",
|
||||||
|
"+AF-BFB-FA+"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 90.0,
|
||||||
|
"distance": 10.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"F",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
27
examples/koch.json
Normal file
27
examples/koch.json
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"name": "koch",
|
||||||
|
"alphabet": "F+-",
|
||||||
|
"axiom": "F",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"F",
|
||||||
|
"F+F-F-F+F"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 90.0,
|
||||||
|
"distance": 10.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"F",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
27
examples/kochSnowflake.json
Normal file
27
examples/kochSnowflake.json
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"name": "kochSnowflake",
|
||||||
|
"alphabet": "F+-",
|
||||||
|
"axiom": "F",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"F",
|
||||||
|
"F-F++F-F"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 60.0,
|
||||||
|
"distance": 10.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"F",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
27
examples/levyC.json
Normal file
27
examples/levyC.json
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"name": "levyC",
|
||||||
|
"alphabet": "F+-",
|
||||||
|
"axiom": "F",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"F",
|
||||||
|
"+F--F+"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 45.0,
|
||||||
|
"distance": 10.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"F",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
67
examples/penroseP3.json
Normal file
67
examples/penroseP3.json
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{
|
||||||
|
"name": "penroseP3",
|
||||||
|
"alphabet": "MNOPA+-[]",
|
||||||
|
"axiom": "[N]++[N]++[N]++[N]++[N]",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"M",
|
||||||
|
"OA++PA----NA[-OA----MA]++"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"N",
|
||||||
|
"+OA--PA[---MA--NA]+"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"O",
|
||||||
|
"-MA++NA[+++OA++PA]-"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"P",
|
||||||
|
"--OA++++MA[+PA++++NA]--NA"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 36.0,
|
||||||
|
"distance": 10.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"M",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"N",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"O",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"P",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"[",
|
||||||
|
"Push"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"]",
|
||||||
|
"Pop"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
39
examples/plant.json
Normal file
39
examples/plant.json
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
"name": "plant",
|
||||||
|
"alphabet": "FX+-[]",
|
||||||
|
"axiom": "X",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"X",
|
||||||
|
"F[-X][X]F[-X]+FX"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"F",
|
||||||
|
"FF"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 25.0,
|
||||||
|
"distance": 1.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"F",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"[",
|
||||||
|
"Push"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"]",
|
||||||
|
"Pop"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
35
examples/sierpinski.json
Normal file
35
examples/sierpinski.json
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"name": "sierpinski",
|
||||||
|
"alphabet": "AB+-",
|
||||||
|
"axiom": "A-B-B",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
"A-B+A+B-A"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"B",
|
||||||
|
"BB"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 120.0,
|
||||||
|
"distance": 10.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"B",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
35
examples/sierpinskiArrow.json
Normal file
35
examples/sierpinskiArrow.json
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"name": "sierpinskiArrow",
|
||||||
|
"alphabet": "AB+-",
|
||||||
|
"axiom": "A",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
"B+A+B"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"B",
|
||||||
|
"A-B-A"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 60.0,
|
||||||
|
"distance": 10.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"B",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
43
examples/tree.json
Normal file
43
examples/tree.json
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
"name": "tree",
|
||||||
|
"alphabet": "AB+-[]",
|
||||||
|
"axiom": "A",
|
||||||
|
"rules": [
|
||||||
|
[
|
||||||
|
"B",
|
||||||
|
"BB"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
"B[+A]-A"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"angle": 45.0,
|
||||||
|
"distance": 1.0,
|
||||||
|
"representation": [
|
||||||
|
[
|
||||||
|
"A",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"B",
|
||||||
|
"Forward"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"+",
|
||||||
|
"TurnRight"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-",
|
||||||
|
"TurnLeft"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"[",
|
||||||
|
"Push"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"]",
|
||||||
|
"Pop"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue