The engine is quite simple to understand, even if at the start, it looks confusing to build this random triangles. To begin, we use the value given to the constructor to create a regular pattern with proper equilateral triangles. To do that, the script start by generate lines of dots. Then a second pass use these points to generate triangles, and also the color function to generate the color code. Then the last pass use the data to render it in a SVG DOM object.