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.post5

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.post5
File Size Uploaded Provenance Actions
dismech_newton-0.1.0.post5.tar.gz 82.7 kB With provenance Details for dismech_newton-0.1.0.post5.tar.gz

Built distribution (wheel)

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

Total release size: 169.7 kB

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

Download URL dismech_newton-0.1.0.post5.tar.gz
Size 82.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d2526f7ff7d777cdcd88c20a9802fdfb0b8d8464f0f4528bfe1ed28b3b5cebf5
BLAKE2b-256 checksum
How to use checksums
fe0669561535b20069dbfd59272b5a96418869d0f3109f8d951c3f7097151111
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 2, 2026.

Transparency log

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

Download URL dismech_newton-0.1.0.post5-py3-none-any.whl
Size 87.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
edaf566640842ee9e8ebe16e7df562ea6bcbe0dcc0af830a945d43772465ac4a
BLAKE2b-256 checksum
How to use checksums
18cf14b4b7fb312ddbbc640030235fe47a47a2a512b610dfb6c2a42e10e9d4e6
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 2, 2026.

Transparency log

Security for dismech-newton 0.1.0.post5

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dismech_newton-0.1.0.post5.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 2, 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