Skip to main content

verify_translational_periodicity

Function verify_translational_periodicity 

Source
pub fn verify_translational_periodicity(
    blocks: &[Block],
    face_matches: &[FaceMatch],
    delta: Option<Float>,
    axis: char,
    tol: Float,
) -> (Vec<FaceMatch>, Vec<FaceMatch>)
Expand description

Verify face-match list against the grid under TRANSLATIONAL periodicity (e.g. blade-pitch in y, span height in z).

Mirror of verify_periodicity but uses translation instead of rotation: shifts every block by ±delta along axis ('x' | 'y' | 'z'), then for each face_match tries all 8 permutations against the shifted-block grid.

Use this for face_matches that are translationally periodic — i.e., the two faces don’t physically coincide in the original mesh, but they DO coincide once one block is translated by the periodicity vector. CMC009 has translational periodicity in both Y (pitch) and Z (span height); call once for each direction in a cascading pipeline:

let (verified_y, leftover_after_y) =
    verify_translational_periodicity(&blocks, &leftover_from_verify_connectivity, None, 'y', 1.0e-6);
let (verified_z, still_unverified) =
    verify_translational_periodicity(&blocks, &leftover_after_y, None, 'z', 1.0e-6);

delta is the magnitude of the translation along axis.

None triggers PER-MATCH auto-detect: for each face_match, the shift is computed as the difference between the centroids of face A and face B projected onto axis. This is the geometrically-correct per-match displacement and works for both:

  • Same-block self-loops (e.g. block 589’s k=0 ↔ k=4 face, where Δ_z = block-z-extent)
  • Cross-block translational pitch matches (where Δ is the blade pitch in y or the span height in z)

A globally-fixed Some(delta) is supported for callers that want a single mesh-wide pitch — but the per-match auto-detect is generally more robust because it adapts to whatever shift each individual face_match actually requires.

§Returns

(verified, mismatched) — verified face_matches have their FaceMatch::orientation populated with the winning permutation_index and the appropriate OrientationPlane discriminator (InPlane for same-axis matches, CrossPlane for axis-swapped). Mismatched face_matches are returned for the caller to retry against another verifier (e.g., the rotational verify_periodicity).