Skip to content

Robust, intersection-free, simulations of rigid bodies.

License

Notifications You must be signed in to change notification settings

likaigelikaige/rigid-ipc

Repository files navigation

Fixing Collisions

Build Status

Robust, intersection free, simulations of rigid bodies in 2D and 3D.

Compilation

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

mkdir build
cd build
cmake ..
make

Dependencies

Most dependancies are downloaded through CMake depending on the build options. The only exceptions to this are:

  • Boost: We currently use the interval arithmetic library for interval root finding and the filesystem library for path manipulation.
  • Python: We use SymPy to generate some code automatically. See requirements.txt for a list of required packages.

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.

Algorithm

x_0^{t+1} = x^{t} + h * v^{t} + h^2 * g
v_0^{t+1} = (x_0^{t+1} - x^{t}) / h
if (collision_between(x^{t}, x_0^{t+1})) {
    original_collisions = CCD(x^{t}, x_0^{t+1})
    x^{t+1} = barrier_newton_solve(x^{t}, x_0^{t+1})
    if (using sequential impulses for restitution) {
         // Apply the restitution model in the above write-up
        v^{t+1} = solve_velocities(
            x^{t}, x_0^{t+1},
            v^{t}, v_0^{t+1},
            original_collisions,
            coefficient_of_restitution)
    } else {
        v^{t+1} = x^{t+1} - x^{t} / h
    }
} else {
    x^{t+1} = x_0^{t+1}
    v^{t+1} = v_0^{t+1}
}

About

Robust, intersection-free, simulations of rigid bodies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 85.0%
  • Python 9.0%
  • CMake 3.3%
  • Jupyter Notebook 1.9%
  • Other 0.8%