• Stars
    star
    303
  • Rank 137,655 (Top 3 %)
  • Language
    CoffeeScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

FOLD file format for origami models, crease patterns, etc.

FOLD [spec, viewer, API]

FOLD (Flexible Origami List Datastructure) is a file format (with extension .fold) for describing origami models: crease patterns, mountain-valley patterns, folded states, etc. Mainly, a FOLD file can store a mesh with vertices, edges, faces, and links between them, with optional 2D or 3D geometry, plus the topological stacking order of faces that overlap geometrically. A mesh can also easily store additional user-defined data. One FOLD file can even store multiple such meshes in "frames" (but this feature is not yet supported in any code).

This repository both documents the FOLD format (which is still in early stages so its definition is evolving) and provides web software tools and JavaScript libraries to aid in manipulation of FOLD files. FOLD is built upon JSON (JavaScript Object Notation) so parsers are available in essentially all programming languages. Once parsed, the format also serves as the typical data structure you'll want to represent foldings in your software. Our libraries also help build useful redundant data structures for navigating the mesh.

FOLD is similar in spirit to the OBJ format (and other similar formats) for storing 3D meshes; its main distinguishing features are easy parsing, easy extensibility, the ability to disambiguate overlapping faces with stacking order, and the ability to define edges and thus edge properties (such as mountain-valley assignments) and arbitrary polyhedral complexes. (Without edges, OBJ cannot distinguish between two faces sharing two consecutive vertices from faces sharing an edge.) In addition, FOLD can support linkages (with 1D edges but no 2D faces).

FOLD Format Documentation

FOLD Software Tools

Here is software supporting the FOLD format, built both within this project and by other people:

  • FOLD viewer loads and display a given .fold file, useful for visualization and testing
  • Amanda Ghassaei's Origami Simulator supports FOLD input and output
  • Tomohiro Tachi's Freeform Origami (simulator and design tool) supports FOLD input and output
  • Robby Kraft's Rabbit Ear is based on FOLD. It includes a file converter (FOLD display, SVG import/export, and flat folding).
  • ORIPA: Origami Pattern Editor v1.10+ supports FOLD import/export (in addition to its OPX file format).
  • Crease Pattern Editor supports FOLD export

FOLD JavaScript Library

For simple web apps, add this tag to your HTML: <script src="https://edemaine.github.io/fold/dist/fold.js"></script> (or save a local copy of dist/fold.js and use that). Then, if you add FOLD = require('fold') to your JavaScript/CoffeeScript code, you can access the library via FOLD.moduleName.functionName, e.g., FOLD.filter.collapseNearbyVertices.

For Node apps, just npm install --save fold; then add FOLD = require('fold') to your JavaScript/CoffeeScript code; then access the library via FOLD.moduleName.functionName, e.g., FOLD.filter.collapseNearbyVertices.

The FOLD library API documents the available modules and functions for manipulating FOLD objects. If you have a .fold file, first parse it with JSON.parse(fileContents) to get a FOLD object.

The JavaScript library also provides a command-line interface called fold-convert. To use it, make sure you have Node.js installed, and then run npm install -g fold from the command line. Then you can use the following features:

  • fold-convert -o .fold *.opx: Convert ORIPA .opx files to .fold.
  • fold-convert --flat-fold -o B.fold A.fold: Flat fold crease pattern A into folded geometry B

Authors

The FOLD format was invented by three people:

We welcome your feedback and suggestions! The goal is for all software in computational origami to support FOLD as a common interchange format.

More Repositories

1

coauthor

Coauthor supercollaboration/discussion forum
CoffeeScript
237
star
2

cocreate

Cocreate Shared Whiteboard/Drawing
CoffeeScript
210
star
3

author-stack-paper

"Every Author as First Author" paper from SIGTBD 2023, about superimposing author names in a stack
TeX
105
star
4

coffeescript-for-python

CoffeeScript for Python programmers (a guide)
CoffeeScript
53
star
5

svgtiler

Tool for drawing diagrams on a grid, combining grids of SVGs into a big SVG figure
CoffeeScript
51
star
6

font-tetris

Tetris Font
CoffeeScript
50
star
7

comingle

Multiroom meeting app integrating web tools
CoffeeScript
44
star
8

kadira-compose

docker-compose.yml for running open-source Kadira
Shell
38
star
9

topp

The Open Problems Project
TeX
23
star
10

slack-backup

Backup Slack users, channels, and messages for conversion to Discord
Python
17
star
11

reveal-pug-talk

Template for RevealJS talk slides using Pug, KaTeX, Stylus, CoffeeScript, SVG Tiler, SVG.js
CoffeeScript
16
star
12

tex2text

Simple conversion from LaTeX to ASCII or Markdown
Python
15
star
13

solid-meteor-data

Integrating SolidJS and Meteor reactivity
JavaScript
15
star
14

virtualglass

Computer-aided design of blown glass, specifically glass cane
C
15
star
15

cosuite

