Slicer Discord
Puzzle Cube (Randomly Generated with Python) – 3D printable model from Thingiverse Thingiverse

Puzzle Cube (Randomly Generated with Python)

by Keeeal
14 Downloads
16 Likes
0 Makes
Go to Model
I wrote this code as an exercise in procedurally generating 3D-printable objects.

The algorithm creates six pieces that fit together to form a cube. Since the puzzle is randomly generated, even the puzzle’s creator can have the satisfaction of solving it for themselves!

For a full description of the algorithm, see [the blog post](https://jameskeal.com.au/procedurally-generating-puzzles-with-openscad-and-python).

### Requirements

First install [SolidPython](https://github.com/SolidCode/SolidPython) and [Numpy](https://numpy.org/):

```
pip install solidpython numpy
```

### Usage

To run the script:

```
python puzzle_cube.py [--size SIZE] [--shape X Y Z] [--stl]
```

Optional arguments:

- *size* — The size-length of a single cell in the puzzle. Default: 10 mm.
- *shape* — The dimensions of the puzzle. Default: (4, 4, 4)
- *stl* — Attempt to generate STL rather than SCAD files. (Requires [OpenSCAD](https://www.openscad.org/))

For example:

```
pyt
Source
Thingiverse
What you need to print this: Beginner Low confidence
Why?
print-in-place design
Print-in-place
Supports 1/3
Assembly 0/3
Settings 1/3
Bed size 0/3
Post-process 0/3
Printer
FDM / FFF
File format
STL
Material
Software
Cura, PrusaSlicer, or similar
Same designer, more platforms

Keeeal also publishes on

1 additional models across 1 more platforms

Verified by matching model titles across platforms.
No ratings yet
No comments yet – be the first!

Similar Models

4 Suggestions
Feed Blog Slicer Cost Calculator Image Search Submit Kontakt Discord ☕ Buy me a coffee
DE EN FR ES IT NL

Add to Collection