-
Notifications
You must be signed in to change notification settings - Fork 5
A library for manipulating hexagonal grids.
License
alextingle/libhex
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
libhex - a library for manipulating hexagonal grids.
Output to Scalable Vector Graphics (SVG) is supported. SVG can be viewed
directly in most modern web-browers, or converted to PNG or JPG using
readily-available utilities.
By default, the grid is orientated with the main "x" axis horizontal ('West'
to 'East). The six directions are labelled A to F anti-clockwise. Direction
'A' is 'East' along the x-axis. 'B' is 'North-East' and so-on.
If you prefer a different scheme (perhaps with the main axis running 'South'
to 'North', or with clockwise as the positive direction) then simply use
SVG transformations to rotate or mirror the grid as necessary.
libhex is written in C++, and the main interface is in that language. A
Python interface is implemented using SWIG. Other language interfaces (Ruby,
TCL, whatever) could also be easily achieved with SWIG. If you do any work in
these other languages, then let me know.
A JavaScript version of the library is also available (hex.js). This is a
100% re-implementation in JavaScript. It enables Ajax applications to
manipulate the SVG directly.
Most libhex objects (Hexes, Areas, Paths) can be represented as simple
text-strings. This makes it easy to store them, or for client-server (Ajax)
applications to communicate about them in high-level terms. See the
documentation for details.
Download: https://github.com/alextingle/libhex/downloads
Author: Alex Tingle <[email protected]>
About
A library for manipulating hexagonal grids.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published