by dalke · 3y ago · 0 comments
Alphabet : A, B
Constants : F + −
Axiom : A
Production rules:
A → +BF−AFA−FB+
B → −AF+BFB+FA−
I thought it might be: A=|+[B]|−[A]|[A]-|[B]+
B=|−[A]|+[B]|[B]+|[A]−
but that doesn't work, and I don't know what's wrong.Here's a version in Go instead: https://github.com/deosjr/GenGeo/blob/master/gen/lindenmayer... Which renders into: https://github.com/deosjr/GenGeo/blob/83c77f9433e569b30f71b3... (see Algorithmic Beauty of Plants for way more examples)
axiom: a
rules:
a = +b|-a|a-|b+
b = -a|+b|b+|a-
initial angle: 90
angle change: 90
scale: 1
simulation depth: 4
(I've been working on basic space-filling curves, and came across that Wikipedia page last week, which is about all I know about L-systems.)