Git Product home page Git Product logo

elvis's Introduction

elvis

easy l-system visualization.

JS implementation of a parametric l-system rewriting engine with interactive editor and visualization.

Features

  • Visualization of 3D and 2D l-systems
  • Optional parameters (pL-System)
  • Randomization with the rand-keyword. Can be used in a conditions for stochastic l-systems.
  • Multi-character symbol possibilities, like the Color(r,g,b) symbol
  • Interactive parameter editor to open and save current parameters in json-format
  • Automatic camera on the object boundary
  • Trackball navigation with possible autorotation
  • Lighting parametrization via configuration file
  • Optimized for mobile devices

Getting Started

Try it out here or clone this repo and start it as follows:

npm install       # Install project dependencies
npm start         # Compile and launch (same as `yarn start`)

Syntax

The production rules are in the following format:

Symbol: Optional Condition -> New Symbols

A symbol can have multiple parameters. The condition and the parameters of new symbols are evaluated by math.js. See the math.js documentation for syntax and available functions. Currently, mathematical expressions are limited in the usage of brackets since they are interfering with the symbol parameter brackets.

The following symbols are parsed by the turtle:

Function Description
F, F(l), F(l,d) Creates a tube with length l, diameter d in the current color and sets the turtle to the end of the tube. A Diameter of 0 results in a white line
f, f(l) Move the turtle forward by the distance l
Box(l) Creates a cube with length l, but leaves the turtle at the current position
Color(r,g,b) Sets the current color of the turtle
Color Resets the current color of the turtle
EmColor(r,g,b) Sets the current emissive color of the turtle
/, /(d) Rotates the turtle d degrees positively around the X-Axis
\, \(d) Rotates the turtle d degrees negatively around the X-Axis
&, &(d) Rotates the turtle d degrees positively around the Y-Axis
^, ^(d) Rotates the turtle d degrees negatively around the Y-Axis
+, +(d) Rotates the turtle d degrees positively around the Z-Axis
-, -(d) Rotates the turtle d degrees negatively around the Z-Axis
| Rotates the turtle 180 degrees around the Z-Axis
$ Sets the direction of the turtle upwards
[ Pushes the current turtle state on the stack
] Pops the current turtle stack from the stack

If a parameter is left out the default parameters from the GUI are taken.

Built With

Author

  • Timon Höbert

License

This project is licensed under the GNU GPLv3 - see the gpl-3.0.md file for details

Acknowledgments

  • Thanks to Mr. Doob for the inspiration of the tree sculpture.

elvis's People

Contributors

thoebert avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.