All Projects → dpc → hex2d-rs

dpc / hex2d-rs

Licence: MIT license
Helper library for working with 2d hex-grid maps

Programming Languages

rust
11053 projects

hex2d

Build Status crates.io Gitter Chat
Documentation

Introduction

Library for working with 2d hex map systems.

A lot of ideas taken from redbloggames hexagon page

Read Documentation for details.

See 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 to verify the trustworthiness of each of your dependencies, including this one.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].