upxo.meshing.gbconformant.d3v2p0.mesh module
Shared voxel tetrahedra with constrained Laplacian relaxation.
Array axes are physical x, y, z; voxels occupy [i, i+1] * spacing. All integer labels, including zero and negative labels, are grains.
- upxo.meshing.gbconformant.d3v2p0.mesh.quality(points, tets)[source]
Signed volume and mean-ratio quality (regular tetrahedron = 1).
- class upxo.meshing.gbconformant.d3v2p0.mesh.Mesh(points: numpy.ndarray, tetrahedra: numpy.ndarray, grain_ids: numpy.ndarray, boundary_triangles: numpy.ndarray, boundary_grains: numpy.ndarray, exterior: numpy.ndarray, node_kind: numpy.ndarray, fixed_axes: numpy.ndarray, original_points: numpy.ndarray, history: list, quality_history: list = <factory>, quality_before_optimization: numpy.ndarray | None = None)[source]
Bases:
object
- upxo.meshing.gbconformant.d3v2p0.mesh.mesh_voxels(labels, spacing=1.0, iterations=20, relaxation=0.35, min_quality=0.5, quality_iterations=60, quality_displacement=0.35)[source]
Mesh every voxel with six conforming tetrahedra, then relax globally.
Surface nodes average surface neighbors; junction line nodes average only neighbors on their junction line. Branch/end points and >=4-grain nodes are frozen. Interior nodes average volume neighbors. Backtracking enforces positive volumes and the requested mean-ratio quality floor globally. The initial mesh must meet that floor; otherwise a ValueError is raised. A subsequent tangential quality optimization runs for quality_iterations steps (0 disables it), with motion bounded by quality_displacement times the smallest voxel spacing from the post-Laplacian geometry.