This repo helps you solve a 3x3x3 Rubik's cube.
- clone the repository:
git clone https://github.com/omcaaaar/Rubiks_cube_solver.git
- Install the dependencies:
pip install -r requirements.txt
- Run the python file
python main.py
Now there are two options. You can either scan the faces of your shuffled cube or you can enter the cube faces manually in utils.py.
If you opt for scanning the faces using webcam, You'll first have to calibrate the cube so that we can recognize the colors accurately based on the surrounding lighting condition. Follow the instructions on the screen to calibrate.
Once the calibration is done, place the cube in the window shown on the screen for scanning the faces. Follow the instructions on the screen for scanning.
Tip: Prefer standard way of holding the cube. i.e front: Red, right: blue, top: white
Note: Make sure the color values shown on the small cube boxes are correct before scanning the next face. If the color values are coming out to be incorrect, try to tilt the cube or change the position a little bit and press 'c'. If the issue persists, kindly consider recalibrating the cube.
Once scanning is done, perform the movements as per shown on the screen. Make sure the current cube posion is aligned with the one shown at the bottom right corner on the screen.
You can also record and store a video of solving the cube. Set the record flag to True in main.py
Line No. 20
1. ANTICLOCK
2. CLOCK
3. D
4. D'