soldermaskdocs

Fab files

Every build writes the files a fab needs to make and assemble the board. This page lists each file, what is drawn on it, and how the pipeline checks it.

The files

gerber.py writes the Gerbers directly, in RS-274X, rather than exporting them through KiCad. Coordinates are in millimetres, in the %FSLAX46Y46% format (4 integer and 6 decimal digits). A Gerber coordinate is the pipeline's own millimetre value with no origin shift, and the assembly files rely on that.

FileHolds
<board>-F_Cu.gtlTop copper: pads, tracks and the pour
<board>-In1_Cu.g1, <board>-In2_Cu.g2Inner copper on a four-layer board, with every via and through-hole pad. In1.Cu is a sheet of ground. In2.Cu carries signals with ground poured round them, or a power plane under SOLDERMASK_PLANES=gnd+power.
<board>-B_Cu.gblBottom copper
<board>-F_Mask.gts, <board>-B_Mask.gbsMask openings, 0.05 mm past each pad per side, less where a neighbour is close
<board>-F_Silkscreen.gtoTop parts' silkscreen drawings and reference designators, and the maker's mark
<board>-B_Silkscreen.gboThe same for parts on the back
<board>-F_Paste.gtp, <board>-B_Paste.gbpThe stencil: surface-mount pads at exact size, through-hole pads left out
<board>-Edge_Cuts.gm1The board outline, and any cut-out a part needs, such as the window a reverse-mount LED shines through
<board>.drlExcellon drill file (METRIC,TZ), tools sorted by diameter, vias at 0.30 mm. A plated slot, such as a USB-C's shell leg, is drilled as a slot (G85).
<board>-NPTH.drlNon-plated holes, such as a connector's locating pegs and the mounting holes a design asks for. A slot is drilled as a slot (G85). Written only when the board has some.
<board>-BOM.csv, <board>-CPL.csvThe assembly files for JLCPCB
<board>.kicad_pcbThe board as a KiCad file you can open and edit

A pad close to its neighbour gets a smaller mask opening, so the fab does not strip the dam (gerber.mask_margins). Two openings leave at least 0.20 mm of mask between them where the copper allows. Pads closer than that open at their copper, and the dam is the gap between them.

To send the files, download gerbers.zip from the app. It holds the Gerbers, the drill files, the BOM and the CPL. See Exports and files.

A board imported from a KiCad file is cut to its own outline, curves included. Its fab files carry the copper and mask shapes the file draws: a ground patch keeps its net, and a fiducial keeps its dot. Copper text and the file's own silkscreen are not carried. The caveats say when the outline is kept.

The silkscreen

Each part carries one drawing, used in three places. silk.strokes() supplies it to the Gerber (gerber._silk), the KiCad file (kicad.write) and the workbench (export.board_json). So the outline on screen is the outline the fab prints.

The drawing comes from one of two sources, in this order:

SourceUsed forWhat it draws
The vendor's drawingVendor footprints (easyeda.package_for)EasyEDA's top silk layer: the module outline and antenna end, the pin-1 dot, the polarity bar, the connector's shroud
Drawn from the geometryHand-written and imported packagesThe body outline, cut away around every pad. A dot beside pin 1 on parts with three pads or more. A bar at a diode's cathode, when its symbol names the anode.

When nothing of a chip's outline survives the cut, it gets two lines between its pads instead. An 0603 wears them; an 0402 has no room and wears none.

The rules every drawing follows:

  • Arcs and circles are flattened to within 10 µm, so every writer inks the same segments.
  • The vendor's text is left out. The reference designator is the pipeline's own.
  • A shape the reader does not understand is dropped whole, never half drawn.
  • Lines are at least 0.15 mm wide, the thinnest a fab prints.
  • Generated ink stays 0.12 mm clear of copper and inside the courtyard. tests/test_silk_outline.py holds that over the whole catalogue.

The space a part reserves on the board covers every silk shape, arcs and circles included. On 120 of 766 cached footprints that space is larger than the track outline alone, by a median 0.2 mm. Such a part can move on a rebuild.

The maker's mark

