Skip to content

TadaTeruki/fastlem-random-terrain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastlem-random-terrain

A simple random terrain generator using fastlem.

build & run

Using cargo

$ cargo build --release

The binary is generated in target/release/fastlem-random-terrain. If you want to move it into current directory, run the following command.

$ mv target/release/fastlem-random-terrain .

Using docker

$ docker build -t fastlem-random-terrain .

The image is generated as fastlem-random-terrain. To run:

$ docker run -it fastlem-random-terrain fastlem-random-terrain

Command line options can be passed as follows:

$ docker run -it fastlem-random-terrain fastlem-random-terrain --help

Examples

$ fastlem-random-terrain --image-size 300:300

terrain

$ fastlem-random-terrain --colormap-json-filename default_color.json --image-size 300:300

terrain

$ fastlem-random-terrain --colormap-json-filename default_color.json --image-size 300:300 --seed 5000

terrain

Options

$ fastlem-random-terrain --help
Usage: fastlem-random-terrain [OPTIONS]

Options:
  -b, --bound <BOUND>
          Width and height (width:height) of the bound [default: 100.0:100.0]
  -c, --colormap-json-filename <COLORMAP_JSON_FILENAME>
          JSON file of the colormap. If not specified, the grayscale colormap is used [default: ]
  -s, --seed <SEED>
          Seed of the noise generator [default: 0]
  -i, --image-size <IMAGE_SIZE>
          Width and height (width:height) of the image. If -1 is specified, the aspect ratio is the same as the bound [default: 1024:-1]
  -o, --output-filename <OUTPUT_FILENAME>
          File name of the output image [default: terrain]
  -f, --output-format <OUTPUT_FORMAT>
          Output format of the terrain data. Supported formats: png, jpeg, csv [default: png]
  -p, --particle-num <PARTICLE_NUM>
          Number of particles. The larger the value, the more the quality of the terrain is improved [default: 50000]
      --erodibility-distribution-power <ERODIBILITY_DISTRIBUTION_POWER>
          [advanced] Power of the erodibility distribution. The larger the value, the more the erodibility is concentrated on the lower side [default: 4.0]
      --fault-scale <FAULT_SCALE>
          [advanced] Scale of the fault. The larger the value, the more virtual faults effect the terrain [default: 35.0]
      --land-ratio <LAND_RATIO>
          [advanced] Approximate ratio of the land area (0.0-1.0) [default: 0.6]
      --convex-hull-is-always-outlet
          [advanced] If true, the edge points of the terrain are always outlet and its elevation is fixed to 0
      --global-max-slope <GLOBAL_MAX_SLOPE>
          [advanced] Maximum slope angle of the terrain. The larger the value, the more the terrain is rough (radian, max: Pi/2) [default: 1.57]
  -h, --help
          Print help

License

MPL-2.0

About

A random terrain generator based on fastlem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published