This repository contains a simple Python3-wrapper around the opensimplex-go module.
It should be an alternative to the full Python3-implementation of opensimplex.
You first need to either download or build the golang binaries.
-
Build them:
bash src/cmd/build.sh
and/orbash src/lib/build.sh
-
Install example requirements:
pip install -r examples/requirements.txt
-
Test it:
python3 examples/generate_map_cli.py
-
How to use it: Example
This way it basically calls the standalone golang binary in a subprocess and loads the resulting data from a temporary file.
It currently only supports generating whole 2D noise-maps.
Data example:
{
"data": [0, 0, 0.43935, 0, 1, 0.3984343], // x, y, height
"max": 0.43935,
"min": 0.3984343
}
Usage:
Usage of noise_cli:
-size int
Map size (default 1000)
-x float
Map offset dimension-X
-y float
Map offset dimension-Y
-out string
Map output file (default "/tmp/map.json")
-dimensions int
Dimensions (default 2)
-seed int
Seed
-exponentiation float
Exponentiation (default 5)
-height float
Height (default 135)
-lacunarity float
Lacunarity (default 1.5)
-octaves int
Octaves (default 10)
-persistence float
Persistence (default 0.7)
-scale float
Scale (default 50)
-silent
Do not show output
-sink
If the whole noise-map should be sunk-down so the lowest point is 0
-lower float
Lower each height by this value - negatives are clamped to 0
-
Install example requirements:
pip install -r examples/requirements.txt
-
Test it:
python3 examples/minimal_cgo.py
orpython3 examples/generate_map_cgo.py
-
How to use it: Example
The CGO implementation is very slow. Not yet sure why that is..
Thanks to @ojrac for the golang module, to @KdotJPG for the original OpenSimplex and to @simondevyoutube for the implementation-example.
MIT