Metadata-Version: 2.4
Name: dismech-newton
Version: 0.1.0.post4
Summary: Discrete Elastic Rods for NVIDIA Newton.
Keywords: discrete elastic rods,rods,simulation,physics,robotics,newton,warp,gpu
Author: ryanchaiyakul
Author-email: ryanchaiyakul <ryanchaiyakul@gmail.com>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Environment :: GPU :: NVIDIA CUDA
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Dist: newton~=1.6.0
Requires-Dist: scipy>=1.14
Requires-Dist: cupy-cuda13x>=14.2.0 ; extra == 'gpu'
Requires-Dist: nvmath-python[cu13]>=1.0 ; extra == 'gpu'
Requires-Dist: torch>=2.9 ; extra == 'splat'
Requires-Dist: gswarp>=1.1 ; extra == 'splat'
Requires-Dist: usd-core>=25.11 ; extra == 'splat'
Requires-Dist: imgui-bundle>=1.92.900 ; extra == 'viewer'
Requires-Dist: pyglet>=2.1.6,<3 ; extra == 'viewer'
Requires-Dist: pyopengl>=3.1 ; extra == 'viewer'
Requires-Dist: pillow>=10 ; extra == 'viewer'
Requires-Dist: matplotlib>=3.8 ; extra == 'viewer'
Requires-Dist: viser>=1.1.1 ; extra == 'viewer'
Requires-Python: >=3.10
Project-URL: Homepage, https://github.com/ryanchaiyakul/dismech-newton
Project-URL: Issues, https://github.com/ryanchaiyakul/dismech-newton/issues
Provides-Extra: gpu
Provides-Extra: splat
Provides-Extra: viewer
Description-Content-Type: text/markdown

# DiSMech-Newton

[![PyPI](https://img.shields.io/pypi/v/dismech-newton)](https://pypi.org/project/dismech-newton/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://opensource.org/license/gpl-3.0)
![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)
![CUDA 13](https://img.shields.io/badge/CUDA-13-76B900)

Discrete elastic rods and shells for [NVIDIA Newton](https://github.com/newton-physics/newton).

**`DiSMechSolver`**: implicit discrete rods and shells inspired by [Daviet (2023)](https://research.nvidia.com/labs/prl/admm_hair/).

## Examples

<table>
  <tr>
    <th width="25%">Cantilever</th>
    <th width="25%">Overhand Knot</th>
    <th width="25%">Plectoneme</th>
    <th width="25%">Flagella Bundling</th>
  </tr>
  <tr>
    <td><img src="https://raw.githubusercontent.com/ryanchaiyakul/dismech-newton/master/docs/admm_cantilever.webp" alt="Cantilever" width="200"></td>
    <td><img src="https://raw.githubusercontent.com/ryanchaiyakul/dismech-newton/master/docs/admm_knot.webp" alt="Overhand knot" width="200"></td>
    <td><img src="https://raw.githubusercontent.com/ryanchaiyakul/dismech-newton/master/docs/admm_plectoneme.webp" alt="Plectoneme" width="200"></td>
    <td><img src="https://raw.githubusercontent.com/ryanchaiyakul/dismech-newton/master/docs/admm_flagella.webp" alt="Flagella bundling" width="200"></td>
  </tr>
  <tr>
    <td valign="top">DER (top) and Newton's VBD (bottom) against Euler-Bernoulli.<br><code>uv run examples/cantilever.py</code></td>
    <td valign="top">A knot pulled tight with friction <a href="https://doi.org/10.1103/PhysRevLett.99.164301">Audoly et al. (2007)</a>.<br><code>uv run examples/overhand_knot.py</code></td>
    <td valign="top">A twisted rod coils into a plectoneme <a href="https://doi.org/10.1016/j.bpj.2009.02.032">Clauvelin et al. (2009)</a>.<br><code>uv run examples/plectoneme.py</code></td>
    <td valign="top">Flagella bundle in a viscous fluid <a href="https://arxiv.org/abs/2205.10309">Tong et al. (2022)</a>.<br><code>uv run examples/flagella.py --flagella 10</code></td>
  </tr>
  <tr>
    <th width="25%">Shell Cantilever</th>
    <th width="25%">Shell Fold</th>
    <th width="25%">System Identification</th>
    <th width="25%">RGB-D Capture</th>
  </tr>
  <tr>
    <td><img src="https://raw.githubusercontent.com/ryanchaiyakul/dismech-newton/master/docs/admm_shell_cantilever.webp" alt="Shell cantilever" width="200"></td>
    <td><img src="https://raw.githubusercontent.com/ryanchaiyakul/dismech-newton/master/docs/admm_shell_fold.webp" alt="A cloth strip folding onto itself" width="200"></td>
    <td><img src="https://raw.githubusercontent.com/ryanchaiyakul/dismech-newton/master/docs/fit_buckling.webp" alt="Fitting stiffness, density and damping to buckling recordings" width="200"></td>
    <td><img src="https://raw.githubusercontent.com/ryanchaiyakul/dismech-newton/master/docs/fit_capture.webp" alt="A rod's geometry, stiffness and damping from one RGB-D camera" width="200"></td>
  </tr>
  <tr>
    <td valign="top">Midedge shells beside Newton's VBD cloth against plate theory.<br><code>uv run examples/shell_cantilever.py</code></td>
    <td valign="top">A cloth strip folds onto itself with self-contact friction.<br><code>uv run examples/shell_fold.py</code></td>
    <td valign="top">L-BFGS fits parameters from positions and a gripper force sensor.<br><code>uv run examples/fit_buckling.py</code></td>
    <td valign="top">Fitting rod geometry and parameters from a single RGB-D camera.<br><code>uv run --extra splat examples/fit_capture.py</code></td>
  </tr>
</table>

## Install

Requires Python 3.10+. Runs on an NVIDIA GPU with CUDA 13 or on the CPU.

```bash
pip install "dismech-newton[gpu]"
```
