m

magic-cubes

@preview

Represent Rubik's cubes of arbitrary size and apply algorithms to them

v0.1.0
MIT

Package Information

Last Updated
Categories
visualizationcomponentsfun

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/magic-cubes:0.1.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/magic-cubes:0.1.0": *

Version History

0.1.0
ee16b9731027...

magic-cubes

magic-cubes is a Typst package built on top of CeTZ that allows you to create, manipulate, and render Rubik’s cubes of any size.

See the manual for documentation.

Examples

example cube 04
example cube 05
example cube 06
example cube 07
example cube 08
example cube 09
example cube 10
example cube 11

Quick Start

To start using magic-cubes, add the following import at the top of your .typ file:

#import "@preview/magic-cubes:0.1.0": *

Creating and rendering a solved cube only requires two functions:

#draw-cube(cube())

draw cube

You can apply an algorithm before rendering the cube:

#draw-cube(
  apply(
    cube(),
    "R U R' U'"
  )
)

apply an algorithm

The package supports cubes of arbitrary size:

#draw-cube(
  cube(size: 5)
)

arbitrary size

Changelog

v0.1.0

  • Initial release