0.5.3 • Published 1 year ago

lindenmayer2 v0.5.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Lindenmayer2

Stochastic, Parametric and context-sensitive l-systems with complex symbols.

This lindenmayer-system implementation is not driven by a text-based representation (and manipulation) of state and therefore systems are not limited by needing to be text-encodable. Symbol parameters can be instances of classes for example.

The drawback of this approach is that the production rules and outputs are of course not so easily to read as a simple text representation of state.

Example

import { LSystem, matchSymbol } from "lindenmayer2";

const system = new LSystem({
  initial: [{ symbol: "A" }],
  rules: [
    {
      id: "A",
      condition: matchSymbol("A"),
      successor: [
        {
          symbol: "A",
        },
        {
          symbol: "B",
        },
      ],
    },
    {
      id: "B",
      condition: matchSymbol("B"),
      successor: [
        {
          symbol: "A",
        },
      ],
    },
  ],
});

const tenthIteration = system.getOutput(10);

Credits

  • Inspired by the project lindenmayer by nylki
0.5.3

1 year ago

0.5.0

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago