flix

0.75.3

Orbit64.V2.Facelets

The facelet bridge of Orbit64 V2: a cube state to its stickers and back.

A facelet string writes the 6 n^2 stickers as the letters U R F D L B, one per facelet, six face fields in that order separated by one space, in the layout of FORMAT.md (facelet face * n^2 + row * n + col). Reading ignores spaces. This is the notation of V1's Orbit64.Net, for every n = 2..15.

The color model writes the letters. The picture model, where every sticker is distinct, writes one base64url symbol per facelet instead: the sticker's index among the stickers of its piece type, and for a fixed center of an odd cube also its rotation. "Picture facelets" in FORMAT-V2.md is normative. A picture string is as long as a color string, with the same six fields.

The slot tables follow the V1 slot convention orbit64-Nxn-draft@1 and its extension to n >= 8 ("Conventions" in FORMAT-V2.md). Three reference tables carry it: the corners and midges of the 5x5x5, and the wings of the 4x4x4. Every other size takes its slots by replacing each axis of a reference facelet, 0 by 0, 1 by the wing depth d, 2 (5x5x5 only) by n / 2, and the last two by n - 1 - d and n - 1. Center orbits come from geometry: the four quarter turn images of a cell, on six faces, ordered by facelet index. Because a piece is numbered by its home slot and the solved cube shows face colors, a piece's colors are the faces of its home slot's facelets, so no color table is needed.

This is the same table as the rule of FORMAT-V2.md ("Conventions"), which takes the 4x4x4 reference for even n and the 5x5x5 reference for odd n. The wings of the 4x4x4 serve every n; a corner uses only the axis values 0 and n - 1, so the corners of the 5x5x5 are those of the 4x4x4 for even n; midges exist only on odd cubes, where the rule takes the 5x5x5. V1's Net confirms the result for n = 2..7, and the Julia program tools/format-v2/facelet_vectors.jl derives the tables from geometry for all n.

A whole-cube rotation is applied to a facelet string through the geometry of FORMAT.md, not through V1's x, z, y composition: frame r is the rotation that moves physical face faces(r)[i] into slot i.

Definitions

def decode(token: String): Result[String, (Entry, String)]§ Source

The registry entry of a token and the facelet string of its state.

def encode(id: Int32, facelets: String): Result[String, String]§ Source

The V2 token of the cube a facelet string shows, for registry entry id.

def fromFacelets(n: Int32, model: Model, pose: Pose, facelets: String): Result[String, Cube]§ Source

The cube state shown by a facelet string, in the pose of pose.

A canonical read turns the cube so that its reference is home first (fixed centers on an odd cube, the DBL corner on an even one) and so accepts any whole-cube orientation. A framed read of an odd cube keeps the orientation as cube#frame; of an even cube, in its corners. Anything that is no reachable cube is an error: wrong counts, a slot that shows no piece, a piece twice, a broken orientation law or parity.

def toFacelets(n: Int32, model: Model, pose: Pose, cube: Cube): Result[String, String]§ Source

The facelet string of a cube state of the type (n, model, pose).

A canonical cube is written in its reference pose. A framed cube of an odd size is that picture rotated by cube#frame; a framed cube of an even size shows its pose in its corners already. The color model writes letters and the picture model base64url symbols.