AlphaShape
PyAlphaShape is a Python library for constructing alpha shapes in both
Euclidean and spherical geometries. It supports flexible alpha filtering,
connectivity pruning, and robust geometric computation via scipy.spatial.
- The Euclidean implementation supports n-dimensional data.
- The spherical implementation directly supports latitude–longitude data or any set of unit vectors on the sphere.
Alpha shapes are filtered subsets of the complete Delaunay triangulation, where simplices are retained based on the radius of their circumscribing spheres. The spherical implementation exploits the geometric equivalence between the 3D convex hull of unit vectors and the Delaunay triangulation on the surface of the sphere.
Installation
pip install pyalphashape
Ensure you have Python 3.9 or newer installed.
Example Usage
Euclidean Alpha Shape
from pyalphashape import AlphaShape
import numpy as np
# Generate 2D sample data
points = np.random.rand(100, 2)
# Construct alpha shape with given alpha radius
alpha_shape = AlphaShape(points, alpha=0.1)
# Get edges or simplices of the shape
edges = alpha_shape.perimeter_edges()
triangles = alpha_shape.triangle_faces()
Spherical Alpha Shape
from pyalphashape import SphericalAlphaShape
import numpy as np
# Define latitude and longitude in degrees
# Format: [latitude, longitude]
latlon_points = np.array([
[34.05, -118.25], # Los Angeles
[40.71, -74.01], # New York
[51.51, -0.13], # London
[35.68, 139.69] # Tokyo
])
# Create alpha shape directly from lat/lon
spherical_shape = SphericalAlphaShape(latlon_points, alpha=0.5)
# Extract perimeter points and edges
perimeter_points = spherical_shape.perimeter_points
perimeter_edges = spherical_shape.perimeter_edges
License
PyAlphaShape is open source and available under the MIT license. See the LICENSE file for more info.
Citing this Repository
If you use this project in your research, please cite it as:
Melton, N. (2025). PyAlphaShape (Version 0.1.0)
Metadata
Release files for pyalphashape 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 | Provenance | Actions |
|---|---|---|---|---|
| pyalphashape-0.1.0.tar.gz | 24.6 kB | Without provenance | Details for pyalphashape-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyalphashape-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyalphashape-0.1.0-py3-none-any.whl |
Total release size: 53.4 kB
Release files / pyalphashape-0.1.0.tar.gz
| Download URL | pyalphashape-0.1.0.tar.gz |
|---|---|
| Size | 24.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba81b2e6c9cd3b8d3653306b9f9f57db8b64cb60c975d45895518af06bdf2bcf
|
|
BLAKE2b-256 checksum How to use checksums |
a8d6e6adcd7633072236645c03caaee9530bff26813ea376fefa81f30a1f71a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Release files / pyalphashape-0.1.0-py3-none-any.whl
| Download URL | pyalphashape-0.1.0-py3-none-any.whl |
|---|---|
| Size | 28.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e6ec1ed258a07107ccd9419ddfab509f3b60220dc9cf0c548441879a441eb0f
|
|
BLAKE2b-256 checksum How to use checksums |
464f8c9e41bd8233970faafef11c64c15c49737983f58cdcf07eda478d924ca7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Security for pyalphashape 0.1.0
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.