You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Origami Definition Language is a language used to define origami instructions. It is designed to be easily parseable by both human and machine and sets its focus on automatic instruction generation. It includes loads of linear algebra.
Fundamentals
One important realisation was that the language only describes the construction of a 3-dimensional object. The object starts out as a plane and is increasingly transformed into a shape based on rotations and adding new vertices.
Context:
The default context of a file is part. Each part context starts with a piece of paper and at the end returns its folded paper and optionally a list of exports.
construction: Construct a point or a line, but don't keep any folds
composition: Compose models from different files
The only possible mutation in Origami is a fold. Every fold generates a line and may optionally be unfolded again (fold and @fold).
Origami is a strongly typed language that knows three types. Each variable starts with a symbol denoting its type:
Point: .point
Line: --line
Region: #region
These instructions are runtime specific.
# paper: square
# front: "#fa00fa"
# back: texture("texture.png")
# mark: "Flip the paper over and fold both edges to the center."
# hide: --a
# highlight: .a
Procedures
A procedure is a list of steps. The purpose of procedures is to make certain tasks reproducible with some perspective instructions between executions.
Line segments
Some folds are not supposed to crease all of a line, but only part of it to mark a specific point or line on the paper. In those cases a fold can specify a restriction to a point. The result of such an operation is a line segment.
Huzita-Hatori Axioms
The Huzita-Hatori Axioms are the mathematical principles of paper folding. Every possible fold on a piece of paper can be described using one of the axioms. As such, Origami implements these for its own fold instructions.
Folds always default to valley folds. Mountain folds can be forced by putting mountain fold instead. For consistency sake, one can also be explicit and name a fold valley fold.
1. Two points define a fold through them Instruction: fold along --(.a .b) .landmark has to be a point not on --(.a .b) to specify from which side to which side the paper is folded (the side that .landmark is on, is lifted and put on the other side)
2. There is a unique fold that places point onto point Instruction: fold .a onto .b
3. There is a unique fold that places line onto line Instruction: fold --a onto --b
4. Given a point p and line l, there is a unique fold perpendicular to l that passes through p Instruction: fold --l passing through .p
5. Given two points a and b and a line l, there is a unique fold that places a onto l and passes through b Instruction: fold .a to --l via .b
6. Given two points a and b and lines l and r, there is a unique fold that places a onto l and b onto r Instruction: fold .a to --l and .b to --r
7. Given a point p and lines l and r, there is a unique fold that places p onto l and is perpendicular to r Instruction: fold .p to --l perpendicular to --r
Type construction
Every type can be constructed from some instances of other types.
.point: .(--lineA --lineB) defines a point as the intersection between two lines
--line: --(.pointA .pointB) defines a line between two points
--line: --(--line .point 15) defines a line through .point with an angle of 15° relative to --line
#region: #(.pointA --line) is one example for a region bound by .pointA and --line
#c: #a and #b is the intersection of #a and #b
#c: #a or #b is the union of #a and #b
#c: #a \ #b is #a without #b
#c: #a <> #b is the symmetric difference between #a and #b
Program
Square paper starts out with four predefined points: .a, .b, .c and .d. Folds default to valley folds and are dependent on the size of the paper facing up.
fold .a to .b ; Folds point .a onto .b using a valley fold
mountain fold .c to .a ; Folds point .c onto .a using a mountain fold
--diagonal: fold .c to .a ; Folds .c onto .a and stores the line as --diagonal
@fold .a to .b ; Fold and unfold .a onto .b
Program instructions are independent of steps. Steps are visualizations for a user and can contain multiple program instructions.
Special folds that need to be supported
Inside Reverse Fold
Outside Reverse Fold
Squash Fold
Rabbit Ear Fold
Petal Fold
Composition
export --line: Exports a variable from this part (or export anotherName: --line)
file: part ->: Names an inline part as file (its exports are available like below)
file: import 'filename': Imports all of filename's exports and adds them to the file namespace (accessible via --line::file)
The text was updated successfully, but these errors were encountered:
Origami Definition Language (Origami)
Origami Definition Language is a language used to define origami instructions. It is designed to be easily parseable by both human and machine and sets its focus on automatic instruction generation. It includes loads of linear algebra.
Fundamentals
One important realisation was that the language only describes the construction of a 3-dimensional object. The object starts out as a plane and is increasingly transformed into a shape based on rotations and adding new vertices.
Context:
The default context of a file is
part
. Eachpart
context starts with a piece of paper and at the end returns its folded paper and optionally a list of exports.construction
: Construct a point or a line, but don't keep any foldscomposition
: Compose models from different filesThe only possible mutation in Origami is a fold. Every fold generates a line and may optionally be unfolded again (
fold
and@fold
).Origami is a strongly typed language that knows three types. Each variable starts with a symbol denoting its type:
.point
--line
#region
These instructions are runtime specific.
Procedures
A procedure is a list of steps. The purpose of procedures is to make certain tasks reproducible with some perspective instructions between executions.
Line segments
Some folds are not supposed to crease all of a line, but only part of it to mark a specific point or line on the paper. In those cases a fold can specify a restriction to a point. The result of such an operation is a line segment.
Huzita-Hatori Axioms
The Huzita-Hatori Axioms are the mathematical principles of paper folding. Every possible fold on a piece of paper can be described using one of the axioms. As such, Origami implements these for its own fold instructions.
Folds always default to valley folds. Mountain folds can be forced by putting
mountain fold
instead. For consistency sake, one can also be explicit and name a foldvalley fold
.Instruction:
fold along --(.a .b)
.landmark
has to be a point not on--(.a .b)
to specify from which side to which side the paper is folded (the side that.landmark
is on, is lifted and put on the other side)Instruction:
fold .a onto .b
Instruction:
fold --a onto --b
p
and linel
, there is a unique fold perpendicular tol
that passes throughp
Instruction:
fold --l passing through .p
a
andb
and a linel
, there is a unique fold that placesa
ontol
and passes throughb
Instruction:
fold .a to --l via .b
a
andb
and linesl
andr
, there is a unique fold that placesa
ontol
andb
ontor
Instruction:
fold .a to --l and .b to --r
p
and linesl
andr
, there is a unique fold that placesp
ontol
and is perpendicular tor
Instruction:
fold .p to --l perpendicular to --r
Type construction
Every type can be constructed from some instances of other types.
.point: .(--lineA --lineB)
defines a point as the intersection between two lines--line: --(.pointA .pointB)
defines a line between two points--line: --(--line .point 15)
defines a line through.point
with an angle of 15° relative to--line
#region: #(.pointA --line)
is one example for a region bound by.pointA
and--line
#c: #a and #b
is the intersection of#a
and#b
#c: #a or #b
is the union of#a
and#b
#c: #a \ #b
is#a
without#b
#c: #a <> #b
is the symmetric difference between#a
and#b
Program
Square paper starts out with four predefined points:
.a
,.b
,.c
and.d
. Folds default to valley folds and are dependent on the size of the paper facing up.Program instructions are independent of steps. Steps are visualizations for a user and can contain multiple program instructions.
Special folds that need to be supported
Composition
export --line
: Exports a variable from this part (orexport anotherName: --line
)file: part ->
: Names an inline part asfile
(its exports are available like below)file: import 'filename'
: Imports all offilename
's exports and adds them to thefile
namespace (accessible via--line::file
)The text was updated successfully, but these errors were encountered: