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.
Permute Me Softly: Learning Soft Permutations for Graph Representations

Permute Me Softly: Learning Soft Permutations for Graph Representations

Giannis Nikolentzos 7 Jul 10, 2022
A Robust Unsupervised Ensemble of Feature-Based Explanations using Restricted Boltzmann Machines

A Robust Unsupervised Ensemble of Feature-Based Explanations using Restricted Boltzmann Machines Understanding the results of deep neural networks is

Johan van den Heuvel 2 Dec 13, 2021
Pytorch implementation of Implicit Behavior Cloning.

Implicit Behavior Cloning - PyTorch (wip) Pytorch implementation of Implicit Behavior Cloning. Install conda create -n ibc python=3.8 pip install -r r

Kevin Zakka 49 Dec 25, 2022
Official implementation of Neural Bellman-Ford Networks (NeurIPS 2021)

NBFNet: Neural Bellman-Ford Networks This is the official codebase of the paper Neural Bellman-Ford Networks: A General Graph Neural Network Framework

MilaGraph 136 Dec 21, 2022
DUE: End-to-End Document Understanding Benchmark

This is the repository that provide tools to download data, reproduce the baseline results and evaluation. What can you achieve with this guide Based

21 Dec 29, 2022
Noether Networks: meta-learning useful conserved quantities

Noether Networks: meta-learning useful conserved quantities This repository contains the code necessary to reproduce experiments from "Noether Network

Dylan Doblar 33 Nov 23, 2022
FreeSOLO for unsupervised instance segmentation, CVPR 2022

FreeSOLO: Learning to Segment Objects without Annotations This project hosts the code for implementing the FreeSOLO algorithm for unsupervised instanc

NVIDIA Research Projects 253 Jan 02, 2023
Advances in Neural Information Processing Systems (NeurIPS), 2020.

What is being transferred in transfer learning? This repo contains the code for the following paper: Behnam Neyshabur*, Hanie Sedghi*, Chiyuan Zhang*.

Google Research 36 Aug 26, 2022
Rethinking of Pedestrian Attribute Recognition: A Reliable Evaluation under Zero-Shot Pedestrian Identity Setting

Pytorch Pedestrian Attribute Recognition: A strong PyTorch baseline of pedestrian attribute recognition and multi-label classification.

Jian 79 Dec 18, 2022
This is the source code of the 1st place solution for segmentation task (with Dice 90.32%) in 2021 CCF BDCI challenge.

1st place solution in CCF BDCI 2021 ULSEG challenge This is the source code of the 1st place solution for ultrasound image angioma segmentation task (

Chenxu Peng 30 Nov 22, 2022
Implementation of our paper 'RESA: Recurrent Feature-Shift Aggregator for Lane Detection' in AAAI2021.

RESA PyTorch implementation of the paper "RESA: Recurrent Feature-Shift Aggregator for Lane Detection". Our paper has been accepted by AAAI2021. Intro

137 Jan 02, 2023
Split your patch similarly to `git add -p` but supporting multiple buckets

split-patch.py This is git add -p on steroids for patches. Given a my.patch you can run ./split-patch.py my.patch You can choose in which bucket to p

102 Oct 06, 2022
Banglore House Prediction Using Flask Server (Python)

Banglore House Prediction Using Flask Server (Python) 🌐 Links 🌐 📂 Repo In this repository, I've implemented a Machine Learning-based Bangalore Hous

Dhyan Shah 1 Jan 24, 2022
DeepSpeed is a deep learning optimization library that makes distributed training easy, efficient, and effective.

DeepSpeed+Megatron trained the world's most powerful language model: MT-530B DeepSpeed is hiring, come join us! DeepSpeed is a deep learning optimizat

Microsoft 8.4k Dec 28, 2022
RODD: A Self-Supervised Approach for Robust Out-of-Distribution Detection

RODD Official Implementation of 2022 CVPRW Paper RODD: A Self-Supervised Approach for Robust Out-of-Distribution Detection Introduction: Recent studie

Umar Khalid 17 Oct 11, 2022
A new test set for ImageNet

ImageNetV2 The ImageNetV2 dataset contains new test data for the ImageNet benchmark. This repository provides associated code for assembling and worki

186 Dec 18, 2022
Rapid experimentation and scaling of deep learning models on molecular and crystal graphs.

LitMatter A template for rapid experimentation and scaling deep learning models on molecular and crystal graphs. How to use Clone this repository and

Nathan Frey 32 Dec 06, 2022
Text mining project; Using distilBERT to predict authors in the classification task authorship attribution.

DistilBERT-Text-mining-authorship-attribution Dataset used: https://www.kaggle.com/azimulh/tweets-data-for-authorship-attribution-modelling/version/2

1 Jan 13, 2022
TResNet: High Performance GPU-Dedicated Architecture

TResNet: High Performance GPU-Dedicated Architecture paperV2 | pretrained models Official PyTorch Implementation Tal Ridnik, Hussam Lawen, Asaf Noy, I

426 Dec 28, 2022
Deploy optimized transformer based models on Nvidia Triton server

🤗 Hugging Face Transformer submillisecond inference 🤯 and deployment on Nvidia Triton server Yes, you can perfom inference with transformer based mo

Lefebvre Sarrut Services 1.2k Jan 05, 2023