heightmap-contours

Generate a series of 2D contour meshes over a heightmap

Usage no npm install needed!

<script type="module">
  import heightmapContours from 'https://cdn.skypack.dev/heightmap-contours';
</script>

README

heightmap-contours

stable

Generate a series of 2D contour meshes over a heightmap.

Usage

NPM

layers = heightmapContours(heightmap, [options])

heightmap is a 2D ndarray representing the heightmap. Its size ("shape") will determine the resolution of the final output.

Accepts the following options:

  • slices: the number of slices to make through the heightmap, hence the number of output layers.
  • border: boolean value. If true, add a border to the edges to ensure that all of the resulting layers are manifold (i.e. contain no gaps or forks). Defaults to true.

Returns an array of simplicial complexes, one for each layer starting from the top.

See Also

License

MIT, see LICENSE.md for details.