upxo.meshing.gbconformant.d3v2p0.thin_freeze module

Whole-grain freezing from pre-refinement directional voxel thickness.

upxo.meshing.gbconformant.d3v2p0.thin_freeze.detect_thin_grains(labels, *, enabled=True, automatic=True, thickness=1, explicit_ids=(), criterion='axial_run')[source]

Flag thin grain IDs for whole-grain freezing.

criterion=’axial_run’ (default): flag IDs with any axial same-label run <= thickness voxels. Conservative: tips and staircase corners can flag an otherwise large grain, so on real structures it flags most grains. This is an axial voxel criterion, not rotation-invariant medial thickness.

criterion=’inscribed’: flag IDs that are thin everywhere. A grain’s inscribed thickness is 2*r - 1 voxels, where r is the largest Euclidean distance (in voxels) from any of its voxel centres to the nearest voxel centre outside it; voxels beyond the RVE count as outside. Slabs one or two voxels thick give 1, three or four give 3. A grain is flagged when its inscribed thickness <= thickness, so a large grain with a thin tip is not.

All nonnegative IDs, including zero, are grains; the whole ID is frozen.

class upxo.meshing.gbconformant.d3v2p0.thin_freeze.FrozenGeometry(labels, grain_ids, spacing=(1.0, 1.0, 1.0))[source]

Bases: object

Reject changes to protected voxel-face geometry, allowing retriangulation.

Triangles must be axis aligned and cover the same unit voxel faces by area. Polygon clipping checks their entire footprint, not just node samples. Existing manifold/intersection validators remain required (area agreement alone does not rule out overlapping coverage compensated by a hole).

check(surface)[source]
run(function, surface, *args, **kwargs)[source]

Run transactionally; no invalid result is assigned by the notebook.