Introducing the Procedural Cube Puzzle Generator—an innovative OpenSCAD model designed by majorfrank that allows you to create a virtually infinite number of customizable cube puzzles.
- Infinite Variability: Generate countless unique cube puzzle designs, each one different from the last.
- Fully Customizable: Adjust the size, number of cubes, and complexity to suit your preferences.
- User-Friendly: Designed for easy customization in Parametric Model Maker with simple parameter adjustments.
Parameters
- Number of Cubes: Configure the puzzle dimensions along the X, Y, and Z axes. Be warned a 3x3x3 puzzle can already be challenging
- Max Cubes Per Piece: Limit the number of cubes in one piece to increase or decrease difficulty.
- Custom Seed: Generate reproducible results with a custom seed value or let the system randomize it for endless variations.
- Explode View: Experiment with an exploded view effect for a unique visualization and hint how to assemble your cube.
How It Works
- Initialization: Define the size of the cube grid and the maximum number of cubes in each piece.
- Flood Fill Algorithm: The algorithm starts with the cube at the bottom left point in the cube grid and uses a flood fill method to create a piece. A random neighbor of the current cube is added to the current piece. This continues until there are no neighbors or the Max Cubes Per Piece limit has been reached. The flood fill starts over with the next piece where the new starting point is the next available cube that is not part of a piece.
The randomness ensures that no two puzzles are ever the same, and the number of pieces for each puzzle can vary providing an infinite number of combinations and challenges