Multi-stat Hausdorff distance for 3D mesh surfaces (min, max, mean, percentile)
Project description
hausdorff-stats
Multi-stat bidirectional Hausdorff distance for 3D mesh surfaces.
Returns min, max, mean, and 95th-percentile distances in both directions — not just the single worst-case number.
Installation
pip install hausdorff-stats
For point-to-cell distance (projects onto triangle surfaces via VTK):
pip install hausdorff-stats[vtk]
Quick start
Point-to-point (numpy arrays)
import numpy as np
from hausdorff_stats import hausdorff_metrics
# Two point clouds of shape (N, 3)
a = np.random.rand(500, 3)
b = np.random.rand(600, 3) + 0.1
result = hausdorff_metrics(a, b)
result.hausdorff # bidirectional Hausdorff distance
result.mean_a_to_b # mean distance from A to B
result.p95_b_to_a # 95th percentile from B to A
result.summary() # dict of all stats (handy for pandas / JSON)
Point-to-cell (VTP mesh files)
from hausdorff_stats import hausdorff_metrics
result = hausdorff_metrics(
"surface_a.vtp",
"surface_b.vtp",
method="point_to_cell",
)
This projects each point onto the nearest triangle cell on the opposite surface, giving more accurate distances for tessellated geometry.
Available statistics
hausdorff_metrics returns a HausdorffResult with:
| Property | Description |
|---|---|
hausdorff |
Bidirectional Hausdorff distance (max of both directed maxima) |
min_a_to_b / min_b_to_a |
Minimum directed distance |
max_a_to_b / max_b_to_a |
Maximum directed distance |
mean_a_to_b / mean_b_to_a |
Mean directed distance |
p95_a_to_b / p95_b_to_a |
95th percentile directed distance |
percentile(q) |
Arbitrary percentile for both directions |
summary() |
Flat dict of all stats |
Raw per-point distance arrays are also accessible as distances_a_to_b and
distances_b_to_a.
License
MIT
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 hausdorff_stats-0.1.0.tar.gz.
File metadata
- Download URL: hausdorff_stats-0.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61b7bbfc0fbb4291d7386c02474bc31ca00d8ac6efb6240ff71d9f4ff0b1dad8
|
|
| MD5 |
ae123a128573c090f3471c2ce7769af1
|
|
| BLAKE2b-256 |
03901d4bb1396675f4174d90d4e5d493625c10347c690f0fc17ebd00deb56266
|
Provenance
The following attestation bundles were made for hausdorff_stats-0.1.0.tar.gz:
Publisher:
publish.yml on rolandshc/hausdorff-stats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hausdorff_stats-0.1.0.tar.gz -
Subject digest:
61b7bbfc0fbb4291d7386c02474bc31ca00d8ac6efb6240ff71d9f4ff0b1dad8 - Sigstore transparency entry: 987886855
- Sigstore integration time:
-
Permalink:
rolandshc/hausdorff-stats@1f8c6e7342394f02cf41b6fa8ba696e377f1470c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rolandshc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1f8c6e7342394f02cf41b6fa8ba696e377f1470c -
Trigger Event:
release
-
Statement type:
File details
Details for the file hausdorff_stats-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hausdorff_stats-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e7133caaf927aa0bcc38c94b3b0871e82e60712821e4a38e5e67d85859c9a01
|
|
| MD5 |
e2eb3ceb24e5902973224d516144d58d
|
|
| BLAKE2b-256 |
9ee8e329f20d1aaad4c693d14a199d80ef42a5ab0ae172d4cfbba9747488bf6f
|
Provenance
The following attestation bundles were made for hausdorff_stats-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on rolandshc/hausdorff-stats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hausdorff_stats-0.1.0-py3-none-any.whl -
Subject digest:
6e7133caaf927aa0bcc38c94b3b0871e82e60712821e4a38e5e67d85859c9a01 - Sigstore transparency entry: 987886911
- Sigstore integration time:
-
Permalink:
rolandshc/hausdorff-stats@1f8c6e7342394f02cf41b6fa8ba696e377f1470c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rolandshc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1f8c6e7342394f02cf41b6fa8ba696e377f1470c -
Trigger Event:
release
-
Statement type: