[HN Gopher] L-System Simulations
___________________________________________________________________
L-System Simulations
Author : kretaceous
Score : 49 points
Date : 2023-07-16 15:53 UTC (7 hours ago)
(HTM) web link (eliben.github.io)
(TXT) w3m dump (eliben.github.io)
| napierzaza wrote:
| I've been trying to build plants using procedural generation for
| a project. I feel like everyone suggests L-Systems but I feel
| like it's good for making random alien plants that you can
| vaguely tweak. But they're not good for plants that you actually
| want to make look like something specifically and grow uniquely
| and progressively.
| Rediscover wrote:
| Try to get a copy of the first (and second, third?, for the pic
| of Aristid) proceedings of the artificial life conference. It
| demonstrates what You are searching (real plants).
| drapado wrote:
| Could you elaborate a bit more? Do you mean a paper?
| deosjr wrote:
| http://algorithmicbotany.org/papers/abop/abop.pdf
| napierzaza wrote:
| I will check it out thanks
| Rabidgremlin wrote:
| I have a bunch of plant examples here
| http://blog.rabidgremlin.com/tags/l-systems/
| YeGoblynQueenne wrote:
| The link to Laurens Lapre's LPARSER is dead. Is there a more
| up-to-date one? I couldn't find it with a brief search.
| dalke wrote:
| I can't figure out the grammar. I wanted to do the Hilbert curve
| at https://en.wikipedia.org/wiki/Hilbert_curve:
| 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.
| sp332 wrote:
| The rules are in https://eliben.github.io/lsystem/rules.js and
| the evaluation is in https://eliben.github.io/lsystem/lsys.js
| It looks like f and g are special rules for moving with the pen
| down or the pen up.
| deosjr wrote:
| I tried for a bit and couldn't get it to work either. The
| dragon curve example is a lot more complicated than the
| simplest definition, which is a hint. I don't even know exactly
| what | or [ or ] are supposed to do here.
|
| 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)
| SomeDaysBe wrote:
| I was able to get it working, I think:
|
| axiom: a
|
| rules:
|
| a = +b|-a|a-|b+
|
| b = -a|+b|b+|a-
|
| initial angle: 90
|
| angle change: 90
|
| scale: 1
|
| simulation depth: 4
| dalke wrote:
| That did the trick - thanks! I couldn't figure out what the
| [] meant in this context and thought it was to make a
| recursive call.
|
| (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.)
| SomeDaysBe wrote:
| Wow never heard of space filling curves. Yet another rabit
| hole to go into.
| nick__m wrote:
| nice work! , I will post mine :
| https://m__nick.gitlab.io/l-systems/#Algle
|
| here is the grammar: Pattern Production :
| 0123456789 draw a line [ push turtle state ] pop
| turtle state + turn angle - turn -angle * scale
| direction and distance up / scale direction and distance
| down b brighten d darken c hue color -1
| C hue color +1 [ABD-Z][ae-z] variables for patterns
| rewriting
| atum47 wrote:
| The mobile version can use a tweak, but overall is a pretty nice
| project.
|
| I while back i was trying to come up with interesting rules to
| generate fractals and em up creating a genetic algorithm with you
| as the evaluator.
|
| https://github.com/victorqribeiro/randomFractal
___________________________________________________________________
(page generated 2023-07-16 23:00 UTC)