Code Monkey home page Code Monkey logo

scaffold-map's Introduction

Simplicial Complex Augmentation Framework for Bijective Maps

Zhongshi Jiang, Scott Schaefer, Daniele Panozzo
ACM Transaction on Graphics (Proceedings of SIGGRAPH Asia 2017)
DOI: 10.1145/3130800.3130895

Abstract

Bijective maps are commonly used in many computer graphics and scientific computing applications, including texture, displacement, and bump mapping. However, their computation is numerically challenging due to the global nature of the problem, which makes standard smooth optimization techniques prohibitively expensive. We propose to use a scaffold structure to reduce this challenging and global problem to a local injectivity condition. This construction allows us to benefit from the recent advancements in locally injective maps optimization to efficiently compute large scale bijective maps (both in 2D and 3D), sidestepping the need to explicitly detect and avoid collisions. Our algorithm is guaranteed to robustly compute a globally bijective map, both in 2D and 3D. To demonstrate the practical applicability, we use it to compute globally bijective single patch parametrizations, to pack multiple charts into a single UV domain, to remove self-intersections from existing models, and to deform 3D objects while preventing self-intersections. Our approach is simple to implement, efficient (two orders of magnitude faster than competing methods), and robust, as we demonstrate in a stress test on a parametrization dataset with over a hundred meshes.

Source Code

Source code is hosted on this GitHub repository. The program is built and tested on MacOS system with AppleClang.

Downloading

git clone https://github.com/jiangzhongshi/scaffold-map.git

Building Build Status

To build the program, you can make use of CMakeLists.txt in the root folder:

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

Running

We provide three examples in this repo, parameterization of a camel, inflation of bunny, and self-intersection recovery of a leg.

./scaf_param_bin -m ../camel_b.obj
./scaf_flow_bin -m ../bunny.obj -t ../bunnyx30.obj
./scaf_flow_bin -m ../leg-flow6.off -t ../models/leg-intersect.off

Press [space] to perform one iteration.

libigl version

A simplified 2D version is integrated into libigl (MPL v2 license) https://github.com/libigl/libigl/tree/master/tutorial/710_SCAF

License

This repository is an expolration groud for research purposes, therefore it contains files from multiple sources and copyright licenses. However, the author is in general happy to provide most of the code under MIT or MPL license. If you are interested in the commercial use of the algorithm, please contact the author.

scaffold-map's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

scaffold-map's Issues

If Scaf parametrize changes the amount of vertex and faces is possible to use it to switch 3d -> 2d?

I mean using something as simple as

ScafData scaf_data;
scaf_data.add_new_patch(V, F, Eigen::RowVector2d(0, 0));
scaf_data.mesh_improve(false, true);
cout << "V_init: " << V.rows() << " F_init: " << V.rows() << endl;
cout << "V_num: " << scaf_data.v_num << " F_num: " << scaf_data.f_num << endl;

I get that the V and F num has been changed so it cannot be used to parametrice 3d spaces into 2d spaces or am I wrong?

Regards.

Out of sync with downloaded libigl?

I get build errors like this:

[ 93%] Building CXX object CMakeFiles/scaf_pack_bin.dir/src/UI/TextureGUI_extended_menu.cpp.o
/Users/ajx/Repos/scaffold-map/src/UI/TextureGUI_extended_menu.cpp:147:34: error: reference to non-static member function must be called; did you mean
      to call it with no arguments?
            viewer_core_2d_ = v_.core;
                              ~~~^~~~
                                     ()
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1072:34: note: possible target for call
  IGL_INLINE ViewerCore& Viewer::core(unsigned core_id /*= 0*/)
                                 ^
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1084:40: note: possible target for call
  IGL_INLINE const ViewerCore& Viewer::core(unsigned core_id /*= 0*/) const
                                       ^
