noise

Simplex noise (like Perlin) for CircuitPython.

  • Author(s): Tod Kurt

Implementation Notes

A basic port of https://weber.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf

No special requirements. Also works in desktop CPython.

class noise.Grad(x, y, z)

Holder for 3D grad. Used internally by noise()

noise.dot(grad, x, y)

Compute dot product of grad against x,y. Used internally by noise()

noise.noise(xin, yin=0)

2D SimplexNoise

Parameters
  • xin (float) – x-location in 2D noise space

  • yin (float) – y-location in 2D noise space

Return float

noise value between -1 and 1.

noise.noise_init()

Initialize permutation arrays. Done automatically on module load