Skip to content

Rubik's cube solver (2x2, 3x3) with color detection, built with react-native, Swift, Obj-C for iOS only

License

Notifications You must be signed in to change notification settings

Convicted202/Rubikus

Repository files navigation

Rubikus

A full blown React-native iOS app that can scan 2x2x2 and 3x3x3 Rubik's cubes using your phone's camera, render it in 3D and then provide a solution.

Real world example (shot on iPhone 12 Pro)

Rubikus demo

How it works


The provided solution is found based on two algorithms:

  • Two-directional Bread-First Search for 2x2x2
  • Pochman's optimization over Thistlethwaite's algorithm for 3x3x3

This project only works on iOS, because it makes use of a wonderful Apple Vision Framework for rectangle detection.

Initially meant to use OpenCV for color/rectangle detection, but since it requires a lot of Objective-C++, decided to use Vision instead, and it was totally worth it.

React-native is being used due to how easy it is to work with Three.js + expo unimodules, instead of Obj-C/C++ wrapper over OpenGL/OpenGL ES or Metal

It also uses wonderful react-native-vision-camera library and frameprocessors to process camera data in real time.

CIE color space is used for color manipulations, color diff computation (CIEDE2000)

Libraries and Frameworks used:


Note: The app only works on Physical iPhone devices

About

Rubik's cube solver (2x2, 3x3) with color detection, built with react-native, Swift, Obj-C for iOS only

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published