Link to the YouTube video about this project is here
This program aims to take photos of each side of your rubik's cube and give you the solution while also simulating it in 3-D space. Using openCV, numpy, matplotlib, colormath, and many other technologies, never before has solving a rubik's cube been as easy as it is right now. Take a look at the youtube video explaining the creation of this project and a short tutorial on how to use it.
To use the Rubik's Cube Solver, follow these steps to set up the project:
- Clone this repository to your local machine:
git clone https://github.com/RajPandya737/Rubiks-Cube-Solver.git
- Change to the project directory:
cd Rubiks-Cube-Solver
- The project utilizes many libraries such as openCV, numpy, pillow, colormath, matplotlib, and many more. Ensure you have all of them downloaded by running
pip install -r requirements.txt
- Change to the main directory:
cd RubiksCubeSolver
- Run the program, please read the usage part of this file before continuing:
python main.py
To use the Rubik's Cube Solver, follow the installation steps:
-
Start with a scrambled rubik's cube you do not know how to solve
-
Run the file, and you will be asked to calibrate your cube, if this is your first time running the program, it is highly recommended.
-
If you choose yes, scan the center of each face of the desired color the camera window asks, it will appear as the title of the window:
-
You will then be shown a tutorial of how to use the program, here is a quick recap, when showing the sides with a center color yellow or white, red should face upwards, in all other cases, white should be facing upwards.
-
Scan your cube in any order you like, just follow the rules from step 4
-
A window will appear with your cube and its solution, follow the steps and your cube will be solved.
-
For those unfamiliar with rubiks cube notation, this video explains it well: Rubiks Cube Notation Explained
-
If you would like to exit the program at any time, press the 'q' key while the camera is open, or close out of the program with your mouse while the simulation is open.
The project consists of the following files inside of the RubiksCube folder:
main.py
: The main Python script.cube.py
: The file containing the Rubiks cube class and the Cubie class.config.py
: A file containing all constants used in the program.color_diff.py
: A file containing color math operations.matplot_img.py
: A file containing the Img_MPL class.cube_renderer.py
: A file containing the class that renders the cube in MPLcolors.json
: JSON file to store user color dataREADME.md
: This file, providing an overview of the project.
This project is licensed under the MIT License - see the LICENSE file for details.