Expand description
JSON serialization for face records and face matches.
Face records export directed lb/ub corners (raw il/jl/kl and
ih/jh/kh). After face_matches_to_dict, these corners are physically
corresponding: block1’s lb matches block2’s lb in xyz space, and
block1’s ub matches block2’s ub.
The permutation_index (0-7) indicates which PERMUTATION_MATRICES
entry transforms face B’s ascending canonical grid to match face A’s.
It is included as metadata; the directed corners already encode the
corner-to-corner mapping.
{
"block1": { "block_index": 0, "lb": [0,0,0], "ub": [24,408,0] },
"block2": { "block_index": 1, "lb": [408,0,0], "ub": [0,0,24] },
"permutation_index": 5
}§Round-tripping
The write side (face_record_to_json, face_match_to_json) and the
read side (face_record_from_json, face_match_from_json) form a
round-trip pair for the directed-corner JSON format shown above. Because
the struct field layout in FaceRecord (il/jl/kl, ih/jh/kh) does
not match the nested lb/ub array format that downstream tooling
emits, a plain #[derive(Deserialize)] is not sufficient: we parse
manually to honour the directed-corner contract.
Functions§
- face_
match_ from_ json - Parse a
FaceMatchfrom its directed-corner JSON representation. - face_
match_ to_ json - Convert a
FaceMatchto JSON with directedlb/ubcorners. - face_
record_ from_ json - Parse a
FaceRecordfrom its directed-corner JSON representation. - face_
record_ to_ json - Convert a
FaceRecordto JSON with directedlb/ubcorners. - permutation_
matrices_ json - Serialize the 8 permutation matrices as a JSON array (for inclusion in output headers).