topotoolbox.gen_random

Contents

topotoolbox.gen_random#

topotoolbox.gen_random(hillsize: int = 24, rows: int = 128, columns: int = 128, cellsize: float = 10.0, seed: int = 3, name: str = 'random grid') GridObject[source]#

Generate a GridObject instance that is generated with OpenSimplex noise.

Parameters:
  • hillsize (int, optional) – Controls the “smoothness” of the generated terrain. Defaults to 24.

  • rows (int, optional) – Number of rows. Defaults to 128.

  • columns (int, optional) – Number of columns. Defaults to 128.

  • cellsize (float, optional) – Size of each cell in the grid. Defaults to 10.0.

  • seed (int, optional) – Seed for the terrain generation. Defaults to 3

  • name (str, optional) – Name for the generated GridObject. Defaults to ‘random grid’

Raises:

ImportError – If OpenSimplex has not been installed.

Returns:

An instance of GridObject with randomly generated values.

Return type:

GridObject