imrishabh18/rp2040-motor-controller

A library of PCB component definitions covering MOSFETs, motor drivers, USB-PD control, sensors, current monitors, transistors, diodes, resistors, speakers, connectors, and mirrored bottom-side logos, with pin mappings, footprints, and 3D models.

Version
1.0.55
License
unset
Stars
5

scripts/capture-pg-routing.tsx

import { Circuit } from 'tscircuit';
import Board from '../index.circuit';
const circuit = new Circuit({ platform: { schematicDisabled: true } });
const algorithm = async (input: unknown) => {
  await Bun.write('dist/pg-sense/routing-input.json', JSON.stringify(input, null, 2));
  const handlers = new Map<string, Function>();
  return { on(n: string, f: Function) { handlers.set(n, f); }, stop() {}, start() { handlers.get('complete')?.({ traces: [] }); } };
};
circuit.add(<Board routingAlgorithm={algorithm as any} finalizeGroundPours={false} />);
await circuit.renderUntilSettled();
const json = circuit.getCircuitJson();
await Bun.write('dist/pg-sense/unrouted.json', JSON.stringify(json, null, 2));
console.log(JSON.stringify(json.filter(e => e.type.endsWith('_error')), null, 2));