Puzzle Cube (Randomly Generated with Python)

Copyright Claim

Puzzle Cube (Randomly Generated with Python)

Boost
6
12
4

Print Profile(1)

All
P1S
P1P
X1
X1 Carbon
X1E
A1

0.2mm layer, 2 walls, 15% infill
0.2mm layer, 2 walls, 15% infill
1.3 h
1 plate
5.0(3)

Boost
6
12
4
0
12
7
Released

Description

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!

 

Requirements

First install SolidPython and Numpy:

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)

 

For example:

python puzzle_cube.py --size 10 --shape 4 4 4 --stl

 

A puzzle produced with these settings is provided. Enjoy :)

 

Contributing

To contribute, see the Github repo.

Comment & Rating (4)

Please fill in your opinion
(0/5000)

is there a solution to the one bean uploaded?
0
Reply
Print Profile
0.2mm layer, 2 walls, 15% infill
0
Reply
Print Profile
0.2mm layer, 2 walls, 15% infill
0
Reply
Print Profile
0.2mm layer, 2 walls, 15% infill
0
Reply
No more