/Users/ajx/Repos/scaffold-map/src/UI/TextureGUI_extended_menu.cpp:148:16: error: reference to non-static member function must be called; did you mean
      to call it with no arguments?
            v_.core = viewer_core_3d_;
            ~~~^~~~
                   ()
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1072:34: note: possible target for call
  IGL_INLINE ViewerCore& Viewer::core(unsigned core_id /*= 0*/)
                                 ^
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1084:40: note: possible target for call
  IGL_INLINE const ViewerCore& Viewer::core(unsigned core_id /*= 0*/) const
                                       ^
/Users/ajx/Repos/scaffold-map/src/UI/TextureGUI_extended_menu.cpp:150:34: error: reference to non-static member function must be called; did you mean
      to call it with no arguments?
            viewer_core_3d_ = v_.core;
                              ~~~^~~~
                                     ()
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1072:34: note: possible target for call
  IGL_INLINE ViewerCore& Viewer::core(unsigned core_id /*= 0*/)
                                 ^
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1084:40: note: possible target for call
  IGL_INLINE const ViewerCore& Viewer::core(unsigned core_id /*= 0*/) const
                                       ^
/Users/ajx/Repos/scaffold-map/src/UI/TextureGUI_extended_menu.cpp:151:16: error: reference to non-static member function must be called; did you mean
      to call it with no arguments?
            v_.core = viewer_core_2d_;
            ~~~^~~~
                   ()
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1072:34: note: possible target for call
  IGL_INLINE ViewerCore& Viewer::core(unsigned core_id /*= 0*/)
                                 ^
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1084:40: note: possible target for call
  IGL_INLINE const ViewerCore& Viewer::core(unsigned core_id /*= 0*/) const
                                       ^
/Users/ajx/Repos/scaffold-map/src/UI/TextureGUI.cpp:192:28: error: reference to non-static member function must be called; did you mean to call it with
      no arguments?
      viewer_core_3d_ = v_.core;
                        ~~~^~~~
                               ()
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1072:34: note: possible target for call
  IGL_INLINE ViewerCore& Viewer::core(unsigned core_id /*= 0*/)
                                 ^
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1084:40: note: possible target for call
  IGL_INLINE const ViewerCore& Viewer::core(unsigned core_id /*= 0*/) const
                                       ^
/Users/ajx/Repos/scaffold-map/src/UI/TextureGUI.cpp:193:28: error: reference to non-static member function must be called; did you mean to call it with
      no arguments?
      viewer_core_2d_ = v_.core;
                        ~~~^~~~
                               ()
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1072:34: note: possible target for call
  IGL_INLINE ViewerCore& Viewer::core(unsigned core_id /*= 0*/)
                                 ^
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1084:40: note: possible target for call
  IGL_INLINE const ViewerCore& Viewer::core(unsigned core_id /*= 0*/) const
                                       ^
/Users/ajx/Repos/scaffold-map/src/UI/TextureGUI.cpp:210:10: error: reference to non-static member function must be called; did you mean to call it with
      no arguments?
      v_.core = uv_space ? viewer_core_2d_ : viewer_core_3d_;
      ~~~^~~~
             ()
/Users/ajx/Repos/scaffold-map/external/libigl/cmake/../include/igl/opengl/glfw/Viewer.cpp:1072:34: note: possible target for call
  IGL_INLINE ViewerCore& Viewer::core(unsigned core_id /*= 0*/)
                                 ^
/Users/ajx/Repos/scaffold-map/external/libigl/

Crash when building StateManager

StateManager s_(DemoType::PARAM, "D:/camel_b.obj");
camel_b.zip

When I attempt to run my code it crashes at this line.
Before crashing there is 'Mesh Measure7854.29' in output so I believe the execution reaches at least StateManager.cpp line 90 since that debug comes from the add_new_patch method (ScafData.cpp line 394).
What may be the problem?

Cannot create solution with CMake

Windows 8 x64

Error:

CMake Error at cmake/DownloadProject.cmake:179 (message):
Build step for libigl failed: 1
Call Stack (most recent call first):
CMakeLists.txt:37 (download_project)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.