ipc-sim / IPC

Incremental Potential Contact (IPC) is for robust and accurate time stepping of nonlinear elastodynamics. IPC guarantees intersection- and inversion-free trajectories regardless of materials, time-step sizes, velocities, or deformation severity.
https://ipc-sim.github.io/
MIT License
558 stars 73 forks source link

Docs for integration into existing project #25

Closed xarthurx closed 1 year ago

xarthurx commented 2 years ago

Hi, I just got to know this paper the found it is amazingly open-sourced!

By briefly reading the doc, it seems (correct me if I'm wrong) the current code is meant to be used as independent software.

Is it possible / Is there any doc for integrating it into an existing project in a library mode? Say, I'd like to run the simulation in my own OpenGL environment on my mesh; and instead of exporting all the output into files, I would like to store the obj output internally, and use a slider control at which stage the simulation is, etc...

liminchen commented 2 years ago

Thanks for your interest in incorporating it into your project! Although it is possible, we admit that it is not designed for it so it would take efforts to make it happen given the current structure of the code. However, if you want to write your own optimization time integrator, we provided straightforward API in the ipc-toolkit repository for convenience.