This is the open-source reference implementation of the SIGGRAPH 2021 paper Intersection-free Rigid Body Dynamics.

Overview

Rigid IPC

Build License

Robust, intersection-free, simulations of rigid bodies.

This is the open-source reference implementation of the SIGGRAPH 2021 paper Intersection-free Rigid Body Dynamics.

Files

  • src/: source code
  • cmake/ and CMakeLists.txt: CMake files
  • fixtures/: input scripts to rerun all examples in our paper
  • meshes/: input meshes used by the fixtures
  • tests/: unit-tests
  • tools/: Python and Bash scripts for generating and processing results
  • comparisons/: files used in comparisons with other rigid body simulators
  • python/: Python binding files
  • notebooks/: Jupyter notebooks

Build

To build the project, use the following commands from the root directory of the project:

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

Dependencies

All dependancies are downloaded through CMake depending on the build options. The following libraries are used in this project:

  • IPC Toolkit: common IPC functions
  • Eigen: linear algebra
  • libigl: basic geometry functions, predicates, and viewer
  • TBB: parallelization
  • Tight Inclusion CCD: correct (conservative) continuous collision detection between triangle meshes in 3D
  • spdlog: logging information
  • filib: interval arithmetic
  • Niels Lohmann's JSON: parsing input JSON scenes
  • tinygltf: exporting simulation animation to GLTF format
  • finite-diff: finite difference comparisons
    • Only used by the unit tests and when RIGID_IPC_WITH_DERIVATIVE_CHECK=ON

Optional

Scenes

We take as input a single JSON file that specifies the mesh and initial conditions for each body. The fixtures directory contains example scenes.

Python Bindings

We expose some functionality of Rigid IPC through Python. This is still in development and lacks the ability to script many features available in the full simulator.

To build the Python bindings use the setup.py script:

