Skip to content

Comments

v0.2.0#22

Merged
huangziwei merged 5 commits intomainfrom
contact_stats
Sep 11, 2025
Merged

v0.2.0#22
huangziwei merged 5 commits intomainfrom
contact_stats

Conversation

@huangziwei
Copy link
Collaborator

@huangziwei huangziwei commented Sep 11, 2025

This PR introduced compute_contact_stats() to skeliner.pair, which computes the following stats of the contact sites:

  • Per-side (stats_A, stats_B), for each patch:

    • extent_long, extent_short (float): 2D in‑plane extents after projecting the patch’s face centroids to a best‑fit plane. Units are mesh units (e.g. nm if your mesh is in nm).
    • aspect (float): extent_long / max(extent_short, eps). Higher ⇒ more elongated; ~1 ⇒ round.
    • roundness (float): 4π·Area2D / Perimeter2D² of the 2D convex hull of projected face centroids. In [0,1] for convex shapes; 1 ⇒ perfect disk.
    • faces_count (float): number of faces in the patch on that side.
    • normal_dispersion (float): 1 − ||Σ(area·n)/Σ(area)||. 0 ⇒ uniform normals (planar/smooth); higher ⇒ more curvature/fragmentation.
  • Pair-wise (stats_pair), for each patch:

    • area_mean (float): from contacts.area_mean (units from contacts.meta['unit']).
    • seed_count (float): number of original seeds mapped to this patch.
    • normal_opposition_dot (float): dot( n̄_A, n̄_B ), where n̄_* are area‑weighted mean normals per side. Range [-1,1]; ≈−1 indicates strongly opposed surfaces, ≈+1 same direction, ≈0 orthogonal.

these stats can be used in filter_contact_sites() to filter out the undesirable patches.


This update marked the completion of the scope of the contact sites detection. So we bump skeliner to v0.2.0, as now skeliner can do two things: skeletonize a mesh (v0.1) and find contact sites between two meshes (v0.2).

@huangziwei huangziwei changed the title v0.1.15: contact sites statistics v0.2.0 Sep 11, 2025
@huangziwei huangziwei merged commit c8570a8 into main Sep 11, 2025
4 checks passed
@huangziwei huangziwei deleted the contact_stats branch October 6, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant