Skip to content

Add JLCPCB PCBA conventions skill; fix broken pygerber invocation in gerbers skill - #2

Open
stefangolas wants to merge 1 commit into
American-Embedded:mainfrom
stefangolas:jlcpcb-conventions-and-pygerber-fix
Open

stefangolas wants to merge 1 commit into
American-Embedded:mainfrom
stefangolas:jlcpcb-conventions-and-pygerber-fix

Conversation

@stefangolas

Copy link
Copy Markdown

��Add JLCPCB PCBA conventions skill; fix broken pygerber invocation in gerbers skill

skills/jlcpcb: documents JLCPCB's placement and BOM conventions for
Standard PCBA with through-hole assembly:

  • every BOM designator requires a CPL row, including through-hole parts;
    the BOM checker rejects lines with no CPL row and drops them from
    assembly
  • CPL Mid X / Mid Y is the pad-field centre, not the footprint origin
    (KiCad parks a connector's origin on pin 1, while JLC centres each part
    model on its CPL point)
  • rotation is read from the side the part is mounted on, so bottom-side
    parts carry (360 - rot) % 360 while KiCad measures CCW from the top
  • one CPL row per physical part
  • model-zero corrections are per package family
  • connector gender must be confirmed on the LCSC page category line
  • an audit-file pattern: the exporter emits a side-by-side record of
    footprint origin, pad-field centre, and rotation in both conventions,
    and a test replays the shipped CPL against it

skills/gerbers: the documented pygerber invocation
('pygerber gerber convert png ...') does not work on any released
pygerber. Verified against the release history:

  • 1.0.0 / 1.1.0 (2021): flat CLI, no subcommands; 'pygerber --save
    (--pillow|--blender) [--yaml|--json|--toml]'. No -o, no -d, no style
    names; -s is the save path.
  • 2.0.0rc1 / rc2: no CLI entry point (no console script, no main).
  • 2.0.0 .. 2.4.3: the subcommands are 'raster-2d' and 'render'.
    Replace with the working 2.x invocation ('pygerber raster-2d ...
    --dpi N -s copper_alpha'), note that --dpi is dots per inch, and add a
    minimum-version constraint (1.x ships a different, specfile-driven CLI).

…gerbers skill

skills/jlcpcb: documents JLCPCB's placement and BOM conventions for
Standard PCBA with through-hole assembly:
- every BOM designator requires a CPL row, including through-hole parts;
  the BOM checker rejects lines with no CPL row and drops them from
  assembly
- CPL Mid X / Mid Y is the pad-field centre, not the footprint origin
  (KiCad parks a connector's origin on pin 1, while JLC centres each part
  model on its CPL point)
- rotation is read from the side the part is mounted on, so bottom-side
  parts carry (360 - rot) % 360 while KiCad measures CCW from the top
- one CPL row per physical part
- model-zero corrections are per package family
- connector gender must be confirmed on the LCSC page category line
- an audit-file pattern: the exporter emits a side-by-side record of
  footprint origin, pad-field centre, and rotation in both conventions,
  and a test replays the shipped CPL against it

skills/gerbers: the documented pygerber invocation
('pygerber gerber convert png ...') does not work on any released
pygerber. Verified against the release history:
- 1.0.0 / 1.1.0 (2021): flat CLI, no subcommands; 'pygerber --save <path>
  (--pillow|--blender) [--yaml|--json|--toml]'. No -o, no -d, no style
  names; -s is the save path.
- 2.0.0rc1 / rc2: no CLI entry point (no console script, no __main__).
- 2.0.0 .. 2.4.3: the subcommands are 'raster-2d' and 'render'.
Replace with the working 2.x invocation ('pygerber raster-2d ...
--dpi N -s copper_alpha'), note that --dpi is dots per inch, and add a
minimum-version constraint (1.x ships a different, specfile-driven CLI).
@i2cjak

i2cjak commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

skills must be written by a human to prevent ensloppa.

the JLC skill should be a script under BOM or export instead imo, this is what I use to convert KiCad position files to JLCPCB compliant files.

@stefangolas

Copy link
Copy Markdown
Author

Fair enough ill remove the jlcpcb part but I think the pygerbers one is valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants