Rabbit Ear is gearing up for a version 1 release. check back in early 2020.

Origami

grab

<!DOCTYPE html>
<title>Rabbit Ear</title>
<script src="rabbit-ear.js"></script>
<script>
RabbitEar.origami({ "touchFold": true });
</script>

This simple app creates the sketch above - a square sheet of paper that you can fold.

When you fold an origami, it keeps track of the crease pattern.

var origami = RabbitEar.origami({ "touchFold": true });

The origami object is the crease pattern. Read more in Chapter III. Graph.

The reverse is possible too. Input an SVG of a flat-foldable crease pattern and this library will fold it.

var origami = RabbitEar.origami();
origami.load("crane.svg");
origami.fold();

Determining layer order can be difficult sometimes. When Rabbit Ear is unsure it draws translucent faces.

A flat-foldable crease pattern will always be two-colorable.

RabbitEar.core.make_faces_coloring(origami)
  .map(color => color ? "#158" : "#fb3")
  .forEach((c, i) => origami.faces[i].fill(c));

Read more about drawing, coloring, and touch-interaction in Chapter II. SVG.

Example Apps

Check out these apps that have been built with early versions of Rabbit Ear.

Developers

Rabbit Ear is available in its beta form from npm, and the source code is online too.

> npm i rabbit-ear

Rabbit Ear is suite of packages which can be used independently. Each is available as its own separate node package.

The suite includes a math library, svg-drawing library, and file-conversion from FOLD to SVG and back.

> npm i rabbit-ear-math
> npm i rabbit-ear-svg
> npm i fold-to-svg
> npm i svg-to-fold
> npm i svg-segmentize