upxo.meshing.gbconformant.d3v2p1.guard_relaxation module

Re-smooth geometry-guard rollback regions under the guard’s own checks.

The geometry guard pulls defective neighbourhoods back toward voxel coordinates by a per-node weight. The step in weight at the edge of a rollback region leaves creases. This optional stage applies further Laplacian steps to rolled-back nodes and a margin of neighbouring nodes only, and keeps a node’s move only while every changed triangle stays free of intersections, facet openings below minimum_facet_angle, orientation reversal or collapse relative to the voxel triangles, and RVE-plane clearance. Fixed junction points, fixed coordinates (RVE planes, frozen grains) and junction-line displacement limits are kept exactly as in smoothing. A full intersection scan certifies the result.

d3v2p0.guard_relaxation with the intersection search on the d3v2p1 tiers; the rules and the report are d3v2p0’s and the result is identical to its result.

upxo.meshing.gbconformant.d3v2p1.guard_relaxation.fold_counts(points, triangles, grain_pairs, thresholds=(150.0, 120.0), exclude_grain_ids=(), incidence=None)[source]

d3v2p0.guard_relaxation.fold_counts with the edge table from integer keys (incidence: the EdgeIncidence of triangles when the caller has it).

upxo.meshing.gbconformant.d3v2p1.guard_relaxation.relax_guarded_interfaces(surface, smoothed, dimensions, enabled=True, iterations=20, relaxation=0.35, junction_relaxation=0.25, margin_rings=2, minimum_facet_angle=1.0, boundary_clearance=0.025, junction_max_displacement=None, exclude_grain_ids=(), progress=None, n_workers=None, backend='auto', track_history=False)[source]

Return (Interfaces, report) after relaxing the guard’s rollback regions.

surface is the geometry-guard output and smoothed its input; both share triangles, original_points, node_kind, fixed_axes and junction_edges. exclude_grain_ids only affects the fold counts in the report. backend / n_workers: see d3v2p1.backend (None = automatic); the result does not depend on them.