Expand description
JSON serialization for face records and face matches.
Provides two output formats controlled by the --diagonal flag:
§Default format (lo/hi)
Face bounds use ascending lo/hi keys. Every match includes a
permutation_index (0-7) indicating which PERMUTATION_MATRICES
entry transforms face B to match face A.
{
"block1": { "block_index": 0, "lo": [0,0,0], "hi": [0,101,33] },
"block2": { "block_index": 30, "lo": [0,0,0], "hi": [0,101,33] },
"permutation_index": 3
}§Diagonal format (--diagonal)
- In-plane matches (perm 0-3): block2’s
lb/ubencodes traversal direction.permutation_index: -1(direction is fully in the bounds). - Cross-plane matches (perm 4-7): ascending
lb/ubbounds with the actualpermutation_index, since lb/ub can’t encode a swap.
{
"block1": { "block_index": 0, "lb": [0,0,0], "ub": [0,101,33] },
"block2": { "block_index": 30, "lb": [0,101,33], "ub": [0,0,0] },
"permutation_index": -1
}Functions§
- face_
match_ to_ diagonal_ json - Convert a
FaceMatchto diagonal JSON format. - face_
match_ to_ json - Convert a
FaceMatchto JSON (lo/hi+permutation_index0-7). - face_
record_ to_ diagonal_ json - Convert a
FaceRecordto JSON with ascendinglb/ubbounds. - face_
record_ to_ json - Convert a
FaceRecordto JSON with ascendinglo/hibounds. - permutation_
matrices_ json - Serialize the 8 permutation matrices as a JSON array (for inclusion in output headers).