Skip to main content

DiSMech-Newton

PyPI License: GPL v3 Python 3.10+ CUDA 13

Discrete elastic rods and midedge shells for NVIDIA Newton, inspired by Daviet (2023).

Examples

Cantilever Overhand Knot Plectoneme Flagella Bundling
Cantilever Overhand knot Plectoneme Flagella bundling
DER (top) and Newton's VBD (bottom) against Euler-Bernoulli.
uv run examples/cantilever.py
A knot pulled tight with friction Audoly et al. (2007).
uv run examples/overhand_knot.py
A twisted rod coils into a plectoneme Clauvelin et al. (2009).
uv run examples/plectoneme.py
Flagella bundle in a viscous fluid Tong et al. (2022).
uv run examples/flagella.py --flagella 10
Shell Cantilever Shell Fold Cloth Twist Franka Pick and Place
Shell cantilever A cloth strip folding onto itself A cloth sheet wrung into a coiling rope A Franka arm picking up a cable
Midedge shells beside Newton's VBD cloth against plate theory.
uv run examples/shell_cantilever.py
A cloth strip folds onto itself with self-contact friction.
uv run examples/shell_fold.py
A sheet wrung into a coiling rope by self-contact with friction.
uv run examples/newton/cloth_twist.py
A MuJoCo Franka picks up a cable.
uv run --extra mujoco examples/newton/franka_cable_ik_pick_place.py

Newton's own cable and cloth examples (pile, plectoneme, Y junction, hysteresis, cross slide table, Franka pick and place, hanging and draped cloth, ...) run on SolverDiSMech in examples/newton/. See examples/ for what each example adds.

Install

Requires Python 3.10+. Runs on an NVIDIA GPU with CUDA 13 (cuDSS through the gpu extra) or on the CPU (SciPy).

pip install "dismech-newton[gpu]"           # add `mujoco` for the coupled examples, `viewer` for the viewer

Usage

import newton
import numpy as np
from dismech_newton import SolverDiSMech

builder = newton.ModelBuilder()
points = np.linspace([0.0, 0.0, 1.0], [1.0, 0.0, 1.0], 21)  # a 1 m rod, 20 segments
bodies, _ = SolverDiSMech.add_rod(builder, rod=newton.Rod(points, radius=0.01), bend_stiffness=1.0e-2)
SolverDiSMech.fix_segment(builder, bodies[0])  # clamp the first segment
model = builder.finalize()
solver = SolverDiSMech(model)
state_0, state_1 = model.state(), model.state()
for _ in range(100):
    solver.step(state_0, state_1, None, None, 1.0e-2)  # finds its own contacts
    state_0, state_1 = state_1, state_0

Shells come from SolverDiSMech.add_cloth_mesh with Newton's add_cloth_mesh arguments.

Development

uv sync --extra gpu --extra mujoco --group dev
uv run pytest            # physical checks against theory and finite differences
uv run pytest -m slow    # the examples

Metadata

Release files for dismech-newton 0.1.0.post8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dismech-newton 0.1.0.post8
File Size Uploaded Provenance Actions
dismech_newton-0.1.0.post8.tar.gz 131.2 kB With provenance Details for dismech_newton-0.1.0.post8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dismech-newton 0.1.0.post8
File Interpreter ABI Platform Actions
dismech_newton-0.1.0.post8-py3-none-any.whl Python 3 none any Details for dismech_newton-0.1.0.post8-py3-none-any.whl

Total release size: 278.1 kB

Release files / dismech_newton-0.1.0.post8.tar.gz

Download URL dismech_newton-0.1.0.post8.tar.gz
Size 131.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7e91a6c5e8a6267f3d262b66c44dc9ccdfc5d35d1449b8073fafbfe0c6bb6f97
BLAKE2b-256 checksum
How to use checksums
8764b75abb22da486e828e43145038698042a226f572e680b6d562177dcb6e79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / dismech_newton-0.1.0.post8-py3-none-any.whl

Download URL dismech_newton-0.1.0.post8-py3-none-any.whl
Size 146.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
472db85624823877f9811b30ecd89ec78e58dbe36d4afc80d8dfbfcf015701c2
BLAKE2b-256 checksum
How to use checksums
c1778959fca541d224da974721f609a4b750d32941cc822226dca1c2c9cc8f05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for dismech-newton 0.1.0.post8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dismech_newton-0.1.0.post8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page