Skip to content

Generate a series of 2D contour meshes over a heightmap

License

Notifications You must be signed in to change notification settings

isabella232/heightmap-contours

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Generate a series of 2D contour meshes over a heightmap

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 92.2%
  • HTML 7.8%