The crease pattern on the left's folded form has been simulated by this library.
Locally Flat Foldable
Global flat-foldability is an np-hard problem.
Local flat foldability concerns the area around 1 intersection of edges, and can be determined using a number of operations including Kawasaki's theorem and Maekawa's theorem.
The following crease pattern has minor errors throughout:
nodes[ index]. flatFoldable();
The sum of alternating angles around a node must equal 180 degrees.
Kawasaki's Theorem can also be used to discover a 4th additional crease necessary to make a 3-fold unit flat foldable.
What is the missing crease needed to satisfy flat-foldability?
findFlatFoldable(); // crease an edge from the center with that angle false← cp. nodes[ 0]. flatFoldable();
When considering the adjacent edges around a node the number of mountain and valley creases must differ by ±2.
For a crease pattern to be flat-foldable the graph must be 2-colorable, or a bipartite graph.
This implies that each vertex must have an even number of edges connecting it unless it is a boundary vertex. It also says there will be an even number of boundary vertices.
To simulate the folded state, faces are reflected across neighboring crease lines using a reflection matrix.
To calculate more complex crease patterns, one face is selected to be fixed, then the following data structure is calculated- a tree map of the neighbor relationships to each face.