AnasSarkiz/am625sip-linux

An electronic component representing an AM625 system-in-package with mapped pins and physical footprint for PCB integration.

Version
1.0.3
License
unset
Stars
0

scripts/export-schematic-sheets.mjs

import { readFileSync, writeFileSync } from "node:fs"
import { convertCircuitJsonToSchematicSvg, convertCircuitJsonToStackedSchematicSheetsSvg } from "circuit-to-svg"
const circuitJson = JSON.parse(readFileSync("dist/index/circuit.json", "utf8"))
for (const sheet of circuitJson.filter((element) => element.type === "schematic_sheet")) {
  writeFileSync(`dist/index/schematic-${sheet.name}.svg`, convertCircuitJsonToSchematicSvg(circuitJson, {
    schematicSheetId: sheet.schematic_sheet_id, width: 2400, height: 1600,
  }))
}
writeFileSync("dist/index/schematic-all-sheets.svg", convertCircuitJsonToStackedSchematicSheetsSvg(circuitJson, { width: 2400 }))