Software for better online synchronous meetings and classes
14
star
16

cp-editor

Crease pattern editor
CoffeeScript
14
star
17

solid-meteor-demo

Simple demo of SolidJS in Meteor
TypeScript
13
star
18

mathcestor

Ancestor/descendant tree from Mathematics Genealogy Project, rendered to HTML
JavaScript
13
star
19

svgink

Efficiently convert SVG files to PDF and/or PNG via Inkscape
CoffeeScript
11
star
20

hardness-book-site

Website for Computers and Intractability: A Guide to Algorithmic Lower Bounds
Sass
10
star
21

talk-yin-yang

Yin-Yang CCCG 2021 talk
Pug
8
star
22

tex2svg-webworker

CoffeeScript
8
star
23

compgeom

Computational Geometry Playground
CoffeeScript
7
star
24

recursed-xls2lua

Custom level design for Recursed via spreadsheets
CoffeeScript
5
star
25

font-webapp

Framework for webapps demoing JavaScript-rendered fonts
CoffeeScript
5
star
26

edemaine

Erik Demaine's GitHub profile
4
star
27

svgtiler-gui

Prototype GUI for interactive SVG Tiler drawing
CoffeeScript
4
star
28

github-math-demo

Testing GitHub's new math formula support
4
star
29

timer

Timer/countdown web app
CoffeeScript
4
star
30

curved-crease-editor

Curved crease pattern drawing program
CoffeeScript
4
star
31

attractor

Counterexamples to conjecture that a magnet outside a polygon can grab a metal ball inside a polygon
HTML
4
star
32

furls

Remember form state (and other state) in URL
CoffeeScript
3
star
33

font-cubefolding

Cube Folding Font
CoffeeScript
3
star
34

meteor-solid

Meteor compiler plugin for SolidJS including SSR
JavaScript
3
star
35

coinsliding

Coin-sliding font puzzles app
JavaScript
3
star
36

lectr

CoffeeScript
3
star
37

astro-solid-civet-template

Template for Astro site using Civet programming language to write Solid components
Astro
3
star
38

python2coffee

Python to CoffeeScript automatic converter
Python
3
star
39

markdown-it-replacements

Customize replacements in markdown-it typographer
CoffeeScript
3
star
40

talk-token-swapping-in-trees

Slides for talk about Hardness of Token Swapping in Trees
Pug
3
star
41

font-yinyang

Yin-Yang font
CoffeeScript
2
star
42

followshows-to-trakt

Transfer followshows.com history to trakt.tv
CoffeeScript
2
star
43

font-orthofoldcut

Orthogonal Fold & Cut Font
CoffeeScript
2
star
44

static-pug

Render static .pug files as static HTML in Meteor
JavaScript
2
star
45

meteor-tracker

NPM version of Meteor Tracker
JavaScript
2
star
46

font-spiralgalaxies

Spiral Galaxies Font
CoffeeScript
2
star
47

comingle-attendance

Attendance measurement for Comingle meetings
CoffeeScript
2
star
48

shtml2html

Convert Apache server-side rendered HTML to static HTML
JavaScript
2
star
49

yin-yang-svgtiler

Yin-Yang puzzles and hardness figures via SVG Tiler
AGS Script
2
star
50

talk-puzzle-fonts-about-puzzles

Talk about Puzzle Fonts about Puzzles
Pug
2
star
51

parseltongue

Better Python
Python
2
star
52

word-ladder

Word Ladder Designer
Sass
2
star
53

font-impossible

Impossible Folding Font
CoffeeScript
2
star
54

font-voronoi

Voronoi Font
CoffeeScript
1
star
55

meteor-solid-template-helper

Use SolidJS components in Meteor Blaze templates
JavaScript
1
star
56

character-layout

Algorithmic Character Layout
Stylus
1
star
57

dark-monkey

Tampermonkey scripts to bring (extra) dark modes to various websites
JavaScript
1
star
58

font-juggling

Juggling Font
Python
1
star
59

font-pathpuzzles

Path Puzzles Font
CoffeeScript
1
star
60

bustamove

Bust-a-Move / Puzzle Bobble clone, in particular for illustrating NP-completeness
CoffeeScript
1
star
61

gitall

Bulk operations on all Github repositories you can access
CoffeeScript
1
star
62

webapp-coffee-pug-stylus

Template gulpfile for coffee/pug/stylus webapp/website automatic compilation (including watch rule)
CoffeeScript
1
star
63

beancount

Count number of papers and coauthors via DBLP
JavaScript
1
star
64

fast-scrollspy

Mark visible nav items in logarithmic time
TypeScript
1
star
65

babel-plugin-module-deps

Babel plugin to annotate CJS modules with what they require
CoffeeScript
1
star
66

talk-token-swapping-robot-pivoting

Slides for talk about Token Swapping and Robot Pivoting
Pug
1
star
67

font-strip

Strip Folding Font
CoffeeScript
1
star
68

alpha-key

BibTeX style for overriding alphabetic labels
1
star