Every board carries the mark: ▚, with SOLDERMASK beside it in ISO 3098 lettering. The face is isofont.py, generated from the vendored osifont by tools/isofont.py. AutoCAD calls the same shapes ISOCPEUR.

The mark and the letters are filled shapes. One list of polygons reaches all four places that draw the mark:

  • a Gerber region (G36/G37)
  • a KiCad gr_poly
  • an SVG polygon
  • a three.js Shape

So the picture on screen cannot drift from the ink on the film. The counters of O, D, R and A are cut out with a narrow slit, so no format ever has to express a hole.

One function, gerber.insignia_decal(), places the mark for the Gerbers, the .kicad_pcb and board.json. It takes the emptiest spot that is 0.3 mm clear of every pad, part outline and designator, and 1 mm inside the outline. It tries three lockups in turn:

LockupSizeFits
wide12.2 × 1.5 mmThe mark and the word side by side, on a board with an edge to spare
stacked10.3 × 3.2 mmThe word under the mark, in a pocket rather than a strip
mark alone1.5 × 1.5 mmEvery other board, which is most of them

A worded lockup must fit, and it must take no more than a third of the board in either direction. So a 25 × 20 mm board carries the mark alone, and a 60 × 45 mm board gets its name across a fifth of its width.

The word is lettered 1.35 mm tall, and never smaller. ISO 3098-B strokes are a tenth of the letter height, and the code keeps them over a 0.12 mm floor. At 1.35 mm the strokes are 0.129 mm, so SOLDERMASK needs 10.3 mm of board.

Thinner than JLCPCB's silkscreen line

The word's 0.129 mm strokes are under the 0.15 mm silkscreen line in JLCPCB's table. That check reads only the parts' silkscreen, so it never flags the mark.

A board with no room even for the 1.5 mm mark carries nothing, and the build says so. --no-mark, or constraints.rules.mark: false, leaves the mark off.

Assembly

assembly.py writes the two files JLCPCB needs to populate the board:

FileColumnsNotes
<board>-BOM.csvComment, Designator, Footprint, LCSC Part #One row per distinct LCSC part, with its designators joined. Comment carries the manufacturer part number; JLCPCB matches on the LCSC code.
<board>-CPL.csvDesignator, Mid X, Mid Y, Layer, RotationPositions in mm. Layer is Top or Bottom. Rotation is counter-clockwise, as JLCPCB reads it.

The CPL uses the same frame as the Gerbers, with no offset on either side. A CPL with a different origin would place every part wrong while each file looked valid.

A part on the back is Bottom, at the same coordinates seen from the top: JLCPCB does not mirror X. Its rotation is turned into the fab's frame the way kicad-jlcpcb-tools does it. A vendor's per-part rotation offset comes off afterwards.

Back-side rotation is not yet proven

The rotation for parts on the back follows the kicad-jlcpcb-tools plugin's code and the geometry. It has not yet been checked on an assembled board.

What the board is made of

In the workbench, the stackup and the fabrication sheet are facts about the board, in the inspector. Each is folded to one line until you open it. See Layers and overlays.

The stackup is a ladder from silkscreen down to silkscreen, each band at its own thickness. Its copper and silk bands also switch those layers, in step with the Layers switches. The mask and laminate bands are not drawn in 2D, so they do nothing when clicked.

Every number in the ladder is the fabricator's, and each one says so. The pipeline decides only two numbers: how many copper layers the router used, and the board thickness. Every other thickness, material and permittivity is the vendor's standard build, and each carries its own dagger.

  • soldermask/stackup.py holds JLCPCB's standard builds for 2, 4, 6, 8, 10, 12, 14 and 16 layers. The six-layer build is checked against a real fabrication file's reported 1.5660 mm.
  • The eight- to sixteen-layer builds are JLCPCB's default stacks, and are not trimmed to 1.6 mm.
  • Copper thickness comes from the vendor's figures, not from ounces. An outer layer is 0.035 mm finished (half an ounce of foil plus plating). An inner layer is 0.0152 mm of bare foil, also called half an ounce.
  • The ladder is drawn compressed, because a 1.6 mm two-layer board is 94 % core. Metal and finish get a fixed height; a dielectric of thickness t gets 22 + 70·√t.

