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

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

Built distribution (wheel)

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

Total release size: 278.1 kB

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

Download URL dismech_newton-0.1.0.post7.tar.gz
Size 131.2 kB
Tags Source
SHA-256 checksum
How to use checksums
58d145e394d0d5d1401586e2be0ebbbc0d9d2dfd5e19a5db934de211fc669217
BLAKE2b-256 checksum
How to use checksums
97ff19ce71039076c449eecbabe20b5a12963e79217b8cad5d2eefac487f6191
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 15, 2026.

Transparency log

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

Download URL dismech_newton-0.1.0.post7-py3-none-any.whl
Size 146.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f6a48eacefd059df8e9402cdb195f9f7121c1445d3dc3e52a27b4991c18a85c
BLAKE2b-256 checksum
How to use checksums
48cb6e67888e53a61e9fa0ddd379a1a2d2c4c95954382c231bad689821700d19
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 15, 2026.

Transparency log

Security for dismech-newton 0.1.0.post7

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.post7.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 15, 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