Purpose of this post

This post publishes the source code used for the 3×3 cube app. The code is loaded only when you open a file.

Tools used

  • Qt6 (Core, Gui, Widgets, OpenGL, Network) and OpenGL: the 3D cube and the photo import screen
  • Kociemba two-phase search: the C code from muodov/kociemba included as is. It is GPL-2.0.
  • Qwen3-VL-8B-Instruct (transformers, Mac MPS): the VLM scan server. It connects to the app over TCP.

Folder layout

  • src/CubeModel: cube state, rotations, colour classification
  • src/CubeWidget, MainWindow: OpenGL screen and mouse rotation, scramble/previous/next/oracle buttons
  • src/CubePhotoReconstructor: reading 54 stickers from two photos, rule checks, automatic correction
  • src/PhotoImportDialog: photo import, regular and VLM scans, the six-colour ring that appears when a sticker is clicked
  • src/KociembaSolver, Oracle, BeginnerSolver, MoveSolver: solving. Used in the order Kociemba → short search → beginner layer-by-layer.
  • src/TcpCubeVlmClient, vlm_server: VLM scan client and server
  • tools/face_scan_cli.py: a command-line tool for checking colours one face at a time
  • third_party/ckociemba: Kociemba C code

Build with cmake as described in the README. Build outputs, virtual environments, Kociemba table files (cache) and test photos are not included. The 82 test programs were left out because the test photo paths are hard-coded in them.

Full source

42 files · 11,309 lines — open a folder and click a file to load its code.

Project root2 files
CMakeLists.txttext · 405 lines · 20KB

Loading code…

README.mdmarkdown · 47 lines · 1KB

Loading code…

src/21 files
src/BeginnerSolver.cppc++ · 1,095 lines · 34KB

Loading code…

src/BeginnerSolver.hc++ · 11 lines · 250B

Loading code…

src/CubeModel.cppc++ · 536 lines · 19KB

Loading code…

src/CubeModel.hc++ · 64 lines · 2KB

Loading code…

src/CubePhotoReconstructor.cppc++ · 3,353 lines · 133KB

Loading code…

src/CubePhotoReconstructor.hc++ · 62 lines · 2KB

Loading code…

src/CubeWidget.cppc++ · 737 lines · 21KB

Loading code…

src/CubeWidget.hc++ · 108 lines · 3KB

Loading code…

src/KociembaSolver.cppc++ · 172 lines · 5KB

Loading code…

src/KociembaSolver.hc++ · 21 lines · 611B

Loading code…

src/main.cppc++ · 19 lines · 400B

Loading code…

src/MainWindow.cppc++ · 160 lines · 6KB

Loading code…

src/MainWindow.hc++ · 26 lines · 570B

Loading code…

src/MoveSolver.cppc++ · 144 lines · 5KB

Loading code…

src/MoveSolver.hc++ · 28 lines · 760B

Loading code…

src/Oracle.cppc++ · 422 lines · 14KB

Loading code…

src/Oracle.hc++ · 18 lines · 557B

Loading code…

src/PhotoImportDialog.cppc++ · 618 lines · 24KB

Loading code…

src/PhotoImportDialog.hc++ · 62 lines · 2KB

Loading code…

src/TcpCubeVlmClient.cppc++ · 252 lines · 7KB

Loading code…

src/TcpCubeVlmClient.hc++ · 53 lines · 1KB

Loading code…

third_party/15 files
third_party/ckociemba/coordcube.ctext · 366 lines · 14KB

Loading code…

third_party/ckociemba/cubiecube.ctext · 693 lines · 20KB

Loading code…

third_party/ckociemba/facecube.ctext · 130 lines · 4KB

Loading code…

third_party/ckociemba/include/color.hc++ · 7 lines · 144B

Loading code…

third_party/ckociemba/include/coordcube.hc++ · 113 lines · 4KB

Loading code…

third_party/ckociemba/include/corner.hc++ · 10 lines · 248B

Loading code…

third_party/ckociemba/include/cubiecube.hc++ · 68 lines · 2KB

Loading code…

third_party/ckociemba/include/edge.hc++ · 9 lines · 231B

Loading code…

third_party/ckociemba/include/facecube.hc++ · 41 lines · 1KB

Loading code…

third_party/ckociemba/include/facelet.hc++ · 41 lines · 2KB

Loading code…

third_party/ckociemba/include/prunetable_helpers.hc++ · 21 lines · 627B

Loading code…

third_party/ckociemba/include/search.hc++ · 63 lines · 3KB

Loading code…

third_party/ckociemba/prunetable_helpers.ctext · 77 lines · 2KB

Loading code…

third_party/ckociemba/README.mdmarkdown · 6 lines · 189B

Loading code…

third_party/ckociemba/search.ctext · 333 lines · 11KB

Loading code…

tools/1 file
tools/face_scan_cli.pypython · 403 lines · 13KB

Loading code…

vlm_server/3 files
vlm_server/cube_vlm_server.pypython · 488 lines · 16KB

Loading code…

vlm_server/README.mdmarkdown · 21 lines · 732B

Loading code…

vlm_server/requirements.txttext · 6 lines · 72B

Loading code…