Ori-DID： Direct Inverse Design for Origami Structures

-----Software Description-----
Ori-DID is a software for origami structure design. It simulates origami structures using the bar-hinge model, and then implements inverse design through dynamic relaxation with coupled-bar-length constraints. The software offers three functionalities: inverse design, dynamics simulation, and quasi-static simulation. To perform the computation, simply describe an origami structure or any arbitrary structure in the bar-hinge format, input relevant parameters into Excel, and apply desired external forces as needed:

Inverse Design: Specify to enable bar-length coupling in Excel. The program simultaneously simulates multiple states of the origami structure, driving each bar to converge toward their mean length across all states. This enables the bar lengths and the overall structure to evolve toward a desired minimum-energy configuration. Users may apply external forces to guide the structure in the desired direction.

Dynamics: Specify to disable bar-length coupling in Excel. The program reverts to a conventional bar-hinge simulation. An implicit Euler solver is employed and can efficiently handle large nonlinearities while maintaining stability.

Statics: Specify the use of quasi-static analysis in Excel. The program uses the same bar-hinge model but switches to computing nodal force equilibrium at each step. This approach is less efficient than the dynamics model but perfectly simulates rigid-foldable origami structures.

The program also includes a collision detection feature. It detects collisions between pairs of triangular facets. Simply specify to enable collision detection in the Excel input, and the program will include contact forces of all possible collision scenarios. This can be incorporated into both dynamic relaxation and static/dynamic simulations, with a reduction in computational speed.

-----Core Module Descriptions-----
- A_Pattern.xlsx:		An Excel spreadsheet for convenient input of model information. User instructions and example sheets are included.
- A1_Simulation.m:		Carries out forward computation for quasi-static simulation, dynamics simulation, and dynamic relaxation.
- A2_Postprocess.m:	Reads .mat files generated by A1_Simulation and completes post-processing including visualization and output of .gif, .svg and .stl files.
- ODEdS.m:         		Core function for calculating dynamic system derivatives and Jacobians among other variables.

-----Example design cases-----
A0_Example_MiuraDynamic.m: 		A forward dynamics simulation of a Miura-ori pattern.
A0_Example_MiuraMorph.m:  			An inverse design case of a developable and flat-foldable Miura-ori pattern which forms a spherical surface.
A0_Example_MiuraStatic.m:   			A forward quasi-static simulation of a Miura-ori pattern.
A0_Example_Resch.m: 			An inverse design case of a developable Ron Resch pattern which forms a spherical, saddle and cylindrical surface.
A0_Example_WaterbombConcave.m: 		An inverse design case of a concave Waterbomb pattern which folds into a cylindrical profile and unfolds into a concave profile. Note the generation of twist folding by the inverse design process.
A0_Example_WaterbombConcaveTest.m: 	A forward dynamics simulation of the concave Waterbomb pattern.
A0_Example_WaterbombConvex.m: 		An inverse design case of a convex Waterbomb pattern which folds into a convex profile and unfolds into a cylindrical profile. Note how collision detection is needed here to avoid panel interference in design results.
A0_Example_WaterbombConvexTest.m: 		A forward dynamics simulation of the convex Waterbomb pattern.

-----Further Information-----
The method behind this software is detailed in a journal paper (https://doi.org/10.1016/j.ijmecsci.2026.111864, PDF file included in zip package). The software was developed under the MATLAB 2026a environment. Running Ori-DID on earlier versions of MATLAB might cause minor errors due to lack of backward compatibility. Typical errors include unrecognised plotting commands, which can be solved by simply commenting out. If you have any questions regarding the software use and further development, or simiply want to chat about origami and deployable structures, please feel free to contact me at tianshuw@tju.edu.cn.

-----License-----
MIT License
Copyright (c) 2026 Tianshu Wang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.