Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bonsairobo/ilattice3
Data types, structures, and algorithms for 3D integer lattices (voxels)
https://github.com/bonsairobo/ilattice3
3d voxel
Last synced: 3 months ago
JSON representation
Data types, structures, and algorithms for 3D integer lattices (voxels)
- Host: GitHub
- URL: https://github.com/bonsairobo/ilattice3
- Owner: bonsairobo
- License: mit
- Created: 2020-01-22T06:59:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-23T20:24:24.000Z (over 3 years ago)
- Last Synced: 2024-01-21T04:44:32.253Z (6 months ago)
- Topics: 3d, voxel
- Language: Rust
- Homepage:
- Size: 289 KB
- Stars: 15
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-rust-voxel-gamedev - ilattice3 - data structures for storing and querying over 3d voxel lattices + bonus algorithms (Libraries)
README
# ilattice3: Voxel Structures
**DEPRECATION NOTICE: ilattice3 is being superceded by [building-blocks](https://github.com/bonsairobo/building-blocks)**
`ilattice3` provides many useful types and functions for dealing with voxel
data. The core types are `Point`, `Extent`, and the various "lattice maps,"
which allow storing (or generating), data at each point in a 3D integer lattice.Consider this example which samples a signed distance function at each point
and stores it in a compact vector structure.```rust
fn sphere_sdf(p: &Point) -> f32 {
let d = p.dot(p);(d - 10) as f32
}let sample_extent = Extent::from_center_and_radius([0, 0, 0].into(), 20);
let sampled_sphere =
VecLatticeMap::copy_from_map(&FnLatticeMap::new(sphere_sdf), sample_extent);
```In addition to the `FnLatticeMap` and `VecLatticeMap`, there are:
* `ChunkedLatticeMap`: a sparse lattice map implemented as a "[compressible map](https://github.com/bonsairobo/compressible-map)" of `VecLatticeMap`s
* `PaletteLatticeMap`: a `ChunkedLatticeMap` where data shared between voxels lives in a separate "palette" vectorOther miscellaneous features:
* conversion to/from VOX format
* conversion to/from RgbaImage formatThere are also companion modules:
* [ilattice3-mesh](https://github.com/bonsairobo/ilattice3-mesh): various meshing algorithms for voxel data
* [ilattice3-wfc](https://github.com/bonsairobo/ilattice3-wfc): the Wave Function Collapse algorithm for 2D and 3D lattices