Research
Py-DiSMech: A Scalable and Efficient Framework for Discrete Differential Geometry-Based Modeling and Control of Soft Robots
Py-DiSMech: A Scalable and Efficient Framework for Discrete Differential Geometry-Based Modeling and Control of Soft Robots Overview Research area: Soft robotics simulation, computational mechanics, a

- arXiv
- 2512.09911
- Published
- 2025-12-10
- Authors
- Radha Lahoti, Ryan Chaiyakul, M. Khalid Jawed
AI summary
Py-DiSMech: A Scalable and Efficient Framework for Discrete Differential Geometry-Based Modeling and Control of Soft RobotsOverview
- Research area: Soft robotics simulation, computational mechanics, and control — specifically Discrete Differential Geometry (DDG) methods for elastic rods and shells, with application to soft robot modeling, contact, and feedback control.
- Technical level: Advanced. The paper assumes familiarity with continuum mechanics, implicit time integration, Newton–Raphson solvers, and reduced-order geometric modeling. The software framework itself is designed to be usable by non-experts, but the paper's derivations are technical.
- Scope (1 sentence): The paper introduces Py-DiSMech, a Python-native, open-source DDG-based simulator for rods, shells, and hybrid rod–shell soft structures that adds vectorized performance, implicit rod–shell contact, and an integrated PI feedback controller.
What This Paper Is About
Simulating soft robots is hard because they undergo large deformations governed by continuum mechanics, and existing tools force a trade-off between speed and physical accuracy — lumped-mass models are fast but unrealistic, while Finite Element Analysis (FEA) is accurate but often prohibitively slow. Contact between deformable bodies (rods and shells) under large deformation makes this worse, and existing DDG-based simulators have been limited to rod geometries, rod–rod contact only, and non-Python platforms such as MATLAB. The goal of this work is to build a single Python framework that delivers DDG-level physical fidelity, order-of-magnitude faster computation, hybrid rod–shell contact, and built-in feedback control.
Key Contributions
- Performance through vectorization: A fully vectorized NumPy implementation that replaces loop-based stencil evaluations, reported to achieve order-of-magnitude speed-ups over existing geometry-based simulators and to substantially outperform the state-of-the-art simulator Elastica in computational efficiency while maintaining physical accuracy.
- Implicit contact for hybrid rod–shell structures: Generalizes the penalty-energy-based fully implicit contact model (IMC) beyond rod–rod contact to also support shell–shell and rod–shell interactions, covering four contact types (Point-to-Point, Point-to-Edge, Edge-to-Edge, Point-to-Triangle) plus Coulomb friction.
- Integrated feedback control framework: A natural-strain-based closed-loop control module with a built-in proportional–integral (PI) controller for shape regulation and trajectory tracking, designed to be extensible to model-predictive or optimal control.
- Object-oriented, extensible, and ML-friendly software design: A modular architecture allowing user-defined elastic energies, actuation schemes, and zero-copy interoperability between NumPy arrays and deep learning frameworks like PyTorch and TensorFlow, with a case study demonstrating a custom elastic energy term.
Main Findings
- Speed advantage over Elastica: Benchmark comparisons are reported to demonstrate that Py-DiSMech substantially outperforms the state-of-the-art simulator Elastica in computational efficiency while maintaining physical accuracy. The abstract characterizes the improvement as order-of-magnitude speed-ups over existing geometry-based simulators. Specific timing numbers, hardware, and benchmark configurations are not reported in the available paper content.
- Broader contact coverage than prior DDG tools: Prior DDG simulators supported only rod–rod contact (Elastica, DisMech, MAT-DiSMech). Py-DiSMech supports rod–rod, rod–shell, and shell–shell contact pairs. Point-to-Triangle contact arises only in Rod–Shell and Shell–Shell interactions.
- Two shell bending models implemented: A hinge-based formulation and a mid-edge normal-based formulation. The mid-edge normal approach is described as more robust with respect to mesh quality and preferable for high physical fidelity, at added computational cost due to additional degrees of freedom associated with edges.
- Implicit integration for stability: The system uses implicit Euler integration with Newton–Raphson iterations, with a step-scaling parameter α that defaults to 1 and can be chosen adaptively via line search to aid convergence.
- Extensibility demonstrated: The framework is shown to accept a user-defined elastic energy term as a case study, going beyond the built-in rod and shell models.
- Open-source accessibility: The framework is fully open-source and free of proprietary dependencies, which the authors contrast with MATLAB-based tools or licensed commercial software.
- Generalization of the IMC contact framework: The authors state that IMC showed better computational speed than IPC at the cost of not enforcing no penetration, and that they extended IMC to handle shell and rod–shell contact within their simulation pipeline.
Methodology in Plain English
The authors build the simulator on well-established DDG models: the Discrete Elastic Rod (DER) method for slender rods and discrete elastic shell formulations from computer graphics for thin shells. Rather than solving continuum equations over a volume, they discretize the structure into nodes, edges (rods), and triangles (shells), and express deformation measures such as stretch, curvature, and twist directly on that mesh.
Rod state is described by nodal positions plus edge twist angles, giving a state vector of size 3N + E. Shells add extra per-shell-edge variables for the mid-edge normal model, extending the state vector with Z additional terms. Forces come from elastic energy springs (stretch, bend, twist, hinge or midedge), external effects, and a contact/friction model. The elastic energy for each spring is a quadratic form in a strain measure, and forces and Jacobians follow from the chain rule. Stiffness expressions differ by deformation mode, using the rod Young's modulus, shear modulus, cross-sectional area, area moments of inertia, polar moment of inertia, shell Young's modulus, shell thickness, and Poisson's ratios.
Time evolution uses implicit Euler integration with Newton–Raphson iteration to solve the nonlinear system at each step. The contact model is a penalty energy formulation with a piecewise energy function based on the gap distance, a stiffness parameter K1 = 15/δ, and a user-defined contact distance tolerance δ, plus Coulomb friction with coefficient μ and a slipping tolerance ν. Contact types are detected in batches, using Lumelsky's algorithm for edge–edge cases and a batched barycentric-coordinates method inspired by the NVIDIA PhysX solver for triangle–triangle cases.
The software itself is organized around a SoftRobot class that holds mesh, material parameters, simulation settings, and environment, and a TimeStepper class that builds energy and force models automatically and advances the simulation via a simulate() method. Users can define actuation routines that modify boundary conditions or natural strain parameters at each time step. Benchmarking is performed against Elastica with a focus on computational speed.
Why This Matters
- Research impact: A Python-native DDG simulator with implicit integration removes the platform barrier that limited prior DDG tools to MATLAB or C++-only implementations, and the built-in control module turns the simulator from a passive modeling tool into a testbed for feedback and learning-based control.
- Real-world applications:
- Grasping and gripping with soft, compliant end-effectors, where static friction and shell contact matter.
- Locomotion through constrained or contact-rich environments.
- Impact and collision studies involving deformable rods and shells.
- Simulation-driven design iteration for soft actuators and hybrid rod–shell structures.
- Industry relevance: The authors position the framework as filling a gap analogous to ABAQUS's role in FEA — deep customizability for a specific domain — but tailored for soft robotics, with pre-implemented modules for external forces and actuation. Open-source licensing without proprietary dependencies lowers the barrier for labs and companies that cannot afford licensed commercial software or whose workflows center on Python ML stacks.
Future Directions
- Extension beyond the PI controller: The authors state the modular design allows extension to model-predictive or optimal control, and the paper's stated aim is to support sim-to-real transfer studies — those advanced controllers are not implemented here.
- Sim-to-real validation: The framework is described as a foundation for sim-to-real research, but no physical robot validation is reported in the available content.
- Contact robustness under penetration: The authors acknowledge that the penalty method does not strictly enforce no penetration, and that Edge-to-Triangle contact arises under interpenetration; improving or bounding this behavior is an open issue.
- Generalization to other soft-body geometries: The framework covers rods, shells, and hybrid structures; whether it extends to other classes of deformable robots is not addressed.
Target Audience
Robotics and soft robotics researchers who need a fast, accurate simulator for large-deformation structures; graduate students and engineers working on rod or shell mechanics who need a Python toolchain; control researchers testing shape regulation and trajectory tracking on soft bodies; and machine learning researchers interested in hybrid physics-plus-data models who want a simulator native to NumPy and interoperable with PyTorch or TensorFlow. Readers without background in continuum mechanics or implicit numerical methods will find the modeling sections demanding, though the software-usage section is more accessible.
Authors’ abstract
High-fidelity simulation has become essential to the design and control of soft robots, where large geometric deformations and complex contact interactions challenge conventional modeling tools. Recent advances in the field demand simulation frameworks that combine physical accuracy, computational scalability, and seamless integration with modern control and optimization pipelines. In this work, we present Py-DiSMech, a Python-based, open-source simulation framework for modeling and control of soft robotic structures grounded in the principles of Discrete Differential Geometry (DDG). By discretizing geometric quantities such as curvature and strain directly on meshes, Py-DiSMech captures the nonlinear deformation of rods, shells, and hybrid structures with high fidelity and reduced computational cost. The framework introduces (i) a fully vectorized NumPy implementation achieving order-of-magnitude speed-ups over existing geometry-based simulators; (ii) a penalty-energy-based fully implicit contact model that supports rod-rod, rod-shell, and shell-shell interactions; (iii) a natural-strain-based feedback-control module featuring a proportional-integral (PI) controller for shape regulation and trajectory tracking; and (iv) a modular, object-oriented software design enabling user-defined elastic energies, actuation schemes, and integration with machine-learning libraries. Benchmark comparisons demonstrate that Py-DiSMech substantially outperforms the state-of-the-art simulator Elastica in computational efficiency while maintaining physical accuracy. Together, these features establish Py-DiSMech as a scalable, extensible platform for simulation-driven design, control validation, and sim-to-real research in soft robotics.