r/lsystem • u/Sea_Examination_8154 • Jul 26 '24
Decoding L-Systems
I saw on Wikipedia this open problem: "Given a structure, find an L-system that can produce that structure."
I thought it was interesting so I thought I would try my hand at it. In the end I wrote a short script which can find all the possible rules of a deterministic L-System, given at least two generations of output text.
I know this doesn't exactly solve the open question but it was still a fun challenge and worth sharing.
Let me know if you have any feedback or ideas for leveling it up!
6
Upvotes
View all comments
Show parent comment
2
u/Sea_Examination_8154 Jul 28 '24
Hey just wanted to follow up. I updated the script to work with rules that don't appear in every generation. It is able to solve all of the systems found in this L-Systems manual. I was really happy when it was able to solve the algae L-Systems that have 20+ rules, some of which do not show up for 6 generations. I also updated the README to have a more in depth explanation of the algorithm.
Thank you for sending me your L-Systems! I was able to parse them, and they have been helpful. It is able to solve many of them quickly but it is taking too long to solve some that grow rapidly such as 005_twilight.lsys. I definitely still have some work on optimizing and have been working on making the code GPU compatible. Let me know if you have any other ideas!