https://github.com/dpc/hex2d-rs
Helper library for working with 2d hex-grid maps
https://github.com/dpc/hex2d-rs
Last synced: about 1 year ago
JSON representation
Helper library for working with 2d hex-grid maps
- Host: GitHub
- URL: https://github.com/dpc/hex2d-rs
- Owner: dpc
- License: mit
- Created: 2014-08-31T20:38:18.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2021-08-16T13:58:32.000Z (almost 5 years ago)
- Last Synced: 2025-03-20T08:52:40.699Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 1.47 MB
- Stars: 66
- Watchers: 5
- Forks: 16
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hex2d
## Introduction
Library for working with 2d hex map systems.
A lot of ideas taken from [redbloggames hexagon page][hexagon]
[hexagon]: http://www.redblobgames.com/grids/hexagons/
[hex2d-rs]: http://github.com/dpc/hex2d-rs
[hex2d-dpcext-rs]: http://github.com/dpc/hex2d-dpcext-rs
Read [Documentation](https://docs.rs/hex2d) for details.
See [issues](//github.com/dpc/hex2d-rs/issues/) for TODO and BUGs.
You might be interested in additional functionality provided by [hex2d-dpcext-rs] library.
### Coordinate system
Pointy-topped:
/\
/ \
| |
| |
\ /
\/
-z
+y YZ | XZ +x
--- | ---
--- | ---
--- | ---
YX -x- XY
--- | ---
--- | ---
--- ZX | ZY ---
-x | -y
+z
Flat-topped:
____
/ \
/ \
\ /
\____/
+y -z
\ /
\ YZ /
YX \ / XZ
\ /
-x--------x--------+x
/ \
ZX / \ XY
/ ZY \
/ \
+z -y
## Building
cargo build
## Verification Recommendation
To help with the maintaince, the ownership of this crate is potentially shared between multiple developers.
It is recommended to always use [cargo-crev](https://github.com/crev-dev/cargo-crev)
to verify the trustworthiness of each of your dependencies, including this one.