Source code for "Interactive All-Hex Meshing via Cuboid Decomposition [SIGGRAPH Asia 2021]".

Overview

Interactive All-Hex Meshing via Cuboid Decomposition

teaser Video demonstration

This repository contains an interactive software to the PolyCube-based hex-meshing problem. You can solve hex meshing by playing minecraft!

Features include:

  • a 4-stage interactive pipeline that can robustly generate high-quality hex meshes from an input tetrahedral mesh;
  • extensive user control over each stage, such as editing the voxelized PolyCube, positioning surface vertices, and exploring the trade-off among competing quality metrics;
  • automatic alternatives based on GPU-powered continuous optimization that can run at interactive speed.

It is the original implementation of the SIGGRAPH Asia 2021 paper "Interactive All-Hex Meshing via Cuboid Decomposition" by Lingxiao Li, Paul Zhang, Dmitriy Smirnov, Mazdak Abulnaga, Justin Solomon. Check out our paper for a complete description of our pipeline!

Organization

There are three main components of the project.

  • The geomlib folder contains a standalone C++ library with GPU-based geometric operations including point-triangle projection (in arbitrary dimensions), point-tetrahedron projection (in arbitrary dimensions), point-in-tet-mesh inclusion testing, sampling on a triangular mesh, capable of handling tens of thousands of point queries on large meshes in milliseconds.
  • The vkoo folder contains a standalone object-oriented Vulkan graphics engine that is built based on the official Vulkan samples code with a lot of simplification and modification for the purpose of this project.
  • The hex folder contains the application-specific code for our interactive PolyCube-based hex meshing software, and should be most relevant for learning about the implementation details of our paper.

In addition,

  • results.zip contains the *.h5 project file and the *.mesh output hex mesh file for each model in the Table 2 of the paper. The *.h5 project files can be loaded in our software using File > Open.
  • The assets folder contains a small number of tetrahedral meshes to test on, but you can include your own meshes easily (if you only have triangular meshes, try using TetGen or this to mesh the interior first).
  • The external folder contains additional dependencies that are included in the repo.

Dependencies

Main dependencies that are not included in the repo and should be installed first:

  • CMake
  • CUDA (tested with 11.2, 11.3, 11.4, 11.5) and cuDNN
  • Pytorch C++ frontend (tested with 1.7, 1.8, 1.9, 1.10)
  • Vulkan SDK
  • Python3
  • HDF5

There are additional dependencies in external and should be built correctly with the provided CMake hierarchy:

  • Eigen
  • glfw
  • glm
  • glslang
  • imgui
  • spdlog
  • spirv-cross
  • stb
  • yaml-cpp

Linux Instruction

The instruction is slightly different on various Linux distributions. We have tested on Arch Linux and Ubuntu 20.04. First install all dependencies above using the respective package manager. Then download and unzip Pytorch C++ frontend for Linux (tested with cxx11 ABI) -- it should be under the tab Libtorch > C++/Java > CUDA 11.x. Add Torch_DIR=<unzipped folder> to your environment variable lists (or add your unzipped folder to CMAKE_PREFIX_PATH). Then clone the repo (be sure to use --recursive to clone the submodules as well). Next run the usual cmake/make commands to build target hex in Debug or Release mode:

mkdir -p build/Release
cd build/Release
cmake ../.. -DCMAKE_BUILD_TYPE=Release
make hex -j

This should generate an executable named hex under bin/Release/hex which can be run directly. See CMakeLists.txt for more information.

Windows Instruction

