#voxel #mesh #lattice #chunks #array #maps #sparse

building_blocks_storage

Efficient storage for maps on sparse or dense, 2D and 3D integer lattices

12 releases (6 breaking)

0.7.1 Sep 23, 2021
0.7.0 Jun 14, 2021
0.6.0 Mar 21, 2021
0.5.0 Feb 8, 2021
0.1.0 Oct 26, 2020

#2335 in Algorithms

Download history 2/week @ 2023-12-24 34/week @ 2024-02-18 27/week @ 2024-02-25 17/week @ 2024-03-03 17/week @ 2024-03-10 17/week @ 2024-03-17 16/week @ 2024-03-24 172/week @ 2024-03-31

224 downloads per month
Used in 6 crates

MIT license

365KB
9K SLoC

Various types of storage and indexing for voxels in 2 or 3 dimensions.

If you need to store signed distance values in your voxels, consider using the Sd8 and Sd16 fixed-precision types which implement the SignedDistance trait required for smooth meshing.

The core storage types are:

  • Array: N-dimensional, single resolution, bounded, dense array
  • ChunkMap: N-dimensional, multiple resolution, unbounded, sparse array
    • Backed by generic chunk storage, with HashMap or CompressibleChunkStorage implementations

Then there are "meta" lattice maps that provide some extra utility:

  • TransformMap: a wrapper of any kind of lattice map that performs an arbitrary transformation
  • Func: some lattice map traits are implemented for closures (like SDFs)

For hierarchical indexing and level of detail:

Dependencies

~3–7MB
~100K SLoC