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.
ANEA: Distant Supervision for Low-Resource Named Entity Recognition

ANEA: Distant Supervision for Low-Resource Named Entity Recognition ANEA is a tool to automatically annotate named entities in unlabeled text based on

Saarland University Spoken Language Systems Group 15 Mar 30, 2022
Adversarial Color Enhancement: Generating Unrestricted Adversarial Images by Optimizing a Color Filter

ACE Please find the preliminary version published at BMVC 2020 in the folder BMVC_version, and its extended journal version in Journal_version. Datase

28 Dec 25, 2022
This package proposes simplified exporting pytorch models to ONNX and TensorRT, and also gives some base interface for model inference.

PyTorch Infer Utils This package proposes simplified exporting pytorch models to ONNX and TensorRT, and also gives some base interface for model infer

Alex Gorodnitskiy 11 Mar 20, 2022
An executor that performs image segmentation on fashion items

ClothingSegmenter U2NET fashion image/clothing segmenter based on https://github.com/levindabhi/cloth-segmentation Overview The ClothingSegmenter exec

Jina AI 5 Mar 30, 2022
Predicting path with preference based on user demonstration using Maximum Entropy Deep Inverse Reinforcement Learning in a continuous environment

Preference-Planning-Deep-IRL Introduction Check my portfolio post Dependencies Gym stable-baselines3 PyTorch Usage Take Demonstration python3 record.

Tianyu Li 9 Oct 26, 2022
Project ArXiv Citation Network

Project ArXiv Citation Network Overview This project involved the analysis of the ArXiv citation network. Usage The complete code of this project is i

Dennis Núñez-Fernández 5 Oct 20, 2022
Includes PyTorch -> Keras model porting code for ConvNeXt family of models with fine-tuning and inference notebooks.

ConvNeXt-TF This repository provides TensorFlow / Keras implementations of different ConvNeXt [1] variants. It also provides the TensorFlow / Keras mo

Sayak Paul 87 Dec 06, 2022
Implicit MLE: Backpropagating Through Discrete Exponential Family Distributions

torch-imle Concise and self-contained PyTorch library implementing the I-MLE gradient estimator proposed in our NeurIPS 2021 paper Implicit MLE: Backp

UCL Natural Language Processing 249 Jan 03, 2023
List of papers, code and experiments using deep learning for time series forecasting

Deep Learning Time Series Forecasting List of state of the art papers focus on deep learning and resources, code and experiments using deep learning f

Alexander Robles 2k Jan 06, 2023
Collection of machine learning related notebooks to share.

ML_Notebooks Collection of machine learning related notebooks to share. Notebooks GAN_distributed_training.ipynb In this Notebook, TensorFlow's tutori

Sascha Kirch 14 Dec 22, 2022
[ECCV'20] Convolutional Occupancy Networks

Convolutional Occupancy Networks Paper | Supplementary | Video | Teaser Video | Project Page | Blog Post This repository contains the implementation o

622 Dec 30, 2022
Source code and Dataset creation for the paper "Neural Symbolic Regression That Scales"

NeuralSymbolicRegressionThatScales Pytorch implementation and pretrained models for the paper "Neural Symbolic Regression That Scales", presented at I

35 Nov 25, 2022
Pytorch implementation of Decoupled Spatial-Temporal Transformer for Video Inpainting

Decoupled Spatial-Temporal Transformer for Video Inpainting By Rui Liu, Hanming Deng, Yangyi Huang, Xiaoyu Shi, Lewei Lu, Wenxiu Sun, Xiaogang Wang, J

51 Dec 13, 2022
A geometric deep learning pipeline for predicting protein interface contacts.

A geometric deep learning pipeline for predicting protein interface contacts.

44 Dec 30, 2022
A Pytorch implementation of "Splitter: Learning Node Representations that Capture Multiple Social Contexts" (WWW 2019).

Splitter ⠀⠀ A PyTorch implementation of Splitter: Learning Node Representations that Capture Multiple Social Contexts (WWW 2019). Abstract Recent inte

Benedek Rozemberczki 201 Nov 09, 2022
git《Investigating Loss Functions for Extreme Super-Resolution》(CVPR 2020) GitHub:

Investigating Loss Functions for Extreme Super-Resolution NTIRE 2020 Perceptual Extreme Super-Resolution Submission. Our method ranked first and secon

Sejong Yang 0 Oct 17, 2022
Conditional Gradients For The Approximately Vanishing Ideal

Conditional Gradients For The Approximately Vanishing Ideal Code for the paper: Wirth, E., and Pokutta, S. (2022). Conditional Gradients for the Appro

IOL Lab @ ZIB 0 May 25, 2022
Prml - Repository of notes, code and notebooks in Python for the book Pattern Recognition and Machine Learning by Christopher Bishop

Pattern Recognition and Machine Learning (PRML) This project contains Jupyter notebooks of many the algorithms presented in Christopher Bishop's Patte

Gerardo Durán-Martín 1k Jan 07, 2023
Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal, multi-exposure and multi-focus image fusion.

U2Fusion Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal (VIS-IR, medical), multi

Han Xu 129 Dec 11, 2022
Ganilla - Official Pytorch implementation of GANILLA

GANILLA We provide PyTorch implementation for: GANILLA: Generative Adversarial Networks for Image to Illustration Translation. Paper Arxiv Updates (Fe

Samet Hi 462 Dec 05, 2022