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.
Assginment for UofT CSC420: Intro to Image Understanding

Run the code Open edge_detection.ipynb in google colab. Upload image1.jpg,image2.jpg and my_image.jpg to '/content/drive/My Drive'. chooose 'Run all'

Ziyi-Zhou 1 Feb 24, 2022
This is an official implementation of "Polarized Self-Attention: Towards High-quality Pixel-wise Regression"

Polarized Self-Attention: Towards High-quality Pixel-wise Regression This is an official implementation of: Huajun Liu, Fuqiang Liu, Xinyi Fan and Don

DeLightCMU 212 Jan 08, 2023
A PyTorch-Based Framework for Deep Learning in Computer Vision

TorchCV: A PyTorch-Based Framework for Deep Learning in Computer Vision @misc{you2019torchcv, author = {Ansheng You and Xiangtai Li and Zhen Zhu a

Donny You 2.2k Jan 09, 2023
Source code of CIKM2021 Long Paper "PSSL: Self-supervised Learning for Personalized Search with Contrastive Sampling".

PSSL Source code of CIKM2021 Long Paper "PSSL: Self-supervised Learning for Personalized Search with Contrastive Sampling". It consists of the pre-tra

2 Dec 21, 2021
[ICLR'19] Trellis Networks for Sequence Modeling

TrellisNet for Sequence Modeling This repository contains the experiments done in paper Trellis Networks for Sequence Modeling by Shaojie Bai, J. Zico

CMU Locus Lab 460 Oct 13, 2022
Recursive Bayesian Networks

Recursive Bayesian Networks This repository contains the code to reproduce the results from the NeurIPS 2021 paper Lieck R, Rohrmeier M (2021) Recursi

Robert Lieck 11 Oct 18, 2022
Pgn2tex - Scripts to convert pgn files to latex document. Useful to build books or pdf from pgn studies

Pgn2Latex (WIP) A simple script to make pdf from pgn files and studies. It's sti

12 Jul 23, 2022
Gans-in-action - Companion repository to GANs in Action: Deep learning with Generative Adversarial Networks

GANs in Action by Jakub Langr and Vladimir Bok List of available code: Chapter 2: Colab, Notebook Chapter 3: Notebook Chapter 4: Notebook Chapter 6: C

GANs in Action 914 Dec 21, 2022
Robust Consistent Video Depth Estimation

[CVPR 2021] Robust Consistent Video Depth Estimation This repository contains Python and C++ implementation of Robust Consistent Video Depth, as descr

Facebook Research 213 Dec 17, 2022
ManiSkill-Learn is a framework for training agents on SAPIEN Open-Source Manipulation Skill Challenge (ManiSkill Challenge), a large-scale learning-from-demonstrations benchmark for object manipulation.

ManiSkill-Learn ManiSkill-Learn is a framework for training agents on SAPIEN Open-Source Manipulation Skill Challenge, a large-scale learning-from-dem

Hao Su's Lab, UCSD 48 Dec 30, 2022
An NLP library with Awesome pre-trained Transformer models and easy-to-use interface, supporting wide-range of NLP tasks from research to industrial applications.

简体中文 | English News [2021-10-12] PaddleNLP 2.1版本已发布!新增开箱即用的NLP任务能力、Prompt Tuning应用示例与生成任务的高性能推理! 🎉 更多详细升级信息请查看Release Note。 [2021-08-22]《千言:面向事实一致性的生

6.9k Jan 01, 2023
Generating Videos with Scene Dynamics

Generating Videos with Scene Dynamics This repository contains an implementation of Generating Videos with Scene Dynamics by Carl Vondrick, Hamed Pirs

Carl Vondrick 706 Jan 04, 2023
MNIST, but with Bezier curves instead of pixels

bezier-mnist This is a work-in-progress vector version of the MNIST dataset. Samples Here are some samples from the training set. Note that, while the

Alex Nichol 15 Jan 16, 2022
This YoloV5 based model is fit to detect people and different types of land vehicles, and displaying their density on a fitted map, according to their coordinates and detected labels.

This YoloV5 based model is fit to detect people and different types of land vehicles, and displaying their density on a fitted map, according to their

Liron Bdolah 8 May 22, 2022
Fast and exact ILP-based solvers for the Minimum Flow Decomposition (MFD) problem, and variants of it.

MFD-ILP Fast and exact ILP-based solvers for the Minimum Flow Decomposition (MFD) problem, and variants of it. The solvers are implemented using Pytho

Algorithmic Bioinformatics Group @ University of Helsinki 4 Oct 23, 2022
Machine Learning in Asset Management (by @firmai)

Machine Learning in Asset Management If you like this type of content then visit ML Quant site below: https://www.ml-quant.com/ Part One Follow this l

Derek Snow 1.5k Jan 02, 2023
Simple and understandable swin-transformer OCR project

swin-transformer-ocr ocr with swin-transformer Overview Simple and understandable swin-transformer OCR project. The model in this repository heavily r

Ha YongWook 67 Dec 31, 2022
DeOldify - A Deep Learning based project for colorizing and restoring old images (and video!)

DeOldify - A Deep Learning based project for colorizing and restoring old images (and video!)

Jason Antic 15.8k Jan 04, 2023
DL course co-developed by YSDA, HSE and Skoltech

Deep learning course This repo supplements Deep Learning course taught at YSDA and HSE @fall'21. For previous iteration visit the spring21 branch. Lec

Yandex School of Data Analysis 1.3k Dec 30, 2022
Manage the availability of workspaces within Frappe/ ERPNext (sidebar) based on user-roles

Workspace Permissions Manage the availability of workspaces within Frappe/ ERPNext (sidebar) based on user-roles. Features Configure foreach workspace

Patrick.St. 18 Sep 26, 2022