This tutorial will introduce Cubic Stylization [Liu & Jacobson 2019], a method to deform the input mesh into a cubic stylized mesh. Generally, the method adds a new L1 regularization on the deformation with ARAP energy optimization. By regularizing each vertex normals to align with the axis, the mesh can have a cubic style, while maintain the local shape.
Given a triangle mesh as a set of vertices $V\in \mathbb R^{n\times 3} $ and a set of faces
The problem is view as an energy optimization problem. We want to minimize the ARAP energy with a L1 regularization. Denote the edges at rest state as
The second term is the new, added L1 regularization.
Generally, we follow the local global step as ARAP energy optimization, i.e. for each iteration, we first optimize the rotations with constant vertex positions, and then optimize vertices with constant rotations.
The local step involves finding the rotation matrix
Applying ADMM, the update steps are \begin{align*} R_i^{k+1} &= \arg\min \frac12(R_iD_i-\tilde D_i)^T W_i (R_iD_i-\tilde D_i) +\frac{\rho^k}2|R_i\hat n_i - z^k + u^k|_2^2\ z^{k+1} &= \arg\min \lambda a_i |z|_1 + \frac{\rho^k}2|R_i^{k+1} \hat n_i - z + u^k|_2^2\ \tilde u^{k+1} &= u^k + R_i^{k+1} \hat n_i - z^{k+1}\ \rho^{k+1}, u^{k+1} &= update(\rho^k) \end{align*}
Then, consider each update,
The rotation update can be viewed as
\begin{align*}
R_i^{k+1} &= \arg\max tr(R_i M_i)\
M_i &= \begin{bmatrix}[D_i]&[\hat n_i]\end{bmatrix}
\begin{bmatrix}[W_i]&0\0&\rho^k\end{bmatrix}
\begin{bmatrix}[\tilde D_i]\ [(z^k-u^k)^T] \end{bmatrix}
\end{align*}
This becomes an Orthogonal Procrustes problem, and the solution given by
The
Note that when we optimize
Similar to deformation, we can precompute the topology properties since the stylization only change the geometry. Therefore the rough algorithm goes as
cubic_stylization(V, F, lambda):
pre_computation(V, F)
V_tilde <- V
R <- initalize()
while not converge:
R <- local_step(V, V_tilde, lambda)
V_tilde <- global_step(R)
In this project, we used cubic_style_data
to store all the properties and states of the stylization. We implemented cubic_style_precomputation
, which computes the precomputated properties and initialize the parameters and states for the optimization problem, and cubic_style_single_iteration
, which do 1 iteration of local step and global step.
Here is a example code snippet
// initialize data
cubic_style_data cubic_data;
Eigen::MatrixXd V_tilde;
lambda = 0.1 // The parameter for cubic_stylization
// b is the snap points for deformation
// bc is the position of the handle points
cubic_style_precomputation(V, F, b, cubic_data)
for (int i = 0; i < MAXITER; i++) {
cubic_style_single_iteration(cubic_data, bc, lambda, V_tilde)
}
different cubic stylized meshes
Different $\lambda$'s on the bunny mesh
As mentioned in the paper, since we are still doing ARAP energy optimization, deformation is still available with the stylized mesh.