Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
FOLD (Flexible Origami List Datastructure) is a file format (with extension
.fold
) for describing origami models: crease patterns, mountain-valley
patterns, folded states, etc. Mainly, a FOLD file can store a mesh with
vertices, edges, faces, and links between them, with optional
2D or 3D geometry, plus the topological stacking order of faces that
overlap geometrically.
A mesh can also easily store additional user-defined data.
One FOLD file can even store multiple such meshes in "frames"
(but this feature is not yet supported in any code).
This repository both documents the FOLD format (which is still in early stages so its definition is evolving) and provides web software tools and JavaScript libraries to aid in manipulation of FOLD files. FOLD is built upon JSON (JavaScript Object Notation) so parsers are available in essentially all programming languages. Once parsed, the format also serves as the typical data structure you'll want to represent foldings in your software. Our libraries also help build useful redundant data structures for navigating the mesh.
FOLD is similar in spirit to the OBJ format (and other similar formats) for storing 3D meshes; its main distinguishing features are easy parsing, easy extensibility, the ability to disambiguate overlapping faces with stacking order, and the ability to define edges and thus edge properties (such as mountain-valley assignments) and arbitrary polyhedral complexes. (Without edges, OBJ cannot distinguish between two faces sharing two consecutive vertices from faces sharing an edge.) In addition, FOLD can support linkages (with 1D edges but no 2D faces).
For simple web apps, add this tag to your HTML:
<script src="https://edemaine.github.io/fold/dist/fold.js"></script>
(or save a local copy of
dist/fold.js
and use that).
Then, if you add FOLD = require('fold')
to your JavaScript/CoffeeScript code,
you can access the library via FOLD.moduleName.functionName
, e.g.,
FOLD.filter.collapseNearbyVertices
.
For Node apps, just npm install --save fold
;
then add FOLD = require('fold')
to your JavaScript/CoffeeScript code;
then access the library via FOLD.moduleName.functionName
, e.g.,
FOLD.filter.collapseNearbyVertices
.
The FOLD library API
documents the available modules and functions for manipulating FOLD objects.
If you have a .fold
file, first parse it with JSON.parse(fileContents)
to get a FOLD object.
The FOLD format was invented by three people:
We welcome your feedback and suggestions! The goal is for all software in computational origami to support FOLD as a common interchange format.
FAQs
FOLD file format for origami models, crease patterns, etc.
The npm package fold receives a total of 34 weekly downloads. As such, fold popularity was classified as not popular.
We found that fold demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.