novaphy.solvers.SolverIPC¶
Newton-aligned SolverBase adapter over libuipc
for mathematically guaranteed penetration-free Incremental Potential
Contact. Requires CUDA ≥ 12.4 and a build with NOVAPHY_WITH_IPC=ON.
When IPC is not built, both SolverIPC and IPCConfig resolve to None;
always feature-check before constructing:
if novaphy.has_ipc() and novaphy.solvers.SolverIPC is not None:
solver = novaphy.solvers.SolverIPC(model, novaphy.solvers.IPCConfig())
How It Works¶
- Shape conversion — Boxes, spheres, cylinders, and convex hulls become volumetric tetrahedral meshes; triangle meshes and heightfields become codimensional shells; planes become libuipc ground geometry.
- GPU Newton solver — libuipc solves the barrier-based contact problem on GPU.
- Barrier contact — a log-barrier potential guarantees no
interpenetration at the cost of a fixed
dtmatchingIPCConfig.dt.
The solver advances state through the standard solver.step contract; dt
and gravity are validated against the libuipc scene built at construction
time, and mismatches raise. The contacts parameter remains present for
contract compatibility, but this adapter ignores it because libuipc performs
collision internally.
Constructor¶
| Parameter | Description |
|---|---|
model |
Required. Model from ModelBuilder.finalize(). |
config |
IPCConfig (dt, gravity, contact/barrier, material, and Newton-solve parameters). |
Build with IPC¶
git submodule update --init --recursive external/libuipc
CMAKE_ARGS="-DNOVAPHY_WITH_IPC=ON -DNOVAPHY_GPU_PLATFORM=NVIDIA -DCMAKE_CUDA_COMPILER=/path/to/nvcc" \
python -m pip install -e .
See Build from Source for NVIDIA and CoreX toolchain requirements and the standalone CMake preset path.
Example¶
import novaphy
if novaphy.has_ipc():
config = novaphy.solvers.IPCConfig()
config.dt = 1.0 / 60.0
solver = novaphy.solvers.SolverIPC(model, config)
state = model.state()
control = model.control()
for _ in range(steps):
solver.step(state, state, control, None, config.dt)
When To Use¶
| Scenario | Recommendation |
|---|---|
| Guaranteed no-penetration (precise machinery, jamming, tight clearances) | Use IPC. |
| Real-time large scenes on commodity GPUs | Often SolverSemiImplicit is faster; profile first. |
| Deformable bodies (planned) | IPC is the future home; today only rigid. |
Limitations¶
- Fixed
dtrequirement: changingdtbetween steps requires reconstructing the solver. - CUDA-only: no CPU fallback.
- There is no public top-level
novaphy.IPCWorldcontainer in current releases. New code should usenovaphy.solvers.SolverIPC.
Demos¶
| Demo | What it shows |
|---|---|
python/demos/demo_ipc_stack.py |
Box stacking with guaranteed no-penetration. |