an options object or an epsilon number
a FOLD representation of the SVG
Convert an SVG to a FOLD object. This only works with SVGs of crease patterns, this will not work with an SVG of a folded form.
const svgFile = fs.readFileSync("./crane.svg", "utf-8");
const fold = svgToFold(svgFile);
fs.writeFileSync("./crane.fold", JSON.stringify(fold, null, 2));
// with options
const svgFile = fs.readFileSync("./crane.svg", "utf-8");
const fold = svgToFold(svgFile, { boundary: false, epsilon: 0.1, invertVertical: true });
fs.writeFileSync("./crane.fold", JSON.stringify(fold, null, 2));
the SVG element as a document element node, or as a string