canonical

Function canonical 

Source
pub fn canonical(n: V3) -> V3
Expand description

Flip n so its largest-magnitude component is positive, so a face and its antipodal opposite collapse onto one direction. Ties break x, y, z. A NaN component never wins a comparison, and -0.0 < 0.0 is false, so neither flips the vector.

The same rule as clash’s canonical (rust/clash/src/canonical.rs), which is TS-parity-locked and so cannot be shared; canonical_parity_tests pins the two together bit for bit.