upxo.meshing.gbconformant.d3v2p0.local_thickness module

Local thickness of labelled voxel grains.

The local thickness of a voxel is the size of the largest ball that lies inside its grain and contains the voxel, as an odd voxel count: 1 for a slab or bar one or two voxels thick, 3 for three or four, and so on. It uses the same convention as thin_freeze’s inscribed thickness (2*r - 1, r the largest distance in voxels from a grain voxel centre to the nearest voxel centre outside the grain), but per voxel: a thick lobe joined by a thin neck has a large value in the lobe and a small value in the neck. A grain cut by an RVE face is treated as continuing beyond it (mirrored), so the box itself does not make grains thin; thin_freeze counts the RVE exterior as outside instead.

upxo.meshing.gbconformant.d3v2p0.local_thickness.local_thickness(labels, mirror_width=8)[source]

Per-voxel local thickness (voxels, odd integers >= 1), same shape as labels.

mirror_width: voxels of mirrored grain added beyond each RVE face a grain touches (thicknesses above about 2 x mirror_width are not resolved there).

upxo.meshing.gbconformant.d3v2p0.local_thickness.node_local_thickness(labels, lattice_points, grain_ids=None, neighbourhood=2)[source]

Local grain thickness at each lattice node.

For each grain at the node, take the largest local thickness among its voxels within neighbourhood voxels of the node; the node value is the smallest of these over the node’s grains. A thick grain’s own corners and edges therefore read thick (their nearby interior is thick), while a thin plate or neck reads thin (none of its nearby voxels is thick).

lattice_points: (n, 3) integer voxel-corner indices (corner (i, j, k) touches voxels (i-1..i, j-1..j, k-1..k)). grain_ids: one set of grain IDs per node (the grains whose interfaces meet there); None uses the grains of the eight touching voxels. Returns (n,) int.