Fast 3D Alpha Hull with Label Propagation
Project description
ahull3Dpy
Fast 3D Alpha Hull with Label Propagation
Python port of the ahull3D R package. Computes 3D alpha shapes with label propagation from input points to hull vertices and faces. Optimized for tree segmentation and LiDAR point cloud processing.
Features
- 🚀 Fast C++ core using CGAL
- 🏷️ Label propagation: Input point IDs → hull vertices → faces
- 📦 Easy installation with pre-compiled wheels
- 🔄 Drop-in replacement for ahull3D R package functionality
Installation
pip install ahull3Dpy
Usage
Basic Usage
import numpy as np
from ahull3Dpy import ahull3D
# Generate random 3D points
pts = np.random.randn(100, 3)
pts = pts / np.linalg.norm(pts, axis=1)[:, np.newaxis]
# Compute alpha hull
mesh = ahull3D(pts, alpha=0.5)
print(f"Vertices: {mesh['vertices'].shape}") # (M, 3)
print(f"Faces: {mesh['faces'].shape}") # (F, 3)
With Labels (point IDs)
The input_truth parameter propagates labels (e.g., tree IDs from LAS files) from input points to the hull vertices and faces:
import numpy as np
from ahull3Dpy import ahull3D
# Generate points with labels (e.g., tree IDs from LiDAR data)
pts = np.random.randn(100, 3)
pts = pts / np.linalg.norm(pts, axis=1)[:, np.newaxis]
# Point IDs (e.g., tree IDs from LAS file)
# In real LiDAR data, this would be the 'pid' or 'treeID' field
labels = np.array([1, 2, 3]) # Tree IDs
labels = np.repeat(labels, [33, 33, 34]) # Assign to points
# Compute alpha hull with label propagation
mesh = ahull3D(pts, alpha=0.5, input_truth=labels)
# Access propagated labels
print(f"Vertex labels: {mesh['input_truth']}") # Labels for each hull vertex
print(f"Face labels: {mesh['face_truth']}") # Labels for each face (3 labels per face)
print(f"Unique labels: {np.unique(mesh['input_truth'])}") # Should be [1, 2, 3]
Visualize
from ahull3Dpy import plot_ahull3D
plot_ahull3D(mesh, color='lightblue', opacity=0.7)
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 Distributions
Built Distributions
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 ahull3dpy-1.0.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 183.2 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc96db8b9270a6720abe520493ceb13b598948c402ca9d698a3502294e6bb68a
|
|
| MD5 |
b24b49bc99fba898d23ccd895968b2a6
|
|
| BLAKE2b-256 |
cc78483ae40ce8e4a4c6bcce029a7a6420636b3173b82a7d1fbed8799797c45a
|
File details
Details for the file ahull3dpy-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46c681d073c05ba75e5e744ba731cbbabc18ff68d97f0dbd37944ea4f4cf8959
|
|
| MD5 |
8791b55940514307ed02c99e560b7a6a
|
|
| BLAKE2b-256 |
42c8cf99789926397b3b9680acaabfa1cc25db001a92508c88e52890ddaab3de
|
File details
Details for the file ahull3dpy-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 186.0 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2fded079fde97cf225b578df4075687e06307a21eac9157dd697d042e90234e
|
|
| MD5 |
1daa05451fb1133d65688b432f6a4df2
|
|
| BLAKE2b-256 |
f980548d6d765834642c7bc1aa08e29dc727316050111887c17f7c54ae529f5b
|
File details
Details for the file ahull3dpy-1.0.0-cp312-cp312-macosx_10_13_x86_64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp312-cp312-macosx_10_13_x86_64.whl
- Upload date:
- Size: 198.9 kB
- Tags: CPython 3.12, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0528ae9bcaff68e08c1d134358c650a57dbffd94d10b84c22297c7cbcd5e3231
|
|
| MD5 |
be7de452f91a8a0dfa8726d1fff58c4f
|
|
| BLAKE2b-256 |
5718ed3ea1f367bf5b838d020d25d2c1be6fc661ec5db1a4722265b6185b096f
|
File details
Details for the file ahull3dpy-1.0.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 179.4 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a59a81fb65dd5cff0b171acc21e74ea8271d21f6c24b468be5169a62fb92f98
|
|
| MD5 |
908c877a1e619a099756a66011ad1ba7
|
|
| BLAKE2b-256 |
9969b73f5d94588157438a48eaaf4fb6f8403c3bfd6a50a8b3b7f0279287dbc2
|
File details
Details for the file ahull3dpy-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad6b2fbb68cba25c5198e27fb9d48fde70dc901b909acc2c8594e5cf9f82a6b5
|
|
| MD5 |
4da72a9143424b26126710658dc104f1
|
|
| BLAKE2b-256 |
f0163e49a65bed8f0e359d370ded7110f4b994c7ab5039ee18cc4b4dbc8823a7
|
File details
Details for the file ahull3dpy-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 183.6 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a62274d35f04145252d169d24df14639ae9bbd265cf618f10f9d985386f83b6
|
|
| MD5 |
19d1e598665367951a5d8303b2c6aca6
|
|
| BLAKE2b-256 |
12feda004063b1b95e772160a2aebfc56437013da3499bad0d68fda23544440a
|
File details
Details for the file ahull3dpy-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 199.4 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22f1b1f3ebee595f90d0dc89bf84fb0c63445925032fde3b0f792b9b14970153
|
|
| MD5 |
be5028f3c12f2e8c05fd4ce731fbf34a
|
|
| BLAKE2b-256 |
0194d0fe8a82f7826a4ea0c4f5cdfd430bea07b0ef962ba2cb50c0c3f0b09c99
|
File details
Details for the file ahull3dpy-1.0.0-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 178.6 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ac09351fac93ac56173f920a03122f3f432da31f5644ac52586a39530f87459
|
|
| MD5 |
ba29168b292463452bc1d37edebaf539
|
|
| BLAKE2b-256 |
c58a08d6a537778f93a1ef39ad03a2c6ec6d0ae6f6d9b8e6e6c4570ebf70eb9f
|
File details
Details for the file ahull3dpy-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dd671dca07c15f4f6bffdae2215e1f03c648460e9a3aa03f9a7405bc575bfd5
|
|
| MD5 |
7d2e991e0844f3fb460da1c8a25b7236
|
|
| BLAKE2b-256 |
466524a55e9f935d9fb5c0e3bb93664802296cf5402eff6a2c7592e279316cdc
|
File details
Details for the file ahull3dpy-1.0.0-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 182.3 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28a3f5371e7095c24a1a8a11404e9da3f9e674a482fb29cabc1a832d7eea2812
|
|
| MD5 |
99157787aa419da275a8c87151a77616
|
|
| BLAKE2b-256 |
df1b251c2fa045aa26e3e6dbc82cb86c2515539ebb1ca7dc1482ede922eb22be
|
File details
Details for the file ahull3dpy-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 198.2 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75a8514f7258d1f99b5bdab728ddd250692aaf256c59deeea22ab7b0e7e69c47
|
|
| MD5 |
a8530e4a51ddec28388a9615b9027de7
|
|
| BLAKE2b-256 |
163d6cd130d25e157b30b79d9a807e4f931e00ed8de953c63db114ecf316ec25
|
File details
Details for the file ahull3dpy-1.0.0-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 178.7 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f3ef25148cd3d4e026a5f33985b7f7addf92cf3240065ba734cff8734e8b352
|
|
| MD5 |
923d335e23069359139af7bc548fbbc6
|
|
| BLAKE2b-256 |
64555b4896b2a0d0ff35a9cdd815566fe72a3166e51057c291d4b93c01da7aab
|
File details
Details for the file ahull3dpy-1.0.0-cp39-cp39-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e99bf3138638a21f7d37a9ede41046e60ff8009d5912fe468187a330a5608bf
|
|
| MD5 |
4ef24659137306324114ae31573b2116
|
|
| BLAKE2b-256 |
9310652e70e08bf90afb6e0af1643c2af53204a9418a203463aa067f898eea3b
|
File details
Details for the file ahull3dpy-1.0.0-cp39-cp39-macosx_11_0_arm64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 182.5 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5195a7c86f40e012556e0552cd1bf8e036370e9a509e29c4ed6b287606e8aaf3
|
|
| MD5 |
8d5f5d7ca70069b0b9aa3814898d20d9
|
|
| BLAKE2b-256 |
8839ce911fa1f78c4e66ac6df260f963f67f130cd1996d4342e5d57d5511893b
|
File details
Details for the file ahull3dpy-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl.
File metadata
- Download URL: ahull3dpy-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 198.3 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c2ea76911bfb8094f3424171051899c4b2bbdbfe7c618164e08ac0018ee9810
|
|
| MD5 |
a7a0715543498dbc524600ac1b784418
|
|
| BLAKE2b-256 |
9ad799844aee38444950dcddeaf7bfb763a47236b3814f7ad7525aee25c49fb3
|