Hexalate
A Python library for generating hexagonal tessellations.
Features
- Generate coordinates for individual hexagons
- Create a tessellation that fills a specified area with hexagons of a specific size
- Supports customization of hexagon shape and size
Installation
To use this library, simply install it using pip:
pip install hexalate
Usage
Basic Usage
Import the hexalate module:
import hexalate as hx
Create and visualize a tessellation with the desired width, height, and hexagon size:
tessellation = hx.create_hexagonal_tessellation(width=10, height=5, hex_size=0.5)
hx.plot_hexagonal_tessellation(tessellation)
Generate Hexagon Coordinates
Get the vertices of a single hexagon centered at (x, y) with a given radius:
vertices = hx.hexagon(x_center=1.0, y_center=2.0, size=0.5)
Returns a list of (x, y) tuples for the 7 vertices (closed polygon).
Advanced Usage
Access the raw tessellation data to integrate with your own plotting library:
import matplotlib.pyplot as plt
import matplotlib.patches as patches
tessellation = hx.create_hexagonal_tessellation(width=10, height=8, hex_size=0.6)
fig, ax = plt.subplots(figsize=(10, 8))
for hex_data in tessellation:
ax.add_patch(patches.Polygon(hex_data['coords'], edgecolor='black', facecolor='lightblue'))
ax.autoscale_view()
ax.set_aspect('equal')
plt.axis('off')
plt.show()
Each element in the tessellation list is a dict with keys:
x— center x coordinatey— center y coordinatecoords— list of(x, y)vertex tuples
Command Line
hexalate --width 10 --height 8 --size 0.5
License
This library is released under the MIT License. For more information, see the LICENSE file.
Metadata
Release files for hexalate 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hexalate-0.2.1.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hexalate-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / hexalate-0.2.1.tar.gz
| Download URL | hexalate-0.2.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cc832231419fa5006721b12b5c924b07b949e4bff7c56576441ec5f6b38cdb5
|
|
BLAKE2b-256 checksum How to use checksums |
a9ac51e62eef31d35530a00e27966fac6b4a84fd9a66c64e1d83e7bd7e4be8f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / hexalate-0.2.1-py3-none-any.whl
| Download URL | hexalate-0.2.1-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae0e516248a1f525c9c5fff68bfd4214bdfd75e471df3d585f618e2316b81b41
|
|
BLAKE2b-256 checksum How to use checksums |
4e4054e3e7523ccb0e0c3ca9ace7e372cecef0502643d1e55f5cca4c3c407e0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|