Compiling on Windows is trickier than on Linux. The following procedure has been tested to work on multiple Windows machines.

  • Download and install Visual Studio 2019
  • Download and install the newest CUDA Toolkit (tested with 11.2)
  • Download and install cuDNN for Windows (this amounts to copying a bunch of dll's to the CUDA path)
  • Download and install the newest Vulkan SDK binary for Windows
  • Download and install Python3
  • Download and unzip Pytorch C++ frontend for Windows. Then add TORCH_DIR=<unzipped folder> to your environment variable lists.
  • Download and install HDF5 for Windows
  • In VS2019, install CMake tools, and then build the project following this This should generate an executable under bin/Debug or bin/Release.
You might also like...
Source code, datasets and trained models for the paper Learning Advanced Mathematical Computations from Examples (ICLR 2021), by François Charton, Amaury Hayat (ENPC-Rutgers) and Guillaume Lample

Maths from examples - Learning advanced mathematical computations from examples This is the source code and data sets relevant to the paper Learning a

Source Code for DialogBERT: Discourse-Aware Response Generation via Learning to Recover and Rank Utterances (https://arxiv.org/pdf/2012.01775.pdf)

DialogBERT This is a PyTorch implementation of the DialogBERT model described in DialogBERT: Neural Response Generation via Hierarchical BERT with Dis

Implementation of the paper
Implementation of the paper "Language-agnostic representation learning of source code from structure and context".

Code Transformer This is an official PyTorch implementation of the CodeTransformer model proposed in: D. Zügner, T. Kirschstein, M. Catasta, J. Leskov

source code and pre-trained/fine-tuned checkpoint for NAACL 2021 paper LightningDOT
source code and pre-trained/fine-tuned checkpoint for NAACL 2021 paper LightningDOT

LightningDOT: Pre-training Visual-Semantic Embeddings for Real-Time Image-Text Retrieval This repository contains source code and pre-trained/fine-tun

Code to reproduce the experiments in the paper
Code to reproduce the experiments in the paper "Transformer Based Multi-Source Domain Adaptation" (EMNLP 2020)

Transformer Based Multi-Source Domain Adaptation Dustin Wright and Isabelle Augenstein To appear in EMNLP 2020. Read the preprint: https://arxiv.org/a

Source code for the GPT-2 story generation models in the EMNLP 2020 paper "STORIUM: A Dataset and Evaluation Platform for Human-in-the-Loop Story Generation"

Storium GPT-2 Models This is the official repository for the GPT-2 models described in the EMNLP 2020 paper [STORIUM: A Dataset and Evaluation Platfor

The source code for the Cutoff data augmentation approach proposed in this paper: "A Simple but Tough-to-Beat Data Augmentation Approach for Natural Language Understanding and Generation".

Cutoff: A Simple Data Augmentation Approach for Natural Language This repository contains source code necessary to reproduce the results presented in

PGPortfolio: Policy Gradient Portfolio, the source code of "A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem"(https://arxiv.org/pdf/1706.10059.pdf).

This is the original implementation of our paper, A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem (arXiv:1706.1

Source code for
Source code for "OmniPhotos: Casual 360° VR Photography"

OmniPhotos: Casual 360° VR Photography Project Page | Video | Paper | Demo | Data This repository contains the source code for creating and viewing Om

Comments
  • kEps is undefined in device code in file (generalized_projection_cuda.cu)	61

    kEps is undefined in device code in file (generalized_projection_cuda.cu) 61

    Thank you for your project. I'am Aerospace Engeneer and new in GitHub. I've a problem in building a project on VS2019. When I run the build, the following error appears in the file generalized_projection_cuda.cu . There is a problem with the "keps" variable.

    How to solve this problem?

    Settings:
    Windows 10
    CUDA 11.2
    Pytorch 1.12.1
    
    identifier "geomlib::_NV_ANON_NAMESPACE::kEps" is undefined in device code	C:\Users\1\Downloads\interactive-hex-meshing-main\interactive-hex-meshing-main\out\build\x64-Debug\interactive-hex-meshing-main	C:\Users\1\Downloads\interactive-hex-meshing-main\interactive-hex-meshing-main\geomlib\geomlib\generalized_projection_cuda.cu	61	
    
    
      [197/260] Linking CXX static library vkoo\vkoo.lib
      [198/260] Building NVCC (Device) object geomlib/geomlib/CMakeFiles/geomlib.dir/geomlib_generated_generalized_projection_cuda.cu.obj
      FAILED: geomlib/geomlib/CMakeFiles/geomlib.dir/geomlib_generated_generalized_projection_cuda.cu.obj 
      cmd.exe /C "cd /D C:\Users\1\Downloads\interactive-hex-meshing-main\interactive-hex-meshing-main\out\build\x64-
      Debug\geomlib\geomlib\CMakeFiles\geomlib.dir && "C:\Program Files (x86)\Microsoft Visual 
      Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E make_directory
      C:/Users/1/Downloads/interactive-hex-meshing-main/interactive-hex-meshing-main/out/build/x64-
      Debug/geomlib/geomlib/CMakeFiles/geomlib.dir//. && "C:\Program Files (x86)\Microsoft Visual 
      Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -D verbose:BOOL=OFF -D 
      build_configuration:STRING=Debug -D generated_file:STRING=C:/Users/1/Downloads/interactive-hex-meshing-main/interactive-
      hex-meshing-main/out/build/x64-
      Debug/geomlib/geomlib/CMakeFiles/geomlib.dir//./geomlib_generated_generalized_projection_cuda.cu.obj -D 
      generated_cubin_file:STRING=C:/Users/1/Downloads/interactive-hex-meshing-main/interactive-hex-meshing-main/out/build/x64-
      Debug/geomlib/geomlib/CMakeFiles/geomlib.dir//./geomlib_generated_generalized_projection_cuda.cu.obj.cubin.txt -P 
      C:/Users/1/Downloads/interactive-hex-meshing-main/interactive-hex-meshing-main/out/build/x64-
      Debug/geomlib/geomlib/CMakeFiles/geomlib.dir//geomlib_generated_generalized_projection_cuda.cu.obj.Debug.cmake"
      generalized_projection_cuda.cu
    
    opened by IzzakQ 2
  • LFS bandwidth is used up.

    LFS bandwidth is used up.

    Thank you for your great project. When I tried to clone this repo, it failed due to the LFS limit:

    This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
    

    Do you have any storage to upload large files (ex. cloud drive) or any points of contact for funding for the hosting(ex. Paypal, Patreon, Gumroad, etc)? It's a great project and I'd like to try it out, and I think it's a shame that a way to make it more widely known is being closed off.

    opened by Drunkar 1
  • git clone error

    git clone error

    A nice work. However, it seems that i got a trouble when clone this project. And the error is as follows: Cloning into 'external/eigen'... remote: A repository for this project does not exist yet. fatal: repository 'https://gitlab.com/libeigen/eigen.git/' not found

    opened by Talbil 1
  • Adapt to medit official format.

    Adapt to medit official format.

    I tried to convert output mesh file via meshio ( https://github.com/nschloe/meshio ) but it's failed. And I found a few points were different from official medit format ( https://people.sc.fsu.edu/~jburkardt/data/medit/medit.html ). Now the output can be converted via meshio.

    opened by Drunkar 0
Owner
Lingxiao Li
Lingxiao Li
PaddleRobotics is an open-source algorithm library for robots based on Paddle, including open-source parts such as human-robot interaction, complex motion control, environment perception, SLAM positioning, and navigation.

简体中文 | English PaddleRobotics paddleRobotics是基于paddle的机器人开源算法库集,包括人机交互、复杂运动控制、环境感知、slam定位导航等开源算法部分。 人机交互 主动多模交互技术TFVT-HRI 主动多模交互技术是通过视觉、语音、触摸传感器等输入机器人

null 185 Dec 26, 2022
Source-to-Source Debuggable Derivatives in Pure Python

Tangent Tangent is a new, free, and open-source Python library for automatic differentiation. Existing libraries implement automatic differentiation b

Google 2.2k Jan 1, 2023
Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

CoProtector Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

Zhensu Sun 1 Oct 26, 2021
Graph Transformer Architecture. Source code for

Graph Transformer Architecture Source code for the paper "A Generalization of Transformer Networks to Graphs" by Vijay Prakash Dwivedi and Xavier Bres

NTU Graph Deep Learning Lab 561 Jan 8, 2023
Open source repository for the code accompanying the paper 'Non-Rigid Neural Radiance Fields Reconstruction and Novel View Synthesis of a Deforming Scene from Monocular Video'.

Non-Rigid Neural Radiance Fields This is the official repository for the project "Non-Rigid Neural Radiance Fields: Reconstruction and Novel View Synt

Facebook Research 296 Dec 29, 2022
Source code for Acorn, the precision farming rover by Twisted Fields

Acorn precision farming rover This is the software repository for Acorn, the precision farming rover by Twisted Fields. For more information see twist

Twisted Fields 198 Jan 2, 2023
[CVPR2021] The source code for our paper 《Removing the Background by Adding the Background: Towards Background Robust Self-supervised Video Representation Learning》.

TBE The source code for our paper "Removing the Background by Adding the Background: Towards Background Robust Self-supervised Video Representation Le

Jinpeng Wang 150 Dec 28, 2022
Open source code for Paper "A Co-Interactive Transformer for Joint Slot Filling and Intent Detection"

A Co-Interactive Transformer for Joint Slot Filling and Intent Detection This repository contains the PyTorch implementation of the paper: A Co-Intera

null 67 Dec 5, 2022
Source code of "Hold me tight! Influence of discriminative features on deep network boundaries"

Hold me tight! Influence of discriminative features on deep network boundaries This is the source code to reproduce the experiments of the NeurIPS 202

EPFL LTS4 19 Dec 10, 2021
The open source code of SA-UNet: Spatial Attention U-Net for Retinal Vessel Segmentation.

SA-UNet: Spatial Attention U-Net for Retinal Vessel Segmentation(ICPR 2020) Overview This code is for the paper: Spatial Attention U-Net for Retinal V

Changlu Guo 151 Dec 28, 2022