Skip to content

erinpentecost/hex

Repository files navigation

hex logo

Go Report Card Travis CI GoDoc

hex is a Go implementation of hexagonal grid math based on amitp's Hexagonal Grids articles. This package focuses on hexagonal grid math, including:

  • Generating sets of hexes programmatically in common patterns.
  • Compositing sets of hexes with unions, intersections, and subtractions (constructive solid geometry).
  • Multithreaded A* pathing in a hex grid.
  • Fast intersection testing.
  • Super naive drawing package! This isn't performant; it's to help you visualize what's going on.
import (
    // Base library
    "github.com/erinpentecost/hex"
    // For pathfinding
    "github.com/erinpentecost/hex/path"
    // For constructive solid geometry
    "github.com/erinpentecost/hex/area"
)

hex map

References