MCPcopy Index your code
hub / github.com/amandaghassaei/OrigamiSimulator

github.com/amandaghassaei/OrigamiSimulator @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,777 symbols 3,372 edges 56 files 197 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

OrigamiSimulator

Live demo at origamisimulator.org

This app allows you to simulate how any origami crease pattern will fold. It may look a little different from what you typically think of as "origami" - rather than folding paper in a set of sequential steps, this simulation attempts to fold every crease simultaneously. It does this by iteratively solving for small displacements in the geometry of an initially flat sheet due to forces exerted by creases. You can read more about it in our paper:

If you have feedback about features you want to see in this app, please see this thread.

All simulation methods were written from scratch and are executed in parallel in several GPU fragment shaders for fast performance. The solver extends work from the following sources:

This app also uses the methods described in Simple Simulation of Curved Folds Based on Ruling-aware Triangulation to import curved crease patterns and pre-process them in a way that realistically simulates the bending between the creases.

Originally built by Amanda Ghassaei as a final project for Geometric Folding Algorithms. Other contributors include Sasaki Kosuke, Erik Demaine, and others. Code available on Github. If you have interesting crease patterns that would make good demo files, please send them to me (Amanda) so I can add them to the Examples menu. My email address is on my website. Thanks!

Instructions:

  • Slide the Fold Percent slider to control the degree of folding of the pattern (100% is fully folded, 0% is unfolded, and -100% is fully folded with the opposite mountain/valley assignments).
  • Drag to rotate the model, scroll to zoom.
  • Import other patterns under the Examples menu.
  • Upload your own crease patterns in SVG or FOLD formats, following these instructions.
  • Export FOLD files or 3D models ( STL or OBJ ) of the folded state of your design ( File > Save Simulation as... ).
<img style="width: 100%;" src="https://github.com/amandaghassaei/OrigamiSimulator/raw/main/assets/doc/strain.jpg" />
  • Visualize the internal strain of the origami as it folds using the Strain Visualization in the left menu of the Advanced Options.
<img style="width: 100%; max-width:600px" src="https://github.com/amandaghassaei/OrigamiSimulator/raw/main/assets/doc/huffmanvr.jpg" />
  • If you are working from a computer connected to a VR headset and hand controllers, follow these instructions to use this app in an interactive virtual reality mode. (sorry I think this may be deprecated now!)

External Libraries:

You can find additional information in our 7OSME paper and project website. If you have feedback about features you want to see in this app, please see this thread.

Core symbols most depended-on inside this repo

setLink
called by 68
js/controls.js
getStroke
called by 51
js/curvedFolding.js
typeForStroke
called by 51
js/curvedFolding.js
add
called by 47
dependencies/datguivr.js
_
called by 34
dependencies/underscore-min.js
cross
called by 33
js/curvedFolding.js
_interopRequireWildcard
called by 33
dependencies/datguivr.js
id
called by 32
js/curvedFolding.js

Shape

Function 1,714
Method 51
Class 12

Languages

TypeScript100%

Modules by API surface

dependencies/three.js521 symbols
dependencies/three.min.js315 symbols
dependencies/datguivr.js135 symbols
js/curvedFolding.js112 symbols
dependencies/jquery-3.2.1.min.js86 symbols
dependencies/cdt2d.js50 symbols
js/pattern.js47 symbols
dependencies/datguivr.min.js35 symbols
dependencies/flat-ui.min.js31 symbols
dependencies/OrbitControls.js31 symbols
dependencies/earcut.js29 symbols
dependencies/numeric-1.2.6.js26 symbols

For agents

$ claude mcp add OrigamiSimulator \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact