### 2 releases

0.1.1 | May 1, 2024 |
---|---|

0.1.0 | Apr 30, 2024 |

#**829** in Algorithms

**MIT/Apache**

10KB

143 lines

`rehexed`

`rehexed`

This crate is meant to process the output of

's
icosahedron subdivision (aka `hexasphere`

) into an adjacency
list for use in instances where hexagonal tiles are needed.`IcoSphere`

Such examples include geometry generation, board algorithms etc.

# Usage

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``(``)``)``;`

###
`lib.rs`

:

`rehexed`

`rehexed`

This crate is meant to process the output of

's
icosahedron subdivision (aka `hexasphere`

) into an adjacency
list for use in instances where hexagonal tiles are needed.`IcoSphere`

Such examples include geometry generation, board algorithms etc.

# Usage

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``(``)``)``;`

#### Dependencies

~69KB