• Stars
    star
    558
  • Rank 79,819 (Top 2 %)
  • Language
    JavaScript
  • Created almost 9 years ago
  • Updated 9 months ago

Reviews

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

Repository Details

computational origami

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

More Repositories

1

Panorama

Spherical panorama view, iOS
Objective-C
649
star
2

SVG

creative code svg
JavaScript
77
star
3

Firebase

iOS Swift + Firebase, simple beginner apps, foundations for larger projects
Swift
67
star
4

Geodesic

geodesic geometry library in C
C
33
star
5

SimpleOculus

Oculus Rift for native Mac OS X
C++
28
star
6

Math

math for origami. linear algebra, geometry, 2D and 3D, good interoperability with SVG
JavaScript
24
star
7

World

cross-platform OpenGL creative coding in the Processing paradigm
C
16
star
8

Material-Logic

class for SFPC spring 2018 instructors Kelli Anderson, Pam Liou, Robby Kraft
16
star
9

ReferenceFinder

Robert Lang's reference finder, remade for the web
JavaScript
13
star
10

3DEarth

OpenGL elevation maps from USGS GTOPO30
C
12
star
11

math-for-artists

ITP Spring 2020
HTML
10
star
12

svg-segmentize

process an svg into a copy containing only (straight) line-segments
JavaScript
8
star
13

Domekit

geodesic dome design tool, iOS
Objective-C
6
star
14

Plotter

procedurally generated SVGs, sometimes also origami crease patterns
C
6
star
15

Platonic

platonic solid geometry arranged in the best way
C
6
star
16

Stargaze

GPS + date + time into ecliptic coordinates, for stargazing apps
Objective-C
6
star
17

StandardAtmosphere

international standard atmosphere for altitudes up to 20,000m
C
6
star
18

origami-diagrams

origami diagrams from FOLD file
JavaScript
5
star
19

Kepler

Keplerian Elements for Approximate Positions of the Major Planets
Processing
5
star
20

fold-to-svg

render FOLD format to an SVG image
JavaScript
5
star
21

Origami-Writing

specification for a sequence of origami folds on a material
4
star
22

Stage

OpenGL + UIKit interface, iOS
Objective-C
4
star
23

Origami.rs

computational origami in rust
Rust
4
star
24

Examples

rabbit ear examples
JavaScript
3
star
25

Movement

capture and analysis of iOS accelerometer & gyroscope
Objective-C
3
star
26

cp-studio

origami crease pattern editor
JavaScript
3
star
27

webgl-fold

render FOLD object in WebGL
JavaScript
3
star
28

ofxUnitySocket

send live video (and other) from openFrameworks to Unity with Socket.io
C#
2
star
29

Face

C++
2
star
30

GridAlgorithms

A * pathfinding, digital differential analyzer
Objective-C
2
star
31

classes

2
star
32

X-Files

all X-Files scripts in plain text
2
star
33

Calendar

some calendars made w code
HTML
2
star
34

Astronomy

C
2
star
35

Hoverpad

bluetooth iPhone analog joystick
Objective-C
2
star
36

MetalMeshViewer

mesh viewer in Swift/Metal for iOS and MacOS
Swift
2
star
37

Snowflake

work in progress
JavaScript
2
star
38

LucidGrasshopper

Lucid cameras + Rhino Grasshopper
C#
1
star
39

FOLDViewerMacOS

FOLD file format viewer with quicklook plugin for MacOS
Swift
1
star
40

draw-tool

TypeScript
1
star
41

Workshops

HTML
1
star
42

terminal-shell

virtual terminal and shell with access to Javascript app data
Svelte
1
star
43

Counterpoint

algorithmic harmony
C
1
star
44

Autonaut

elementary cellular automata, iOS
Objective-C
1
star
45

MTA-3D

New York City MTA subway cars in 3D augmented reality. heroku server and iOS
Objective-C
1
star
46

Onion

iOS photo taking app - with recent-image overlay to create stop-motion work (onion-skinning)
Swift
1
star
47

origami-axioms

Rust
1
star
48

AnimalTrack

Marine animal tracking with CartoDB
CSS
1
star
49

Jupiter

ephemeris of Jupiter's moons. twitterbot
JavaScript
1
star
50

WiiMote

Interface for a WiiMote in Pure Data
1
star
51

ApolloSoyuz

Apollo-Soyuz Space Test simulator
C
1
star
52

EquationOfTime

sun position, analemma, sunrise/sunset, etc for any time/location on Earth
Processing
1
star
53

Walker

simple insect movement modeling
Objective-C
1
star
54

SoundDrawing

open wave files, correct glitches/morph audio with pure data's array drawing
Pure Data
1
star
55

grapher

origami design app
JavaScript
1
star
56

Vulkan

learning Vulkan
C++
1
star
57

Pomodoro

super simple pomodoro timer, iOS
Objective-C
1
star