Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/optimisticpeach/rehexed
Adjacency lists for hexasphere's icospheres
https://github.com/optimisticpeach/rehexed
Last synced: 20 days ago
JSON representation
Adjacency lists for hexasphere's icospheres
- Host: GitHub
- URL: https://github.com/optimisticpeach/rehexed
- Owner: OptimisticPeach
- License: apache-2.0
- Created: 2024-04-30T16:40:24.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-01T15:36:40.000Z (8 months ago)
- Last Synced: 2024-11-16T11:37:37.856Z (about 2 months ago)
- Language: Rust
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE-APACHE2
Awesome Lists containing this project
README
# `rehexed`
This crate is meant to process the output of `hexasphere`'s
icosahedron subdivision (aka `IcoSphere`) into an adjacency
list for use in instances where hexagonal tiles are needed.Such examples include geometry generation, board algorithms
etc.# Usage
Generate an icosphere subdivision:
```rs
use hexasphere::shapes::IcoSphere;let sphere = IcoSphere::new(12, |_| {});
```
Accumulate its indices:
```rs
let indices = sphere.get_all_indices();
```
And then apply the one function:
```rs
let adjacency_list = rehexed::rehexed(&indices, sphere.raw_points.len());
```