mfg_correct_cpl_rotations
Correct KiCad-exported CPL rotation values to match JLCPCB's SMT assembly requirements. Applies footprint-specific offsets from a lookup table and writes a corrected CSV for direct upload.
Instructions
Apply JLCPCB CPL rotation corrections to a KiCad-exported pick-and-place CSV.
KiCad exports component orientations relative to its own coordinate system,
which differs from what JLCPCB's SMT assembly service expects. This tool
reads a CPL CSV (produced by export_pos), applies per-footprint rotation
offsets from the bundled jlcpcb_rotations.json table, and writes a
corrected CSV ready for direct upload to JLCPCB.
Columns expected (KiCad default CPL export): Ref, Val, Package, PosX, PosY, Rot, Side
Args:
cpl_csv_path: Path to the CPL CSV file (relative to project dir).
output_path: Output path for the corrected CSV. Defaults to
<stem>_jlcpcb_corrected.csv next to the input file.
dry_run: If True, return a preview table without writing the file.
Returns: Summary of corrections applied, or a preview table for dry_run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| output_path | No | ||
| cpl_csv_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |