CubicCraft: A Mesh Stylization Tool
Haoda Li, Puyuan Yi, Victor Li, Zhen Jiang
In this project, we present a stylization tool to automatically manipulate 3D objects into a cubic style. Our tool provides a GPU implementation for Cubic Stylization [Liu and Jacobson 2019]1, while cubify the object while preserving the geometric details. With our tool, 3D artists can create Minecraft-styled objects with ease.
Install and Execute
The code should support all platforms other than Mac M1 chip.
git clone https://github.com/haoda-li/CubicCraft.git
cd CubicCraft
pip install -r requirements.txt
cd main
# If you have a Mac or your computer does not have a GPU
# change gui_taichi.py line 6
# from ti.init(arch=ti.gpu)
# to ti.init(arch=ti.cpu)
python gui_taichi.py [PATH TO MESH FILE]
GUI Controls
-
Use
Preset Camera View
to change to the axis-aligned camera view that you like. You can also pressw, s, a, d, e, q
to move the camera forward, back, left, right, head up, head down, accordingly. In addition, use the right mouse drag to change the camera's viewing angle. -
Press
Enter deformation
button andLEFT CLICK
the mesh to add new handle points. You can useBACKSPACE
on your keyboard to delete currently selected handle point (red) and useTAB
to switch to another handle point. By default, one handle is added to the first vertex because cubic stylization needs at least one constraint. -
Use
paused
checkbox to run and pause cubic stylization optimization. If the mesh is too large for real-time optimization, then useStep
button to manually run one iteration of the optimization. -
You can change the
cubeness
parameter to generate new mesh with different cubic-stylized extent. -
Rotate three axes to cubic stylize your mesh in different cube orientation.
-
After adding at least two handle points, you can do experiments with as-rigid-as-possible deformation. Use keyboard
UP, DOWN, LEFT, RIGHT, SHIFT, SPACE
to move your selected handle point up, down, left, right, back, and forward according to the world coordinate. UseTAB
to switch between handle points. -
Use
Save mesh
button to save your cubic-stylized mesh, the output mesh will be written to the same directory as the input mesh.
-
Liu, H.-T.D. and Jacobson, A. 2019. Cubic stylization. ACM Trans. Graph. 38, 6. ↩