APPENDIX

Library Structure

RabbitEar
┃
┃ // containers
┣━ bases
┣━ math
┣━ convert
┣━ svg
┣━ core
┃
┃ // origami
┣━ CreasePattern
┣━ Origami
┃
┃ // math
┣━ Vector
┣━ Matrix2
┣━ Line
┣━ Edge
┣━ Ray
┣━ Polygon
┣━ ConvexPolygon
┣━ Rectangle
┣━ Circle
┣━ Junction
┣━ Sector
┗━ Graph

Capitalized entries are objects you can create, lowercase are subfolders with either objects or more levels inside them.

Containers

Bases

RabbitEar.bases
┃
┣━ square
┣━ kite
┣━ fish
┣━ bird
┣━ frog
┣━ blintz
┃
┗━ make
    ┃
    ┣━ polygon
    ┣━ triangleGrid
    ┣━ squareGrid
    ┣━ rectangleGrid
    ┗━ hexGrid

Traditional origami bases are available in FOLD format.

cp = RabbitEar.bases.bird

The "make" category contains functions which generate FOLD objects, they are not FOLD objects themselves.

cp = RabbitEar.bases.make.polygon(5)

Convert

RabbitEar.convert
┃
┣━ toFOLD(input, callback)
┣━ toORIPA(input, callback)
┗━ toSVG(input, callback)

Convenient methods to convert between file formats. the SVG into FOLD conversion will interpret as best as possible with regards to mountain/valley assignment, epsilon range for not-exactly-perfect line endpoints.

Math

RabbitEar.math
┃
┣━ average
┣━ axiom
┣━ bisect_lines2
┣━ bisect_vectors
┣━ centroid
┣━ clean_number
┣━ clockwise_angle2
┣━ clockwise_angle2_radians
┣━ convex_hull
┣━ counter_clockwise_angle2
┣━ counter_clockwise_angle2_radians
┣━ cross2
┣━ cross3
┣━ degenerate
┣━ distance2
┣━ distance3
┣━ dot
┣━ enclosing_rectangle
┣━ equivalent
┣━ interior_angles2
┣━ intersection
┣━ magnitude
┣━ make_matrix2_inverse
┣━ make_matrix2_reflection
┣━ make_matrix2_rotation
┣━ make_regular_polygon
┣━ midpoint
┣━ multiply_line_matrix2
┣━ multiply_matrices2
┣━ multiply_vector2_matrix2
┣━ normalize
┣━ parallel
┣━ signed_area
┣━ split_convex_polygon
┗━ split_polygon

This is the core of the math library. It's recommended you use the objects like Vector, Polygon, and use their property methods. There's no type checking in the core; it was built for speed. However if you follow the correct parameter types this is where the fast math operations are housed.

SVG

RabbitEar.svg
┃
┃	// drawing
┣━ svg
┣━ group
┣━ arc
┣━ bezier
┣━ circle
┣━ ellipse
┣━ line
┣━ polygon
┣━ polyline
┣━ rect
┣━ regularPolygon
┣━ text
┣━ wedge
┃
┃	// viewbox
┣━ convertToViewBox
┣━ getViewBox
┣━ scaleViewBox
┣━ setViewBox
┣━ translateViewBox
┃
┃	// additional
┣━ save
┣━ load
┣━ setArc
┣━ setPoints
┣━ removeChildren
┃
┃	// events
┣━ image
┗━ controls

Rabbt Ear uses SVG as its primary method of rendering origami. This container is its own fully-functioning creative coding library. Much care was taken to incorporate events and touch handling.

Origami Objects

CreasePattern

a digital representation of an origami design; an extended FOLD file format

Origami

a union of a CreasePattern object, SVG visualization, and interactive touch handling

The dependency tree for shapes in the SVG

<svg>
┃
┣━ <group> (boundary)
┃    ┗━ <polygon>
┃
┣━ <group> (faces)
┃    ┣━ <polygon>
┃    ┣━ <polygon>
┃    ┗━ ...
┃
┣━ <group> (creases)
┃    ┣━ <line>
┃    ┣━ <line>
┃    ┗━ ...
┃
┣━ <group> (vertices)
┃    ┣━ <circle>
┃    ┣━ <circle>
┃    ┗━ ...