Skip to main content

Functions for working with a hexagonal settlers of catan grid

This module implements the coordinate system described in Robert S. Thomas’s PhD dissertation on JSettlers2, Appendix A. See the project at https://github.com/jdmonin/JSettlers2 for details.

Supports Python 3. Might work in Python 2.

See hexgrid.py for thorough documentation.

> Author: Ross Anderson ([rosshamish](https://github.com/rosshamish))

### Installation

` pip install hexgrid `

### Usage

See https://github.com/rosshamish/catan-spectator for extended usage.

The module is a soup of functions which compute various transforms on tile, node and edge coordinates. Functions are well documented - read function names and docstrings in the code for more info.

### Coordinate System

The coordinate system is the one described in Robert S. Thomas’s PhD dissertation on JSettlers2, Appendix A. See the project at https://github.com/jdmonin/JSettlers2

The idea is that there are three things: tiles, nodes, and edges.

All three have integer coordinates.

Tiles also have identifiers, which range from 1 through 19.

The coordinates are such that it’s easy to compute a tile, node, or edge’s neighbours by adding and subtracting. See the dissertation and/or the code for details.

### Maps

  • Tile identifiers

![tile order](doc/images/tile_order.png)

  • Tile coordinates

![tile coords](doc/images/tile_coords.png)

  • Node coordinates

![node coords](doc/images/node_coords.png)

  • Edge coordinates

![edge coords](doc/images/edge_coords.png)

### License

GPLv3

Metadata

Release files for hexgrid 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hexgrid 0.2.1
File Size Uploaded Provenance
hexgrid-0.2.1.tar.gz 4.8 kB Without provenance Details

Release files / hexgrid-0.2.1.tar.gz

Download URL hexgrid-0.2.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e660dd691754262a532322c7a08ac783144894eaef9c9e9a386d2f8e771e31c
BLAKE2b-256 checksum
How to use checksums
dbcac6e63f1a984c364ac47bf8216eb55467ac251772143f57767c8f30ec2555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for hexgrid 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page