Skip to content

128f/LSystems

 
 

Repository files navigation

LSystems

A little library for creating and rendering L-Systems. It's a pretty old project.

To compile, just npm install followed by npm run build. This should create an lsystems.js in the root.

There are also a couple basic tests in src/tests

What is an L-System?

It's a string rewriting system, whose output is interpreted as drawing isntructions. For more take a look here

What's inside?

A basic LSystem class, a renderer, and a generator.

For instance:

  (new lsystems.Generator).randomSystem(x);        //return a random LSystem
  (new lsystems.Generator).ruleSetRandom();        //return a random ruleset
  (new lsystems.Generator).randomSystem();         //return a random LSystem
  (new lsystems.Generator).dragonCurve();          //return an LSystem that will render to the famous "dragon curve"

See the index.html for more example code.

About

📔 Experiments with L-systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 76.8%
  • HTML 21.4%
  • JavaScript 1.8%