spacecell
Dependency-free spatial hash grid for bucketing points in 2D and 3D space.
A spatial hash grid partitions continuous space into a regular lattice of fixed-size cells. Points that sit close together tend to share a cell, so "which points are near this location?" becomes a lookup over a handful of nearby cells instead of a scan over every point.
Install
pip install spacecell
Usage
from spacecell import SpaceCell
grid = SpaceCell(cell_size=1.0)
grid.extend([(0.0, 0.0), (0.5, 0.5), (5.0, 5.0)])
# Points within one cell of the origin.
grid.neighbours((0.0, 0.0), radius=1)
# [(0.0, 0.0), (0.5, 0.5)]
The grid works in any dimension - pass 3-tuples for 3D, and so on.
Licence
MIT
Release files for spacecell 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spacecell-0.1.0.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spacecell-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.6 kB
Release files / spacecell-0.1.0.tar.gz
| Download URL | spacecell-0.1.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f9a3bd03342bbd7efe51e182626f043fdd6bc0f8d72e2822d36ee99b482a65f
|
|
BLAKE2b-256 checksum How to use checksums |
2864257bf2623b1730207454a9543bf21d6ade8ce84acb7a52fdaeac37ff8c57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / spacecell-0.1.0-py3-none-any.whl
| Download URL | spacecell-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47860aaf69328bc2776e9409a001fcf60a7235cf77632b2f06e90fa8e5c4bc35
|
|
BLAKE2b-256 checksum How to use checksums |
275ae53e56952c2db2af56cd827087d8810355f0a84c47df227684ec49e6d623
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|