python setup.py install
Comments
  • cmake fails on Linux Mint 19.3

    cmake fails on Linux Mint 19.3

    Here is what I typed:

    $ mkdir build
    $ cd build
    $ cmake -DCMAKE_BUILD_TYPE=Release ..
    -- GCC >= 4.9 detected, enabling colored diagnostics
    -- Third-party: creating target 'Eigen3::Eigen'
    -- Third-party: creating target 'igl::core'
    -- Creating target: igl::core (igl)
    -- Creating target: igl::opengl (igl_opengl)
    -- Creating target: igl::opengl_glfw (igl_opengl_glfw)
    -- Using X11 for window creation
    -- Creating target: igl::opengl_glfw_imgui (igl_opengl_glfw_imgui)
    -- Creating target: igl::png (igl_png)
    -- Creating target: igl::predicates (igl_predicates)
    -- Third-party: creating target 'nlohmann::json'
    -- Third-party: creating target 'spdlog::spdlog'
    -- Build spdlog: 1.9.0
    -- Build type: Release
    -- Generating install
    -- Third-party: creating target 'finitediff::finitediff'
    -- Third-party: creating targets 'Boost::boost'
    -- Fetching Boost
    -- Fetching Boost - done
    -- Boost found: 1.71.0 /home/glenn/src/github.com/ipc-sim/rigid-ipc/build/_deps/boost-src
    -- Found the following ICU libraries:
    --   uc (required)
    --   dt (required)
    --   i18n (required)
    -- Third-party: creating target 'TBB::tbb'
    -- Third-party: creating target 'tight_inclusion::tight_inclusion'
    -- Tight-Inclusion CCD bottom-level project
    -- GCC >= 4.9 detected, enabling colored diagnostics
    -- Searching for AVX...
    -- Using CPU native flags for AVX optimization:  -march=native
    --   Found AVX 2.0 extensions, using flags:  -march=native -mavx2 -mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd
    -- Using Double Precision Floating Points
    -- Third-party: creating target 'PolyFEM::polysolve'
    [ 11%] Performing download step (git clone) for 'polysolve-populate'
    Cloning into 'polysolve-src'...
    fatal: reference is not a tree: a94e9b8ed8302d4b479533c67419f31addb1e987
    CMake Error at polysolve-subbuild/polysolve-populate-prefix/tmp/polysolve-populate-gitclone.cmake:40 (message):
      Failed to checkout tag: 'a94e9b8ed8302d4b479533c67419f31addb1e987'
    
    
    CMakeFiles/polysolve-populate.dir/build.make:110: recipe for target 'polysolve-populate-prefix/src/polysolve-populate-stamp/polysolve-populate-download' failed
    make[2]: *** [polysolve-populate-prefix/src/polysolve-populate-stamp/polysolve-populate-download] Error 1
    CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/polysolve-populate.dir/all' failed
    make[1]: *** [CMakeFiles/polysolve-populate.dir/all] Error 2
    Makefile:102: recipe for target 'all' failed
    make: *** [all] Error 2
    
    CMake Error at /usr/local/cmake-3.18.2-Linux-x86_64/share/cmake-3.18/Modules/FetchContent.cmake:987 (message):
      Build step for polysolve failed: 2
    Call Stack (most recent call first):
      /usr/local/cmake-3.18.2-Linux-x86_64/share/cmake-3.18/Modules/FetchContent.cmake:1082:EVAL:2 (__FetchContent_directPopulate)
      /usr/local/cmake-3.18.2-Linux-x86_64/share/cmake-3.18/Modules/FetchContent.cmake:1082 (cmake_language)
      /usr/local/cmake-3.18.2-Linux-x86_64/share/cmake-3.18/Modules/FetchContent.cmake:1125 (FetchContent_Populate)
      cmake/recipes/polysolve.cmake:14 (FetchContent_MakeAvailable)
      CMakeLists.txt:225 (include)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/glenn/src/github.com/ipc-sim/rigid-ipc/build/CMakeFiles/CMakeOutput.log".
    See also "/home/glenn/src/github.com/ipc-sim/rigid-ipc/build/CMakeFiles/CMakeError.log".
    

    Any ideas how to fix this? It looks like a bad git reference in polysolve-src, possibly.

    Thank you!

    opened by gmlewis 6
  • Missing files or invalid fixture scripts?

    Missing files or invalid fixture scripts?

    I tried some of the examples in the "fixtures" directory, and the simulator works great! Nice work!

    However, I discovered that there are some examples that don't run either because their mesh files don't exist in the repo or because of some other problem.

    For example, this example is missing its meshes: https://github.com/ipc-sim/rigid-ipc/blob/main/fixtures/3D/mechanisms/expanding-lock-box.json#L11-L57

    This example says [2021-09-30 19:57:28.039] [error] Invalid Json file: https://github.com/ipc-sim/rigid-ipc/blob/main/fixtures/2D/compactor.json

    opened by gmlewis 3
  • Added TimeStepping (WIP)

    Added TimeStepping (WIP)

    Updated clang-format so long chains of parameters are shown one on each line (don't hate me)

    IO

    • Added rigid-body fixtures (NEW FORMAT!)
      • Added rigid-body reader
    • Added json/eigen helper to read/write matrices

    OPT

    • Added is_barrier method (and get/set epsilon) to CollisionConstraint so we don't need to pass the BarrierConstraint to the solver
      • Updated barrier constraint to use them
    • Added accessors on OptimizationProblem for barrier case
      • updated ad-hoc problem too since it was used on unit-tests

    PHYSICS

    • updated RigidBody class to

      • include theta: position is now length 3 (x, y, theta)
      • compute mass and moment of intertia (needed for forces)
      • added position of previous step
      • added differentiable world vertices, and flag to obtain the vertices of the current or previous step.
      • TODO: remove world_displacements, we should use world_vertices instead!
    • Added RigidBodyAssembler (to replace RigidBodyAssembler once finished)

      • init method only computes inmmutable information
      • other methods compute assembly on call

    SIMULATION

    • Added new main file for simulation
    • Added UISimSate and UIMenu for the simulation UI
    • TODO: merge with collision-debugging UI or add export of single problematic step
    opened by panchagil 1
  • Newton fix

    Newton fix

    I updated the Newton solver to fail to gradient descent if the line search fails. This helps the optimization make progress even when the Hessian is ill-conditioned. The next step after this pull request is merged is to add a quasi-Newton solver (e.g. BFGS).

    • Exposed initialization of barrier epsilon in the UI.
    • Separated line search into its own file.
    • Newton method now fails to gradient descent.
    opened by zfergus 1
  • Chain rule refactor

    Chain rule refactor

    Refactor structure of project. Now we have only 4 problems

    • Rigid Body Physics + Distance Barrier Constraint + Barrier Solver

    • Particles Physics + Distance Barrier Constraint + Barrier Solver

    • Rigid Body Physics + Volume Constraint + NCP Solver

    • Particles Physics + Volume Constraint + NCP Solver

    • Remove some base classes that were forcing us to write more functions than neccesary

      • Base OptimizationProblem is gone, now we have some interfaces for the different problems
      • Base CollisionConstraint remainds but implements few methods.
    • Removed exmplicit template instantiation and instead created .tpp files to keep template implementations

    opened by panchagil 0
  • Combined the distance barrier and CCD broad-phases

    Combined the distance barrier and CCD broad-phases

    • Exposed broad-phase in order to get the candidate collisions
    • Modified DistanceBarrier::detectCollisions to first build a common collision candidate set
    • Using this set run the narrow-phase of both the barrier and the CCD
    • TODO: Expose the ev_candidates as a member variable.
    • TODO: Add a is_collision_candidates_frozen flag to cause detectCollisions to not run the broad-phase again.
    opened by zfergus 0
  • Added BFGS and gradient descent solvers

    Added BFGS and gradient descent solvers

    • Added BFGS and GD to barrier solver as inner solvers
    • Needed to move some functionality out of NewtonSolver and into OptimizationSolvers
    • TODO: Move free_dof out of the OptimizationSolver and into the optimization problem with the eval_* functions using free_dof to remove elements.
    opened by zfergus 0
  • Added Rigid Body System Derivatives and  Rigid Body Problem

    Added Rigid Body System Derivatives and Rigid Body Problem

    • Added python notebook to get exact derivatives of RB transformation
    • Moved rigid body to its own file (out of rigid_body_system)
      • Added tests for RB gradient/hessian comparing with exact solutions
    • Added assembly of gradient and hessian on RB-System
      • Added test for RB-System comparing with exact solutions

    Added Rigid Body Problem

    • Added Rigid Body Problem to opt/
    • Implemented Functional, its gradient and hessian
      • tested against finite differences
    • Added tensor util to compute the multiplication of (1x2N) * (2N x 3B x 3B) used by the chain rule.
    opened by panchagil 0
  • Rigid body system

    Rigid body system

    • Moved rigid bodies to physics/ folder
      • added RigidBodySystem that keeps list of RB.
    • Moved solvers to solvers/ folder
    • Removed (a lot of)unused code
    opened by panchagil 0
  • Rigid bodies

    Rigid bodies

    Add UI features for controlling rigid bodies individually

    • Added gradient and hessian of compute_particle_displacements
      • This will be removed later it not used
    • Improved readability by using .homogeneous and .hnormalized
    • Edit buttons half width
    • Rigid body section to control the velocity of each body
    • State method to update the displacements and other fields from the rigid bodies
    opened by zfergus 0
  • Add menu to procedurally generate a chain of n links

    Add menu to procedurally generate a chain of n links

    The menu loads the one-link fixture file and duplicates the link n times. Each link has a scaled displacement, so all links have at least one contact.

    opened by zfergus 0
  • Unknown CMake command

    Unknown CMake command "rigid_ipc_download_project"

    Hi, I git clone the rigid-ipc, and use python build.py to compile the project.

    It gives this error: CMake Error at python/CMakeLists.txt:6 (rigid_ipc_download_project): Unknown CMake command "rigid_ipc_download_project". Call Stack (most recent call first): python/CMakeLists.txt:13 (rigid_ipc_download_pybind11)

    my cmake version is 3.16.3 os: ubuntu 20.04 python: miniconda with python 3.7

    BTW, I also tried with:

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

    This can make with no mistakes.

    I think something wrong with the python part? Any suggestions? Thanks!

    opened by WenqiangX 0
Releases(s2021)
Owner
Incremental Potential Contact code and related projects.
codes for Self-paced Deep Regression Forests with Consideration on Ranking Fairness

Self-paced Deep Regression Forests with Consideration on Ranking Fairness This is official codes for paper Self-paced Deep Regression Forests with Con

Learning in Vision 4 Sep 11, 2022
Official pytorch implementation for Learning to Listen: Modeling Non-Deterministic Dyadic Facial Motion (CVPR 2022)

Learning to Listen: Modeling Non-Deterministic Dyadic Facial Motion This repository contains a pytorch implementation of "Learning to Listen: Modeling

50 Dec 17, 2022
PyTorch implementation of "Image-to-Image Translation Using Conditional Adversarial Networks".

pix2pix-pytorch PyTorch implementation of Image-to-Image Translation Using Conditional Adversarial Networks. Based on pix2pix by Phillip Isola et al.

mrzhu 383 Dec 17, 2022
Tensorflow 2 implementations of the C-SimCLR and C-BYOL self-supervised visual representation methods from "Compressive Visual Representations" (NeurIPS 2021)

Compressive Visual Representations This repository contains the source code for our paper, Compressive Visual Representations. We developed informatio

Google Research 30 Nov 23, 2022
Apply AnimeGAN-v2 across frames of a video clip

title emoji colorFrom colorTo sdk app_file pinned AnimeGAN-v2 For Videos 🔥 blue red gradio app.py false AnimeGAN-v2 For Videos Apply AnimeGAN-v2 acro

Nathan Raw 36 Oct 18, 2022
Labels4Free: Unsupervised Segmentation using StyleGAN

Labels4Free: Unsupervised Segmentation using StyleGAN ICCV 2021 Figure: Some segmentation masks predicted by Labels4Free Framework on real and synthet

70 Dec 23, 2022
Weakly-Supervised Semantic Segmentation Network with Deep Seeded Region Growing (CVPR 2018).

Weakly-Supervised Semantic Segmentation Network with Deep Seeded Region Growing (CVPR2018) By Zilong Huang, Xinggang Wang, Jiasi Wang, Wenyu Liu and J

Zilong Huang 245 Dec 13, 2022
Lorien: A Unified Infrastructure for Efficient Deep Learning Workloads Delivery

Lorien: A Unified Infrastructure for Efficient Deep Learning Workloads Delivery Lorien is an infrastructure to massively explore/benchmark the best sc

Amazon Web Services - Labs 45 Dec 12, 2022
Recurrent Neural Network Tutorial, Part 2 - Implementing a RNN in Python and Theano

Please read the blog post that goes with this code! Jupyter Notebook Setup System Requirements: Python, pip (Optional) virtualenv To start the Jupyter

Denny Britz 863 Dec 15, 2022
EasyMocap is an open-source toolbox for markerless human motion capture from RGB videos.

EasyMocap is an open-source toolbox for markerless human motion capture from RGB videos. In this project, we provide the basic code for fitt

ZJU3DV 2.2k Jan 05, 2023
Simply enable or disable your Nvidia dGPU

EnvyControl (WIP) Simply enable or disable your Nvidia dGPU Usage First clone this repo and install envycontrol with sudo pip install . CLI Turn off y

Victor Bayas 292 Jan 03, 2023
Introducing neural networks to predict stock prices

IntroNeuralNetworks in Python: A Template Project IntroNeuralNetworks is a project that introduces neural networks and illustrates an example of how o

Vivek Palaniappan 637 Jan 04, 2023
An Open-Source Toolkit for Prompt-Learning.

An Open-Source Framework for Prompt-learning. Overview • Installation • How To Use • Docs • Paper • Citation • What's New? Nov 2021: Now we have relea

THUNLP 2.3k Jan 07, 2023
Patch SVDD for Image anomaly detection

Patch SVDD Patch SVDD for Image anomaly detection. Paper: https://arxiv.org/abs/2006.16067 (published in ACCV 2020). Original Code : https://github.co

Hong-Jeongmin 0 Dec 03, 2021
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

CopeNLU 36 Dec 05, 2022
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.

AutoTrader AutoTrader is Python-based platform intended to help in the development, optimisation and deployment of automated trading systems. From sim

Kieran Mackle 485 Jan 09, 2023
CowHerd is a partially-observed reinforcement learning environment

CowHerd is a partially-observed reinforcement learning environment, where the player walks around an area and is rewarded for milking cows. The cows try to escape and the player can place fences to h

Danijar Hafner 6 Mar 06, 2022
Pytorch implementation of the paper DocEnTr: An End-to-End Document Image Enhancement Transformer.

DocEnTR Description Pytorch implementation of the paper DocEnTr: An End-to-End Document Image Enhancement Transformer. This model is implemented on to

Mohamed Ali Souibgui 74 Jan 07, 2023
CNN visualization tool in TensorFlow

tf_cnnvis A blog post describing the library: https://medium.com/@falaktheoptimist/want-to-look-inside-your-cnn-we-have-just-the-right-tool-for-you-ad

InFoCusp 778 Jan 02, 2023
Implementation of the GBST block from the Charformer paper, in Pytorch

Charformer - Pytorch Implementation of the GBST (gradient-based subword tokenization) module from the Charformer paper, in Pytorch. The paper proposes

Phil Wang 105 Dec 26, 2022