gokul/cm4-media-carrier

A tscircuit package created by gokul.

Version
0.1.0
License
unset
Stars
0

tools/README.md

# Reproducing the manufacturing checks

Run the board build from the package root using its README commands. Install this tooling separately with `cd tools && bun install --frozen-lockfile`, then return to the root. Python checks require `gerbonara==0.13.0` and `shapely==2.0.7` in a virtual environment. The native audit requires KiCad's Python module (`pcbnew`); it was run with KiCad 10.0.5's bundled Python on macOS.

Use a fresh `recheck/` directory, not the immutable release files:

```sh
mkdir -p recheck
cp dist/index/circuit.json recheck/circuit.json
bun tools/export.ts recheck/circuit.json recheck/carrier
# Set KICAD_PYTHON and KICAD_CLI to your installed KiCad executables.
"$KICAD_PYTHON" tools/native-audit.py recheck
"$KICAD_CLI" pcb drc --refill-zones --exit-code-violations --format json -o recheck/kicad-drc.json recheck/carrier.kicad_pcb
bun node_modules/tscircuit/cli.mjs export dist/index/circuit.json --format gerbers -o "$(pwd)/recheck/gerbers.zip"
unzip -oq recheck/gerbers.zip -d recheck/gerbers
python tools/audit-geometry.py recheck/circuit.json > recheck/geometry.json
python tools/pair-audit.py recheck
python tools/gerber-audit.py recheck
python tools/assembly-files.py recheck recheck
bun build.tsx ./assembly.tsx dist/assembly/circuit.json
bun previews.ts
bun tools/render-board.mjs dist/index/circuit.json recheck/carrier-3d .
bun tools/render-board.mjs dist/assembly/circuit.json recheck/assembly-3d .
```

The release uses circuit-json-to-kicad 0.0.255. `export.ts` quotes the library generator-version string and excludes board traces/vias only from the footprint-library conversion. The PCB conversion uses the complete circuit. `native-audit.py` checks native pad geometry, then uses KiCad to normalize rotated library instances without changing board copper. To reproduce the library discrepancy, run DRC before that normalization. See UPSTREAM_FINDINGS.md.

Gerber inspection explicitly honours LR rectangle rotation because Gerbonara 0.13 ignores that statement; decimal metric drill hits/G85 slots are decoded separately. The delivered Gerbers and drills are not patched. Only the order archive omits the CLI's generic BOM/PnP CSVs in favour of the separate reviewed assembly files. The `led-model.mjs` and `micro-b-model.mjs` scripts reconstruct dimensional envelopes; adjust their output path if regenerating outside the original working layout.