GithubHelp home page GithubHelp logo

jackzhousz / origami Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rabbit-ear/rabbit-ear

0.0 0.0 0.0 20.69 MB

computational origami

Home Page: http://rabbitear.org/

JavaScript 99.98% HTML 0.02%

origami's Introduction

Rabbit Ear

Build Status

This is a Javascript library for modeling origami.

overview

This library assists the user in encoding, modifying, and rendering origami models. Origami models are encoded as FOLD objects, which is a graph data structure format. Rabbit Ear contains methods for modifying FOLD graphs, a small math library, an SVG rendering library, and various origami-specific calculations.

The docs contain technical references for coding with this library.

The book contains higher-level explanations and interactive examples.

installation

Rabbit Ear is compiled into one file in various formats:

UMD module for html <script> tags and node.js require(). link

https://robbykraft.github.io/Origami/rabbit-ear.js

ES module for ES 2015 import/export. link

https://robbykraft.github.io/Origami/rabbit-ear.module.js

Node package is on NPM link. to install:

npm install rabbit-ear

developers

To compile this project on your computer, make sure you have node and npm installed, and clone this repository.

git clone https://github.com/robbykraft/Origami.git
cd Origami/
npm i

npm will install rollup, the compilation tool that creates rabbit-ear.js. Compile the library by typing:

rollup -c

Run the tests to ensure everything worked.

npm test

Here is an overview of the contents of the source folder.

src/
  math.js
  axioms/
  classes/
  diagrams/
  fold/
  graph/
  layer/
  singleVertex/
  svg/
  text/
  use/
  webgl/

math.js

This is the math library, bundled into one file. It can exist as its own independent library, but Rabbit Ear cannot exist without it. All comments go to the Math repository.

axioms/

All code related to the seven origami axioms, the formula for generating lines based of a set of input points and lines.

classes/

These are object-oriented class-like interfaces for creating origami "objects", which behave like class instances, for example they contain object methods. This library strictly does not use ES6 classes, rather prototype based constructors, but the idea is similar to a "class".

diagrams/

All methods relating to generating origami diagrams. Most of it relates to rendering.

extensions/

Code which is currently included in the library, but this library could be built without it. The "SVG" library can be removed and Rabbit Ear can successfully compile and run without it.

fold/

This library is designed around the FOLD graph spec. This contains methods and interfaces with the keys and values themselves, and general helper methods.

general/

Manipulation of arrays, memory, strings, etc.

graph/

All code related to the manipulation of a graph, this graph being in FOLD format. 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.js create graph components like faces_edges, vertices_vertices...
  • fragment.js convert to a planar graph, flatten into the XY plane, chop edges
  • remove.js remove indices from arrays and correct references

layer/

All code related to solving the layer order of faces in a folded origami.

singleVertex/

Everything single-vertex related, like Kawasaki and Maekawa's theorem.

svg/

Conversion of a FOLD object into an SVG rendering, with case-specific styling for crease pattern and folded form.

text/

Multilingual text, intended to contain instructions for fold operations, parts of the paper, etc.

webgl/

Conversion of the FOLD format into WebGL mesh format and rendering. Intended as a substitute for the SVG renderer. not much to see here

references

This repo is the main entrypoint for building the Rabbit Ear library. The library is split across multiple repos:

license

MIT open source software license

origami's People

Contributors

mayakraft avatar origamimagiro avatar starwarigami avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.