The fabrication sheet

The sheet groups its rows under Geometry, Copper, Holes and Assembly. The count varies: there is a row for each copper layer with tracks and for each drill size. Its numbers are measured off the board:

  • the narrowest track, and the clearance against the convention
  • the full drill schedule and the smallest hole
  • copper length per layer, tracks and segments
  • pads and through-holes

These are what happened, not what the convention says. At their default rule both routers lay 0.127 mm track and clearance, the fab's floor. The Clearance row is then marked against the 0.20 mm convention.

A router running a trace thinner than its net asked for is counted as a finding, against the width the net asked for (see ERC). Nets built before they declared a width are held to the corpus convention.

None of this needs a rebuild. export.attach_fab() derives the stackup and the sheet on read, from the wires, vias, pads and routing report a board already carries.

JLCPCB's own table

KiCad's DRC judges the copper against the rules the pipeline writes into the .kicad_pro. It is never told the rest of the fab's limits. fabrules.py is that table: JLCPCB's PCB capabilities and assembly capabilities pages as read on 24 Sep 2026, each figure a named constant. It runs on board.json at the end of every build and is stored as board["fab_rules"].

RuleJLCPCB's figure (1 to 2 layers, 1 oz)
Board size, thickness3 × 3 mm to 670 × 600 mm; 0.4, 0.6, 0.8, 1.0, 1.2, 1.6 or 2.0 mm
Track0.10 mm (0.16 at 2 oz)
Via0.15 mm hole, 0.25 mm diameter. A 0.15 mm hole, or 0.2 to 0.25 mm under a 0.45 mm via, costs more.
Component hole0.15 to 6.3 mm; ring 0.18 mm absolute, 0.25 recommended (0.254 at 2 oz)
Non-plated hole0.50 mm
Hole to hole, edge to edgeVias 0.20 mm, pad holes 0.45 mm
Via in padNot offered on two layers (filled vias are for six layers and up)
SMD pads of different nets0.15 mm apart. A mask dam needs 0.10 mm (0.13 on black or white, 0.20 at 2 oz).
Silkscreen0.15 mm line, 1.0 mm text, 0.15 mm from a pad
Assembly, EconomicOne side; 10 × 10 to 470 × 500 mm; 0.8 to 1.6 mm thick; 0402 and up; 0.4 mm pitch; BGA 0.5 mm
Assembly, StandardBoth sides; 70 × 70 to 460 × 500 mm single (smaller as a panel); 0201 and up; 0.35 mm pitch; BGA 0.3 mm

A four-layer board is held to these one- and two-layer rows. The page's multilayer rows were not read, and the check's unchecked list says so.

Each finding has one of three levels, in the fab's own terms:

LevelMeansWhere it goes
below-minimumOutside what JLCPCB makes or placesThe gaps, for copper, holes, the board or assembly. Silkscreen and mask findings are notes.
extra-costPossible only on a costlier option or serviceThe notes
riskPossible, against the page's advice or a hazard it namesThe notes

The table only reports. repair.passes() does not read it.

Three things are not checked, and unchecked names them:

  • a slot's width
  • a part's distance from the edge, for assembly
  • silkscreen text other than the pipeline's own labels

To check stored builds by hand:

python tools/fab_check.py .cache/eval-2026-09-24-control [more run dirs or board.json files] [--versions all] [--json out.json]

Verification

gerber.verify() reads the written files back with gerbonara, an independent Gerber library that knows nothing about how they were made. It checks three things:

  • top copper, bottom copper and an outline are present
  • the outline is a shape a fab could cut
  • no copper comes within 0.20 mm of the board edge

It runs on a command-line build, which prints the result under fab, and in the evaluation harness. An app build does not run it. It is reported, not gating. Without gerbonara it passes, with the note fab output not independently checked.

When several boards are built into one output directory, clear_stale() removes the previous board's layers first. A zip with several boards' layers in it would be rejected, or built wrong.

On this page