Skip to content

Face properties

pyvoro2.face_properties

Face-level geometric properties.

This module adds optional post-processing utilities for Voronoi cells returned by :func:pyvoro2.compute.

The core computation in Voro++ is fast and focuses on topology/geometry of the cells. Many downstream geometry workflows benefit from extra per-face descriptors (face centroid, oriented normals, and a few boundary heuristics). These can be expensive, so they are provided as an explicit, opt-in post-processing step.

annotate_face_properties(cells, domain, *, diagnostics=None, tol=1e-10)

Annotate faces with additional geometric properties.

This function mutates the provided cell dictionaries in-place.

Added face fields (when computable): - centroid: [x,y,z] - normal: [nx,ny,nz] unit vector oriented from site -> face - area: float - other_site: [x,y,z] (neighbor site position, including periodic shift) - intersection: [x,y,z] intersection of (site->other_site) line with face plane - intersection_inside: bool - intersection_centroid_dist: float - intersection_edge_min_dist: float

Policy note

We preserve as much information as possible. other_site is only set to None when it cannot be determined (missing neighbor id/shift). Global diagnostics (gap/overlap) are kept external via diagnostics.

Parameters:

Name Type Description Default
cells list[dict[str, Any]]

Output list from :func:pyvoro2.compute.

required
domain Box | OrthorhombicCell | PeriodicCell

Domain used for computation.

required
diagnostics TessellationDiagnostics | None

Optional diagnostics object (not required). If provided, and diagnostics marked faces with local flags (e.g. orphan), those flags are preserved but do not suppress property computation.

None
tol float

Numerical tolerance.

1e-10

:::