simplex – Simplex noise generation

bravo.simplex.dot2(u, v)[source]

Dot product of two 2-dimensional vectors.

bravo.simplex.dot3(u, v)[source]

Dot product of two 3-dimensional vectors.

bravo.simplex.octaves2(x, y, count)[source]

Generate fractal octaves of noise.

Summing increasingly scaled amounts of noise with itself creates fractal clouds of noise.

Parameters:
  • x (int) – X coordinate
  • y (int) – Y coordinate
  • count (int) – number of octaves
Returns:

Scaled fractal noise

bravo.simplex.octaves3(x, y, z, count)[source]

Generate fractal octaves of noise.

Parameters:
  • x (int) – X coordinate
  • y (int) – Y coordinate
  • z (int) – Z coordinate
  • count (int) – number of octaves
Returns:

Scaled fractal noise

bravo.simplex.offset2(x, y, xoffset, yoffset, octaves=1)[source]

Generate an offset noise difference field.

Parameters:
  • x (int) – X coordinate
  • y (int) – Y coordinate
  • xoffset (int) – X offset
  • yoffset (int) – Y offset
Returns:

Difference of noises

bravo.simplex.reseed(seed)[source]

Reseed the simplex gradient field.

bravo.simplex.set_seed(seed)[source]

Set the current seed.

bravo.simplex.simplex2(x, y)[source]

Generate simplex noise at the given coordinates.

This particular implementation has very high chaotic features at normal resolution; zooming in by a factor of 16x to 256x is going to yield more pleasing results for most applications.

The gradient field must be seeded prior to calling this function; call reseed() first.

Parameters:
  • x (int) – X coordinate
  • y (int) – Y coordinate
Returns:

simplex noise

Raises:

Exception – the gradient field is not seeded

bravo.simplex.simplex3(x, y, z)[source]

Generate simplex noise at the given coordinates.

This is a 3-dimensional flavor of simplex2(); all of the same caveats apply.

The gradient field must be seeded prior to calling this function; call reseed() first.

Parameters:
  • x (int) – X coordinate
  • y (int) – Y coordinate
  • z (int) – Z coordinate
Returns:

simplex noise

Raises:

Exception – the gradient field is not seeded or you broke the function somehow