This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Hexagonal grids computing
version 1.0.3
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.3
Committed At 2016-11-16 21:42:06 UTC
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1


Elm Hexagons

An Elm library for hexagonal grids handling, based on the awesome Hexagonal Grids Reference from Red Blob Games and extracted from Tacks source code.

For now this lib is focused on axial coordinates for horizontal (pointy-topped) hexagons.

What's available

Coordinates handling (Hexagons module):

  • Find pixel center of an hexagon: axialToPoint
  • Find hexagon containing a pixel point: pointToAxial
  • Compute "hexagonal distance" between two hexagons: axialDistance
  • Compute line between to hexagons: axialLine
  • Compute all hexagons within distance from an hexagon (area): axialRange

Naive grid storage (Hexagons.Grid module):

  • A grid is a Dict Int (Dict Int a)
  • Get, set and remove data on grid: getTile, createTile, deleteTile
  • List all tiles in grid: getTilesList

What's next

  • Deal with vertical (flat-topped) hexagons
  • Expose cubic functions (split Hexagons main module into coordinates systems' specific modules?)
  • Tests, tests, test!