This app uses three.js to visualize and interact with the 3D geometry of the folding.
Triangulation of quad faces in origami patterns is achieved by adding the shortest edge across the quad (this helps to preserve symmetry, which
makes the simulation work better). Arbitrary polygonal faces are triangulated using the Earcut Library.
Additionally, I used jQuery, Bootstrap, and the
Flat UI theme to build the GUI.
Built by Amanda Ghassaei as a final project for Geometric Folding Algorithms.
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!
File Import Tips
Bad design files will throw errors and create models that explode or cannot be solved, here are some tips for
importing FOLD or svg files that work.
The FOLD file format is specified in these docs.
This tool imports FOLD v1.0 files with all of the following fields populated:
If you are unsure whether your FOLD file is valid, you can inspect it using the
The SVG importer supports path objects and line objects (coming). Please convert polygons to paths before importing.
Mountain folds are red - rgb(255, 0, 0), hex #ff0000
Valley folds are blue - rgb(0, 0, 255), hex #0000ff
Outline edges are black - rgb(0, 0, 0), hex #000000
This tool will automatically triangulate regions in the pattern that form polygons with more than three sides.
To control the triangulations draw lines in yellow - rgb(255, 255, 0), hex #ffff00
In general, patterns move better when their triangulation is symmetric and minimizes long, skinny triangles.
Stroke and line style do not matter.
The final fold angle of a mountain or valley fold is set by its opacity. For example, 1.0 = 180°
(fully folded), 0.5 = 90°, 0 = 0° (flat). Any fold angle between 0° and 180° may be used.
This tool should be able to automatically clean files of slightly misaligned vertices, stray vertices,
duplicate lines, and extra vertices falling in the middle of an edge,
but it is recommended to remove these errors yourself in order to avoid problems.
If your simulation is not working, check that the pattern looks correct by clicking on the "Pattern" view in the top nav bar.
For Adobe Illustrator users:
I use Illustrator to create SVGs (though any vector editing program should be fine), here are some tips I've found for making svgs to import into this tool.
If you are starting with a pre-made vector file, first ungroup any groups, release all compound paths
(Select all + Object>Compound Path>Release), and release all clipping masks (Select all + Object>Clipping Mask>Release).
Create geometry using the Line Segment Tool.
Illustrator can help you select all lines of a particular type so that you can edit their color or opacity together. Click the line,
then go to Select>Same>Appearance to select all similar lines in the pattern.
To turn lines and polygons into path objects, select the geometry then right click and select Make Compound Path.
Finally hit Save As and select .svg extension. I'm using the default SVG 1.1 settings, but version 1.0 will work as well.
This tool currently supports an interactive Virtual Reality mode using the Vive headset and controllers.
For this to work, you must first use a WebVR enabled browser:
currently only Firefox Nightly is supported by this app.
When you open this page with the appropriate browser and a Vive connected through Steam VR, you will see a button that says "Enter VR". Clicking this will
put the app in an interactive VR mode. The hand controllers will allow you to grab the origami mesh and pull on it.
This is especially interesting if you set the Mesh Material to Strain Visualization so you can see how your interactions
change the internal strains in the material.
If the simulation looks choppy, consider lowering the Num simulation steps per render setting under Animation Settings in the right hand menu.
The dynamic simulation is calculated by solving for all the forces in the system, moving time forward in small Δt steps,
and updating the vertices of the origami incrementally. The time step size for this animation is calculated automatically
based on the material stiffnesses set in the Simulation Settings section: more stiff settings
require shorter time steps to solve and will slow down the simulation.
Num simulation steps per render allows you to control the number of tiny time steps forward to take on each
render cycle. If the simulation looks choppy to you, you might consider lowering this setting.
Lowering the number of steps per render will slow down the simulation, but will result in a more smooth animation.
Dimensions: (the STL file format is unitless, but typically assumed to be either in inches or mm)
Dimensions: (the OBJ file format is unitless, but typically assumed to be either in inches or mm)
Dimensions: For more information about the FOLD file format, see the offical docs.
Average vertex error gives a sense of how much the distance constraints in the
origami pattern are being violated (i.e. how much the sheet is being stretched). The error at each vertex is evaluated by averaging the
percent deviation of all its distance constraints with adjacent vertices. This error is
reported as a percent of the total length of the distance constraint to remove scaling effects.
This measurement is equivalent to
Cauchy strain or engineering strain of the distance constraints on this system.
Increasing the Axial Stiffness will tighten these constraints and
lower the error in the simulation.
To visualize the error of each vertex graphically, select Strain Visualization under Mesh Material
in the left menu.
This app uses a compliant dynamic simulation method to solve for the geometry of an origami pattern
at a given fold angle. The simulation sets up several types of constraints: distance constraints prevent the
sheet from stretching or compressing, and angular constraints fold or flatten the sheet. Each of these constraints is weighted by a stiffness - the stiffer the constraint, the better it is enforced
in the simulation.
Axial Stiffness is the stiffness of the distance constraints. Increasing axial
stiffness will decrease the strain in the simulation, but it will also slow down the solver.
Fold and facet stiffnesses correspond to two types of angular constraints. Fold Stiffness is the stiffness of the mountain
and valley creases in the origami pattern. Facet Stiffness is the stiffness of the triangulated faces between
creases in the pattern. Increasing facet stiffness causes the faces between creases to stay very flat as the origami is folded.
As facet stiffness becomes very high, this simulation approaches a
rigid origami simulation, and models the behavior of a rigid material (such as metal) when folded.
Constraints strengths (units of N) are scaled by the length of a particular constraint to determine the stiffness. Axial stiffness is calculated by dividing
axial strength by length; angular stiffness is calculated by multiplying fold or facet strength by length.
Since this is a dynamic simulation, vertices of the origami move with some notion of acceleration and velocity. In order to
keep the system stable and help it converge to a static solution,
damping is added to the distance constraints. The Damping slider allows you to control the amount of damping
present in the simulation, from 0 (no damping) to 1 (critical damping). Decreasing damping makes the simulation more "springy".
It may be useful to temporarily turn down damping to help the simulation more quickly converge towards its static solution - especially
for patterns that take a long time to curl.