Skip to content

Repository files navigation

MuJoCo 3x3x3 Puzzle Cube

build build

MuJoCo model of a 3x3x3 puzzle cube, along with a script to procedurally generate it. Inspired by the Rubik's Cube.

Requirements

You will need MuJoCo version 3.1.0 or greater to run the model. If you want to use an older version, replace the implicitfast integrator with Euler.

Play with the model

Just drag and drop the cube_3x3x3.xml file into the simulate window.

Generate the model

Dependencies are managed with uv. Run the following to generate the texture atlas and XML file:

uv run build_textures.py  # Creates assets/sticker.png.
uv run build_mjcf.py      # Creates cube_3x3x3.xml.

The whole model uses a single UV-mapped sticker atlas (assets/sticker.png) and a single material. Each cubelet is a mesh carrying texture coordinates that map its faces into the right color swatch; the chamfered bevels map into the black swatch.

Cubelet design

Solidworks was used to design cubelet.stl. It has a dimension of 1.9 cm with chamfered edges of length 1.425 mm. The cube was exported as an STL file and processed with process_mesh.py to obtain the vertices for the mesh attribute in the MJCF file.

About

A 3x3x3 puzzle cube model for MuJoCo.

Topics

Resources

Stars

37 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages