GPU-Accelerated Locally Injective Shape Deformation
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
GLIDViewer release Sep 26, 2017
cuHarmonic release Sep 26, 2017
data release Sep 26, 2017
meshAQP init Aug 31, 2017
GLID_main.m init Aug 31, 2017
GetCompCage.m release Sep 26, 2017
cauchyCoordinates.m init Aug 31, 2017
cdt.m release Sep 26, 2017
cuHarmonic.mexw64 release Sep 26, 2017
deformer_main.m release Sep 26, 2017
derivativesOfCauchyCoord.m init Aug 31, 2017
distancePointToSegment.m init Aug 31, 2017
glidviewer.exe release Sep 26, 2017
harmonicMapIsometryicEnergy.m release Sep 26, 2017
hasGPUComputing.m init Aug 31, 2017
lbfgs_iter.m init Aug 31, 2017
lineSearchLocallyInjectiveHarmonicMap.m release Sep 26, 2017
maxtForPhiPsy.m init Aug 31, 2017
maxtForPositiveArea.m release Sep 26, 2017
meshAQP.m release Sep 26, 2017
meshARAP.m init Aug 31, 2017
nlo_p2p_harmonic.m release Sep 26, 2017
p2p_harmonic.m release Sep 26, 2017
p2p_harmonic_prep.m release Sep 26, 2017
p2p_harmonic_savedata.m release Sep 26, 2017
pointInPolygon.m init Aug 31, 2017
polygonOffset.m init Aug 31, 2017
selfintersect.m init Aug 31, 2017
signedAreas.m release Sep 26, 2017
signedpolyarea.m init Aug 31, 2017
subdivPolyMat.m init Aug 31, 2017
triangle.bin release Sep 26, 2017

This package contains the code that implements the following paper,

Renjie Chen and Ofir Weber. GPU-Accelerated Locally Injective Shape Deformation. ACM Transactions on Graphics, 36(6) (SIGGRAPH Asia 2017)

What does the code contain.

The app is built with a combination of MATLAB (for core computation), C++ code (for the UI) and mex/CUDA code (for GPU accelerated optimization). The C++ source code for the OpenGL UI with MS Visual Studio C++ project files is in the glidviewer folder.
The mex/CUDA source code for the GPU accelerated optimization is in the cuHarmonic folder. Precompiled binary for the UI and mex/CUDA are provided with the package.


  • MS Windows (Windows 7/8/10)
  • MATLAB (>2016b)
  • A GLSL 3.3 compatible GPU.
  • The OpenGL UI (glidviewer.exe)
  • CUDA (Compute Capability > 3.5)

To run the software:

  1. Start MATLAB
  2. cd to the code folder
  3. Call glid_main.m within MATLAB. This will automatically open the main GUI, and load the rex shape

The User Interface (main options):

  1. For deformation, the p2p constraint can be edited by
    • adding P2P constraints by left clicking on the shape
    • moving the p2p target by dragging any p2p constraint
    • removing constraints by right clicking the p2p
  2. GLID Deformer widget
    • Energy, isometric energy for the optimization
    • Solver, including mesh based AQP and SLIM, and harmonic subspace based Gradient Descent, LBFGS, Newton etc.
    • #samples, number of samples on the boundary for the boundary integral approximation
    • energy param, the paramter s for Exp Symmetric Dirichlet and AMIPS energies
    • Reset Shape, reset the shape to its original state (identity mapping)
    • Pause, paurse the iteration
    • Clear P2P: remove all the p2p constraints.

How to compile the binaries

The following libraries are needed to compile the code

  1. OpenGL GUI (glidviewer.exe)
  1. GPU-accelerated solver (cuHarmonic.mexw64)