
Rubik's Cube Solver
This project is an interactive 3D implementation of the Rubik's Cube puzzle with an integrated solving algorithm based on the CFOP method. Using Three.js for realistic 3D rendering, this application allows users to manipulate a virtual 3x3 Rubik's Cube and automatically solve it through a systematic approach that mimics human solving techniques. The solver operates by identifying cube positions, calculating movement plans, and executing rotations until the cube reaches its solved state.
Features
- CFOP Method Implementation: Automated solver based on the popular CFOP method (Cross, F2L, OLL, PLL) used by speedcubers worldwide.
- Manual Cube Manipulation: Intuitive controls for rotating cube faces and layers with mouse interface.
- Realistic 3D Rendering: High-quality Three.js graphics with proper lighting and animations.
- Face Rotation System: Precise clockwise and counterclockwise rotations of any cube face.
- Position Recognition: Accurate identification of edge and corner cube positions and their respective colors.
Simplified Algorithm process
- Cube State Recognition: Identifies the positioning of cubes (edges and corners) and their associated colors.
- Movement Planning: Calculates the sequence of moves required to reach the solved state.
- Transformation Calculation: Determines how to transport cube pieces from their current position to target positions.
- Position Indexing: Maps the relative positions of cubes on each face using cube indices.
- Edge and Corner Solving: Special handling for edge and corner pieces to ensure correct positioning while maintaining the global color scheme.
Stack
• Frontend
- Three.js - A progressive JavaScript framework for building user interfaces.
- [Three.interaction] - Interaction extension for Three.js.
- Bootstrap - Responsive UI components and layout framework ensuring compatibility across devices.
- jQuery - JavaScript library for DOM manipulation and event handling.
- Vite - Next generation frontend tooling for faster development and builds.