# avaxman/MoebiusCode

Demo for the SIGGRAPH 2015 paper: "Conformal Mesh Deformations with Möbius Transformations".
C++ CMake C
Switch branches/tags
Nothing to show
Amir Vaxman FileDialog name bug.
Latest commit 76dbb7d Feb 9, 2018
 Failed to load latest commit information. cmake Oct 21, 2016 external Oct 28, 2016 .gitignore Oct 26, 2016 .gitmodules Oct 21, 2016 CMakeLists.txt Jan 15, 2018 Deform2D.cpp Oct 27, 2016 Deform2D.h Oct 27, 2016 Deform3D.cpp Jan 15, 2018 Deform3D.h Oct 28, 2016 ExtraFunctions.cpp Oct 27, 2016 ExtraFunctions.h Oct 26, 2016 FileDialog.h Feb 9, 2018 InterpolateTraits.h Oct 26, 2016 LICENSE Oct 21, 2016 MoebiusCodeDemoScreen.png Oct 27, 2016 PrescribeEdgeJumps.h Feb 9, 2018 QuadConstSolver.h Oct 26, 2016 README.md Nov 1, 2016 UnitSphereMoebiusTraits.h Oct 26, 2016 main.cpp Oct 28, 2016

# MoebiusCode

This code serves as a Demo for the paper Conformal Mesh Deformations with Möbius Transformations by Vaxman et al. from SIGGRAPH 2015. The demo uses the optimization package, and specialized traits from the libhedra package, which is in turn based on libigl and Eigen. It implements the following features from the paper:

1. 2D deformation and interpolation using complex numbers.
2. 3D deformation using quaternions.
3. Exact metric conformal (2D and 3D) and intersection-angle preserving (2D).
4. Working with any polyhedral (non-triangular) meshes, where every face undergoes a single Möbius transformation.

See paper for details on the mathematical formulation of the above.

##Installation

To get the library, use:

git clone --recursive https://github.com/avaxman/MoebiusCode.git

to compile the demo, enter the following commands in a terminal:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../
make

You can use cmake-gui in windows to create a visual studio project, ready for compilation. The dependencies are already recursively downloaded and built.

##Editing Meshes

Upon running, the demo will ask to load a mesh. It automatically infers if the mesh is 2D (if the $z$ coordinate is negligible) or 3D. The complex-based formulation will run on 2D meshes, and the quaternionic on 3D meshes. The parameters are largely similar. The demo offers the following functionality:

The editing options are:

Editing Options Description
Original Shows the original mesh for comparison. It cannot be edited in this mode.
Deformation Shows the currently deforming mesh. The handles will show as spheres, where the green sphere is the currently edited one.
Interpolation Shows the interpolated mesh at the current time frame.

The viewing options determine what is presented on the mesh that is currently shown. Scalar values are on a cool-warm color scale, where they are normalized to $[0,sensitivity]$, and values above sensitivity are clamped. The sensitivities are specific and described as follows. See paper for more details:

Viewing Options Description
Mesh View Just the mesh. Note that you can tick off the wireframe option to see only the polyhedral lines (rather than the triangulated view).
Edge MC View This shows a special "edge-mesh" that is centered on each edge, and shows the metric conformality values. The values shown are $\left Edge IAP View The difference between circle-intersection angles of deformed/interpolated and original mesh (or: phase of cross ratios) in$360^\circ$degree angles. The default sensitivity is$1^\circ$, and controlled by the parameter IAP Sensitivity. Concyclity The concyclity of every face, measured as the averaged circle intersection angle of each four vertices in a polygonal face (Triangles are by definition concyclic). This is not a relative measure: expect to see the same colors in the original and deformed/interpolated to see that it is preserved by the algorithm. The default sensitivity is$5^\circ$, and controlled by the parameter Concyclity Sensitivity Face MC Error Like Edge MC error, but for the diagonals of a polygonal face. Not entirely useful, but for completeness. Uses same parameter and sensitivity like Edge MC. Face QC Error Measures the quasiconformal error of each deformed/interpolated face relative to the original. The error is measures as$\left
Face Area Error Measures the area distortion between triangles. The error is $\left Face small k Error Measures another sort of normalized quasiconformal error of each deformed/interpolated face relative to the original. The error is measures as$k=\frac{K-1}{K-1}$, where$K$is defined above (in QC Error). This error is advantageous since it is bounded. The default sensitivity is$0.25$, and controlled by the parameter Small k Sensitivity. It is possible to perform an exactly-MC preserving deformation and interpolation by tagging Exact MC. It is possible to do exact IAP 2D deformation (only) by tagging Exact IAP. The Rigidity Ratio parameter controls the inversion in the Möbius transformations. It is the$\alpha_{INV}$as described in the paper. It is by default$0.5$for 3D meshes, and$0.1$for 2D meshes. Higher values mean more rigid faces vs. less As-Möbius-as-possible smoothness. The Interpolation time step can be controlled by Interpolation Step. The interpolation is done between the original (considered as$t=0$) and the currently deformed mesh (considered as$t=1$). Note that it is not bounded; values beyond$[0,1]$will perform an extrapolation. Remember to re-press this when the deformed mesh changes. It does not update automatically. The rest of the parameters are regular libigl viewing parameters. ##Handles Positional constraints, as handles, are added by pointing at a vertex and clicking the middle mouse button. Clicking the right mouse button and dragging will move the current handle (green) to the new position marked by the mouse. Handles do not have any effect in interpolated and original modes. You can navigate between existing handles by the keys N,M. The current handle can be deleted by pressing D. ##Other operations Save the current deformed and interpolated meshes (into polygonal OFF files) by pressing X. Press P to update the current deformation (in case you deleted the handle, changed a parameter, etc.). press V and B to add and subtract, respectively, the interpolation time step$t\$, and compute the interpolation accordingly.

##Implementation

The core of the algorithm is currently part of libhedra, as traits classes to its Levenberg-Marquadt solver. Details about the optimization are largely the same as those detailed in the paper, but with some changes that will be detailed soon. Meanwhile, the code in the traits Moebius2DEdgeDeviationTraits.h, Moebius3DCornerVarsTraits.h, and Moebius2DInterpolationTraits.h in libhedra reveals them.

The entire algorithm will soon be incorporated into the library, but this demo will remain as a showcase nonetheless.

###TODO List:

1. 3D Interpolation: currently solving a few bugs to make that happen.
2. Using the nicer libhedra-based drawing of handles and polyhedral edge lines.
3. using libhedra measures for concyclity etc. It might then change the output slightly (the averaging on polygonal faces is a bit different).
4. Currently the linear solver is Cholesky in Eigen, which is on the slow side. A wrapper for PARDISO will be added as an option to get better performance.

Please complain about bugs, or ask any relevant question by [Amir Vaxman] (a.vaxman@uu.nl) (or open an issue in the repository). If you use this software for comparison, please cite the original paper:

@article{Vaxman:2015,
author = {Vaxman, Amir and M\"{u}ller, Christian and Weber, Ofir},
title = {Conformal Mesh Deformations with M\"{o}bius Transformations},
journal = {ACM Trans. Graph.},
issue_date = {August 2015},
volume = {34},
number = {4},
year = {2015},
pages = {55:1--55:11},
}