JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q26486F
  • License Apache-2.0

Create a canvas of a Self-Organising System of cells.

Package Exports

  • hexells
  • hexells/hexells.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hexells) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Hexells

Total NPM Downloads Monthly NPM Downloads

Introduction

Hexells is a Self-Organising System of cells, that was trained to build textures using neighbour communication only. This work exposes the relation between the life of an individual cell, and the cell collective as a whole. The original library belongs to Alexander Mordvintsev, and you can see the demonstration of his implementation here.

The "cell" system is based on Neural Cellular Automata.

Usage

Hexells was designed with widespread usage possibilities in mind. The software can be imported directly via npm, or can be used as a library by generating a single-file bundle with browserify via npm run build.

const canvas = document.createElement("canvas");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

// `Hexells` is in the window scope
new Hexells(canvas);
document.body.appendChild(canvas);

Configuration

Available parameters (within the options argument):

  • brushRadius The size of the brush to use, in pixels. Defaults to 16
  • stepPerFrame The number of steps to take when generating and displaying each frame. Defaults to 1
  • timePerModel The number of milliseconds to wait before generating and displaying a different model. Defaults to 20000
  • responsive Whether or not to respond to input from the client. Defaults to false