The compiled library is one file and works in the browser or Node.
npm install rabbit-ear
clone this repo and
cd into the directory.
git clone https://github.com/robbykraft/Origami.git cd Origami/
install npm. (if you don't already have it install NodeJS)
npm will install rollup, the compilation tool that creates
rabbit-ear.js. compile by typing
run the tests to ensure everything worked.
an overview of the contents of the source folder
src/ math.js diagrams/ extensions/ graph/ prototypes/ single_vertex/ text/ use/ webgl/
This is the math library, bundled as an es6 module. Direct all conversation to the Math repository.
Contains methods like fitting arrows and rendering diagrams. It makes use of the SVG library when it's included. I imagine this folder growing a lot in the future.
parts of the Rabbit Ear library that are included in the build but hosted in other repos. read more in building and linking below.
Most of the important code this repo has to offer is in the
graph/ folder; it's all code that manipulates FOLD graph, which is the mesh data format, so it contains a lot of graph theory. some highlights include:
add/methods that add actual geometry like vertices and edges, splitting faces...
clean/files that remove geometry, generally bad geometry like duplicate edges
make.jscreate graph components like faces_edges, vertices_vertices...
fragment.jsconvert to a planar graph, flatten into the XY plane, chop edges
remove.jsremove indices from arrays and correct references
These are the graph, crease pattern, and origami objects accessible from the top-level. They serve as object-oriented class style interface to the methods of the library.
Everything single-vertex, Kawasaki and Maekawa's theorem, sectors, folding simulation and intersection test, and layer order solver.
Multilingual text that describe folds, instructions, parts of the paper. This is used when constructing diagrams.
this is the interface for extensions, read more in the section below.
A baby folder. Conversion of the FOLD format into WebGL mesh format, and help with rendering. Right now the code depends on three.js. A lot of room for growth.
The structure of the src/ folder isn't completely settled. Things that are not math related or FOLD format related tend to get their own folder.
If you console.log rabbit ear, notice that the top level contains keys that match some of the subdirectories of
src/, this is not a strict rule, but seems to be a pattern we are following.
This repo is the main entrypoint for building the Rabbit Ear library. The library is split across multiple repos:
- Origami (this repo)
- Math required by this repo and is included in the build
- SVG included in build
- fold-to-svg included in build
- svg-to-fold right now not included
- examples the example sketches found in the docs
- docs the docs at http://rabbitear.org/docs
The only repo absolutely necessary is the math library. It is compiled as an ES6 module and placed in
src/. It's like submodules, but easier. This way, if you clone just this one repo you can build and run all the tests just fine.
If you want the
RabbitEar/ and clone these repositories into it.
The following repos are included in the final build file but they're not dependencies to any source code in this repo; they are like extensions. This library could totally be built and distributed without them.
These extensions incorporate themselves within the larger library at runtime using the
use method. This is a pattern that will allow extension development and contribution by the community.
This pattern of community extensions was inspired by openFrameworks and their system of ofxAddons. Pull requests to this repo are still encouraged, if code is less necessary to the general user, community extensions is the way to go.
MIT open source software license