4 ms·
Lindenmayer Systems
- Izmaki 3y agoHow do I make it draw pretty things? What to I type in?
- noufalibrahim 3y agoThese are quite beautiful. I remember I was on a "fractal" high when I first discovered graphics programming and relied on the exercises in this book https://archive.org/details/advancedfractalp0000stev https://archive.org/details/advancedfractalp0000stev It had a chapter on L-systems with some very nice examples. One of my earliest programs which I put online was a Tkinter based GUI to do this. https://github.com/nibrahim/PFractL https://github.com/nibrahim/PFractL
- fatcow 3y agoOh saw a lot of these when dabbling with fractint. Never could figure out how and why, but they were beautiful nonetheless on my mighty VGA!
- maweki 3y agoRenderers don't support it, but I wonder if it's generally possible to encode such an L-System simply as a self-referencing svg group.
- tgv 3y agoThey need a runtime argument (such as iteration count), otherwise they'll generate indefinitely.
- st_goliath 3y agoI first heard about L-Systems a number of years ago in the context of an elective masters course on computer graphics, where we briefly touched on approaches for procedural geometry generation. The way it was introduced to us, was to basically apply a parsing grammar backwards, IIRC using an iterative match-and-generate approach, to produce a command stream for a renderer. I remember finding the idea of using a parsing grammar in this way quite interesting and wondered about other areas where this could be used. For some reason, programmable shell-completion came to my mind, i.e. encode a command line options for a program using a recursive grammar with "expand a file path here" or "call an external helper (e.g. git)" as terminal symbols. Throw in capture groups for terminals and this kills most use cases where the imperative approach in Bash gets very tedious. I keep recalling that idea from the back of my mind every time I see L-Systems featured on HN. I guess/hope most newer shells learnt from Bash and already do something like this, but I honestly was just too lazy to investigate this any further (so far).
- choult 3y agoThe way I understand it is applying Chomsky grammar rules (eg. A -> ABF; B -> CFF) but in singular passes rather than expanding to its full length. Eg: Let --- A -> BFC B -> CF+ C -> F- 0. ABC 1. BFCCF+F- 2. CF+FF-F-F+F- 3. F-F+FF-F-F+F- By drawing/considering these iterations you can model cell/biological growth over time; applying the grammar in its whole immediately would only get you to the end result, plus would never end if you had fractal/infinite sequences.
- eliben 3y agoOoh, I did this too a while ago: https://eliben.github.io/lsystem/ https://eliben.github.io/lsystem/ This has some pre-sets you can examine that draw well-known fractals
- ibizaman 3y ago+1 for the presets.
- choult 3y agoI did a solo project on L-Systems for my bachelors degree at university two decades ago (sadly looks lost to time). Embedding different symbols you can add more than just draw and rotation in one plane: * Rotation in 3D space * Stochastic steps * Stacks to remember where the cursor was and return when done drawing a branch * Depth-limited steps (can simulate gravity's effect on tree branches) With this I was rendering biological life (trees, coral etc) in three dimensions. I also tried applying it to MIDI, with "draw" being play a note, and symbols going up and down the scales. It made for interesting fractal music, but I never figured out the best approach for, say, a decent-sounding fugue.
- larodi 3y agoI designed and teached a bachelors class in Generative Grammar Structures for few years at Sofia University. And L-systems were part of the curriculum. We also had Chris Coyne’s CFDG and Structure Synth in the classes. Interestingly l-systems are semi-Thue grammars, not Chomsky grammars and their inventor was a biologist modelling tree growth. The class made huge impact on everyone’s ability to comprehend discreet math concepts such as state space, regex, FSMs and alike by actually showing these visually. I’m convinced CFdG has to be included in higher school curriculum the same way spatial analysis augments/complements greatly classic geography courses.
- peterldowns 3y agoIf you're interested in L-systems you may also enjoy reading about Shape Grammars. Sort of an evolutionary dead-end in terms of system design, but intriguing. As far as I can tell they were basically superceded by other types of programmatic or parametric design systems. Some references: - http://web.mit.edu/~haldane/www/icerays/ http://web.mit.edu/~haldane/www/icerays/ - https://vincentmai.com/Shape-Grammar https://vincentmai.com/Shape-Grammar - https://wiki.ece.cmu.edu/ddl/index.php/Shape_grammar https://wiki.ece.cmu.edu/ddl/index.php/Shape_grammar - "Shape: Talking About Seeing And Doing" by George Stiny - https://www.slideshare.net/schase56/dcc-2010-grammars-workshop-chaserevisedcompresseshape-grammar-implementations-the-last-35-years https://www.slideshare.net/schase56/dcc-2010-grammars-worksh... - https://www.cambridge.org/core/journals/ai-edam/article/abs/wholegrammar-implementation-of-shape-grammars-for-designers/32A30576739C35DDB14E7DAD7118C1F0 https://www.cambridge.org/core/journals/ai-edam/article/abs/...
- paulownia 3y agoL-Systems are still usefull in plant science if extended a bit. Here a software package one can try: http://www.grogra.de/ http://www.grogra.de/
- peter_l_downs 3y agoThis is great, thank you. Do you actually use this software? I’m very curious to hear about real world applications of these generative systems.
- NelsonMinar 3y agoThis is a fantastic collection of links and makes me wish there were one modern site that summarized all this work, maybe with a working Javascript demo.
- peter_l_downs 3y agoThat's on the long list of blog posts that I've never written. Feel free to start with these and go forward! Make sure to get a physical copy of Shape, it's one of the most baffling textbooks I've ever tried to read.
- motohagiography 3y agoAre simple esolangs like BF also L-systems?
- fallat 3y agoBrainFuck? no. L-systems are a string rewriting language basically. L-systems though are more about the patterns they make when they're interpreted more than anything else.
- BaraBatman 3y agoI once tried my own L-system generator on lisp! Take a look https://github.com/FdelMazo/cl-aristid https://github.com/FdelMazo/cl-aristid
- benvan 3y agoOoh this is one of my favourite topics :). I had a side project a while back which has a few fun presets . You can click-and-drag to animate the pattern by changing its branching angle: http://benvan.co.uk/lsys/#?i=30&r=L%20%3A%20S%0AS%20%3A%20F%3E%2B%5BF-Y%5BS%5D%5DF)G%0AY%20%3A--%5B%7CF-F--FY%5D-%0AG%3A%20FGF%5B%2BF%5D%2BY&p.size=4&p.angle=-3832.29,0.08145300000000245&s.size=8.7,7.53&s.angle=7.7,4&name=re-coil http://benvan.co.uk/lsys/#?i=30&r=L%20%3A%20S%0AS%20%3A%20F%...
- Ajay-p 3y agoThis is really fantastic work!
- beaugunderson 3y agothe ability to change the angle on yours by dragging is so cool!
- phailhaus 3y agoHere's an Observable notebook with a bunch of examples. [1] [1] https://observablehq.com/@kelleyvanevert/l-systems-2 https://observablehq.com/@kelleyvanevert/l-systems-2
- swayvil 3y agoI was really into this a few years back. This particular variety was somewhat famous for a while. http://www.fleen.org/generative_art_project/aza.png http://www.fleen.org/generative_art_project/aza.png Shape grammar building system stuff. IMO it's the coolest thing to happen to 2D geometry since the Cartesian grid. Here's more https://twitter.com/pickover/status/1662465007500574723 https://twitter.com/pickover/status/1662465007500574723
- dang 3y agoRelated. Others? Evolving Lindenmayer Systems - https://news.ycombinator.com/item?id=20588039 https://news.ycombinator.com/item?id=20588039 - Aug 2019 (15 comments) Lindenmayer systems - https://news.ycombinator.com/item?id=16002532 https://news.ycombinator.com/item?id=16002532 - Dec 2017 (9 comments) Four L-system fractals in LaTeX - https://news.ycombinator.com/item?id=9716780 https://news.ycombinator.com/item?id=9716780 - June 2015 (5 comments)
- nick__m 3y agohere's one I did some time ago: https://m__nick.gitlab.io/l-systems/#Multi https://m__nick.gitlab.io/l-systems/#Multi It's not as complete as the one from benvan...
- andrewla 3y agoAlso brings to mind http://recursivedrawing.com/ http://recursivedrawing.com/, which has been discussed here previously: https://news.ycombinator.com/item?id=19680149 https://news.ycombinator.com/item?id=19680149 https://news.ycombinator.com/item?id=16728049 https://news.ycombinator.com/item?id=16728049 https://news.ycombinator.com/item?id=3951255 https://news.ycombinator.com/item?id=3951255
- beaugunderson 3y agoI wrote another interpreter you can see in action here: https://lindenmayer.club/lindenmoji/#?curve=f%0A%0Aa%3D%E2%9E%A1%EF%B8%8F%F0%9F%93%9045%E2%9E%A1%EF%B8%8F15%F0%9F%93%90-45%E2%9E%A1%EF%B8%8F%F0%9F%93%90-45%E2%9E%A1%EF%B8%8F15%F0%9F%93%90-90%E2%9E%A1%EF%B8%8F15%F0%9F%93%90-45%E2%9E%A1%EF%B8%8F%F0%9F%93%90-45%E2%9E%A1%EF%B8%8F7.5%0Ac%3D%F0%9F%93%90-90%E2%A4%B5%EF%B8%8F7.5%F0%9F%93%90-45%E2%A4%B5%EF%B8%8F%F0%9F%93%90180%0Ae%3D%F0%9F%93%90-135%E2%A4%B5%EF%B8%8F50%0A%0Ad%3Dacaed%0A%0Af%3Dd%F0%9F%93%9066%E2%A4%B5%EF%B8%8F150f https://lindenmayer.club/lindenmoji/#?curve=f%0A%0Aa%3D%E2%9... docs here: https://github.com/beaugunderson/lindenmoji/blob/4f55ca78d224b795e5965402ba8304a3c8c6e09a/INSTRUCTIONS.md https://github.com/beaugunderson/lindenmoji/blob/4f55ca78d22...
- dkrajzew 3y agoHmm, my dollar: http://www.alsog.de/ http://www.alsog.de/ Or see the examples page: http://www.alsog.de/feat_examples.php http://www.alsog.de/feat_examples.php
- gowld 3y agoLots of web apps for L-Systems: https://www.google.com/search?q=l-systems+generator https://www.google.com/search?q=l-systems+generator
- karlin 3y agoAlways fun to see an interactive L-System implementation! This one seemed to have odd line weights to me... until I realized that the default F-Reproduction value seems to have a bug: I think it's supposed to be "F[-F]F[+F]F" instead of "F[-F]F[+F][F]"? - https://github.com/rue-a/L-Systems/blob/d725d7da9a2c96afabfc50ad7dadd30d65fb5342/index.html#L73 https://github.com/rue-a/L-Systems/blob/d725d7da9a2c96afabfc...