Crates.io | rehexed |
lib.rs | rehexed |
version | 0.1.1 |
source | src |
created_at | 2024-04-30 20:31:37.517222 |
updated_at | 2024-05-01 15:37:56.562263 |
description | Adjacency lists for hexasphere's icospheres. |
homepage | |
repository | https://github.com/OptimisticPeach/rehexed |
max_upload_size | |
id | 1225521 |
size | 20,447 |
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.
Generate an icosphere subdivision:
use hexasphere::shapes::IcoSphere;
let sphere = IcoSphere::new(12, |_| {});
Accumulate its indices:
let indices = sphere.get_all_indices();
And then apply the one function:
let adjacency_list = rehexed::rehexed(&indices, sphere.raw_points.len());