seveibar/pd-dual-stepper-controller

Bottom-side PCB silkscreen artwork consisting of embedded mirrored TS Circuit SVG logos, with via-clearance-aware lower-board placement.

Version
0.1.0
License
unset
Stars
0

scripts/check-dual.ts

import { readFileSync, writeFileSync } from "node:fs";
import { runAllNetlistChecks, checkPcbComponentsOutOfBoard, checkPadPadClearance, checkPcbCopperOverKeepout, checkPcbCourtyardOverKeepout, checkPcbComponentOverlap } from "@tscircuit/checks";
import { analyzeSchematicPlacement } from "../vendor/schematic-style-analysis";
const json = JSON.parse(readFileSync(process.argv[2] ?? "dist/dual/capture.json","utf8"));
const reports = {
  netlist: await runAllNetlistChecks(json),
  componentsOutsideBoard: checkPcbComponentsOutOfBoard(json),
  componentOverlap: checkPcbComponentOverlap(json),
  padClearance: checkPadPadClearance(json),
  copperMountingKeepouts: checkPcbCopperOverKeepout(json),
  courtyardMountingKeepouts: checkPcbCourtyardOverKeepout(json),
  schematicStyle: analyzeSchematicPlacement(JSON.parse(readFileSync("dist/dual/schematic.json","utf8"))).getIssues(),
};
writeFileSync("dist/dual/design-checks.json",JSON.stringify(reports,null,2));
console.log(Object.fromEntries(Object.entries(reports).map(([k,v])=>[k,v.length])));

if (Object.entries(reports).some(([name,issues])=>name !== "schematicStyle" && issues.length > 0)) process.exitCode=1;