Graham Sutherland's Script Provides Every JLCPCB Stackup File, for Altium and More - Hackster.io
Maker Graham Sutherland has written a tool to extract layer stack files for JLCPCB's multi-layer PCBs in Altium XML and JSON format — making it easier to accurately design boards for production at JLCPCB in your favorite tool.
"I made a script that extracts multilayer board stackups from JLCPCB's API [Application Programming Interface], for every layer count, board thickness, and copper weight option," Sutherland explains. "It translates the raw API data into a clean normalized JSON format, and also into Altium stackup files. The normalized JSON should be easy to consume if you want to build stackups for other EDA [Electronic Design Automation] tools. Everything is pretty well documented, so it should be easy to modify and update to your needs."
While it's entirely possible to design a printed circuit board that has only a single layer, it's more common for modern PCBs — especially those being sent away for professional production rather than being etched at home — to have multiple layers. How these layers are stacked varies from manufacturer to manufacturer and board to board, leading to the need to be able to define the stack in software — which, in Altium, means an XML-format stackup definition.
Sutherland's tool queries JLCPCB's API and automatically generates stackups for all supported board thicknesses, outer and inner copper weights, and layer variations from four all the way to 32 — a total, at the time of writing, of 313 stackup files. These are processed into two formats: Altium XML and normalized JSON, the latter of which can be further processed into formats expected by other EDA tools without having to re-run the extraction script.
The stackup files, and the script that generated them, have been published to GitHub; the script is provided under the permissive MIT license, while the normalized JSON files and XML files are provided under a public domain license. "The raw JSON files in the raw_json directory are the property of JLCPCB," Sutherland notes, "and are included here for reference only."