• Parameters

    • file: string

      an ORIPA file as a string

    • options: number | {
          epsilon?: number;
          invertVertical?: boolean;
      }

      an epsilon as a number, or an options object with options

    Returns FOLD

    a FOLD representation of the ORIPA file

    Description

    Convert an ORIPA file into a FOLD object

    Example

    const opxFile = fs.readFileSync("./crane.opx", "utf-8");
    const fold = opxToFold(opxFile);
    fs.writeFileSync("./crane.fold", JSON.stringify(fold, null, 2));

    Example

    // with options
    const opxFile = fs.readFileSync("./crane.opx", "utf-8");
    const fold = opxToFold(opxFile, { invertVertical: true, epsilon: 0.1 });
    fs.writeFileSync("./crane.fold", JSON.stringify(fold, null, 2));