Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Considerations #1

Open
7 tasks done
padarom opened this issue May 22, 2018 · 0 comments
Open
7 tasks done

Considerations #1

padarom opened this issue May 22, 2018 · 0 comments

Comments

@padarom
Copy link
Member

padarom commented May 22, 2018

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. 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant