an OBJ representation of the FOLD object
Convert a FOLD object into an OBJ file. For FOLD objects with many frames, this will only work on one frame at a time.
// from FOLD file
const foldfile = fs.readFileSync("./crane.fold", "utf-8");
const objFile = foldToObj(foldFile);
fs.writeFileSync("./crane.obj", objFile);
// from FOLD object
const birdBase = ear.graph.bird();
const objFile = foldToObj(birdBase);
fs.writeFileSync("./bird-base.obj", objFile);
// with triangulated faces
const { result } = ear.graph.triangulate(fold);
const objFile = foldToObj(result);
a FOLD object or a string encoding of a FOLD file