Skip to main content

Basics

Configurable hex grid on abstract surface.

Example

import hexgrid
import morton

center = hexgrid.Point(0, 0)
size = hexgrid.Point(20, 10)
grid = hexgrid.Grid(hexgrid.OrientationFlat, center, size, morton.Morton(2, 32))
hex = grid.hex_at(hexgrid.Point(50, 50))
code = grid.hex_to_code(hex)
restored_hex = grid.hex_from_code(code)
neighbors = grid.hex_neighbors(hex, 2)
points = [
    hexgrid.Point(0, 0), hexgrid.Point(0, 10),
    hexgrid.Point(10, 10), hexgrid.Point(10, 0)
]
region = grid.make_region(points)
hexes_in_region = region.hexes

Metadata

Release files for hexgrid-py 1.3

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-py 1.3
File Size Uploaded
hexgrid-py-1.3.tar.gz 5.9 kB Details

Release files / hexgrid-py-1.3.tar.gz

Download URL hexgrid-py-1.3.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cda6e37d509fada8f4edeafbae0c0d483d9a5a65afd31c709e39ff3044442cb3
BLAKE2b-256 checksum
How to use checksums
c001e81effbbbefaf211e444d9b48dd0fdf0e95e371161e1d383d309fddb23ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.3 This release

1 release file

1.2

1 release file

1.1

1.0

2 release files

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