A Python package for constructing alpha shapes and alpha hulls for both positive and negative alphas.
Project description
alphashapy
A Python package for constructing 2D alpha hulls for negative alphas. The algorithm is from the paper:
H. Edelsbrunner, D. Kirkpatrick and R. Seidel, "On the shape of a set of points in the plane," in IEEE Transactions on Information Theory, vol. 29, no. 4, pp. 551-559, July 1983, doi: 10.1109/TIT.1983.1056714.
And the implementation relies on Qhull's implementation of Voronoi diagrams, wrapped nicely for Python by Scipy here.
In the future I will try to add alpha shapes for negative alphas as well, today there is no python package that does that.
For alpha shapes with positive alphas, please use alphashape (which also supports higher dimensions) or alpha_shapes, both are great but do not currently (August 2024) support alpha hulls nor negative alphas.
Installation
Install this library using pip:
pip install alphashapy
Usage
import numpy as np
from alphashapy import alphahull_negative_alpha
points = np.random.rand(100,2)
alpha = -1
alphahull_negative_alpha(points, alpha)
Development
To contribute to this library, first checkout the code. Then create a new virtual environment:
cd alphashapy
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
python -m pip install -e '.[test]'
To run the tests:
python -m pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alphashapy-0.2.0.tar.gz.
File metadata
- Download URL: alphashapy-0.2.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
158cac456aa26e752840edd4eb290d37e4e4bfea8d8ac6d9a514244a28717b97
|
|
| MD5 |
7a59098f2a4e6e290e68b568aec990d2
|
|
| BLAKE2b-256 |
983cdaffa5a71d2fa7450ef5f6265a11ba5a417ec56dd5d852b116ef8a3395f8
|
File details
Details for the file alphashapy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: alphashapy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ea55198d8c23ad65ac7c1337e387537192ae50d2715c58447a58c71c5834f33
|
|
| MD5 |
150550bfd7067541a896a4672f81aa25
|
|
| BLAKE2b-256 |
99a70202e090493b1c3de74e49b28026001f291a3fe257de2c641c4e3e2682c7
|