Explore the power of L-Systems
L-Systems.JS on Github Download L-Systems.JS
var lsys = new LSystem('F', { 'F': 'F-F+FF' }); var tree = lsys.iterate(2); console.log(tree); // F-F+FF-F-F+FF+F-F+FFF-F+FF var coords = lsys.draw(Math.PI / 2); console.log(coords); // [[0,0,0], [0,1,0], [1,1,0], ...