Simplex noise points map (2D and 3D) generator

Usage no npm install needed!

<script type="module">
  import vesuvius from '';



When working on a new project, I needed a way to procedurally generate points. I used simplex-noise for this and wrote a sort of wrapper for the functionality I needed.

It's open source, so it may be of some help to some of you. The module uses procedural noise (specifically simplex noise) to generate a map (array) of points. These points are noise values exceeding a set threshold. For my use case, these points were stars in a procedurally generated 'universe', but for you they can be anything you want.

So, how does it work?


npm install vesuvius --save

Use it (duh!)

var Generator = require('vesuvius').Generator;

// Create a new Generator object with an integer seed value (4443 in this case)
var generator = new Generator(4443);

You can also pass an options array as the second parameter. These can define boxSize, threshold and dimensions (in the same way as below).

// Set the box size to 10
// For 2D, this means a 10x10 (100) grid
// For 3D this means a 10x10x10 (1000) grid,
// For 4D, this means a 10x10x10x10 (10,000) grid

// Set the threshold value
// All values lower than this will not be added to the map

// Set the dimensions for the generator
// 2: 2D (x,y)
// 3: 3D (x, y, z)
// 4: 4D (x, y, z, w)

And then, generate the map:

// Generate the map
var map = generator.generate();

The result will be something like this (truncated):


Note that the Generator does not cache the map in any way! Calling generator.generate() a second time will recalculate all over again and return the same data regardless (since it's procedural noise), if none of the parameters have changed.


  • 1.0.3 - 19 November 2015
  • Replaced Alea (repo) with MersenneTwister (repo) as the pseudo-random number generator of choice


Copyright 2015 Michiel van der Velde.

This software is licensed under the MIT License.