Skip to content

Pours, thermal reliefs and stitching ​

Copper pours: how pour() fills, a pour on no net, thermal reliefs and island removal, and stitching vias from the fill with stitch(). Advanced. The helpers are in layout.md, the thermal and island rules in rules.md.

tsx
{pour(GND, 'F.Cu', rect(60, 60))}
{pour(GND, 'B.Cu', rect(60, 60), { connect: 'solid', islands: { minArea: 1 } })}
{pour(VCC, 'F.Cu', rect(10, 8, 2, 2), { priority: 1, clearance: 0.3 })}
{stitch(GND, { pitch: 4, layers: ['F.Cu', 'B.Cu'], padClearance: 1.0, via: { drill: 0.3, size: 0.62 }, avoid: { silk: true } })}
<U1 at="15 10" thermal={{ 5: 'solid' }} />
text
pour(net | null, layer, area, { clearance?, priority?, minWidth?, connect?, islands? }?)

Fill ​

  • The outline, inset by edgeClearance, less other nets' copper grown by the clearance between them, their holes grown by holeClearance, and keepouts that forbid pours.
  • Highest priority fills first and clears the later pours of other nets.
  • A min width pass then removes every neck narrower than minWidth.

No net ​

pour(null, layer, area) fills every part of its area no other copper claims, so a board filled with copper is one call per layer, pour(null, 'F.Cu', rect(60, 60)).

  • It fills after every pour on a net, whatever its priority, so nets' pours and tracks win; two on one layer fill in board order, the later clearing the earlier.
  • It keeps the clearance from every net and from other copper on no net, takes clearance and minWidth, and keeps every island.

Thermal reliefs ​

The pour keeps rules.thermal.gap around each pad of its net and crosses it with spokes spokes spokeWidth wide, on the pad axes at angle 90 or between them at 45. rules.md has the values.

WhereValuesWins over
pour connect'thermal' default, 'solid', 'none' clears the pad
pad thermal, or a part's or footprint's thermal map by pad number or namethe same, or { angle: 45 }the pour
rules={{ thermal: { angle: 45 } }} on a partangle of its padsthe rules' angle
  • QFN and LQFP exposed pads with their thermal vias and the ESP32C3Mini1 ground pad are 'solid'. Vias and tracks of the net always join solid.
  • Fewer than minSpokes spokes reaching the fill tries the set turned 45 degrees and keeps the better, as KiCad. A spoke ending in another pad's spoke is kept.
  • Too few spokes is the DRC warning thermal-spokes; a track or via of the net joining the pad on the layer counts as a spoke, and a tht pad joined by another pour of its net is not flagged. A pad no spoke reaches is unconnected.
  • A wrong pad in a placement's thermal map is a compile error.

Islands ​

A fill piece that no pad or via of its net joins on its layer is dropped after the min width pass, as KiCad does.

islands on the pour or in rulesEffect
'remove'default
'keep'keeps every piece
{ minArea }drops pieces under that many mm²
  • pcbjs inspect <net> prints a zone row per layer: fill area, pieces and islands removed, zones in --json; the model counts islandsRemoved.
  • Each fill piece is its own connectivity node, also in the Gerber self check: a pad in a cut-off piece is unconnected, naming pieces by layer, centroid and area.

Stitching vias ​

stitch() is a child of <PCB> placing vias of a net where its pours overlap, after they fill.

text
stitch(net, { pitch?, layers?, padClearance?, via?, avoid?, area?, grid?, origin? }?)
OptionDefaultMeaning
pitch4lattice step in mm from the board corner; a blocked point moves up to half the pitch
layersevery copper layereach must have fill of the net under the whole via
padClearancerules' clearancefrom every pad's copper, its own net's too
viarules' default via{ drill, size }; through vias
avoidnone{ silk: true } keeps silkToPad off silk; { courtyard: true } keeps out of every courtyard
areathe boardan SVG path limiting the vias
grid, originnone, board corner or 0 0 with gridsnap to an owner's via grid, stitch(GND, { pitch: 5, grid: 0.635, origin: '0 0' })
  • Each via keeps DRC clearance to other nets on every layer, holeClearance and minHoleToHole to holes, edgeClearance, and keepouts that forbid vias.
  • Existing vias and tht pads of the net suppress lattice points within the pitch.
  • Silk refs are placed afterwards and may land on a via; vias are tented.
  • Only pours a via changes refill, then every pour on no net: other nets clear it, its own net joins solid.
  • No via placed is the info finding stitch-empty with the reason. Calls place in document order, each seeing the ones before. Removed islands do not come back.
  • pcbjs inspect <net> lists them as route stitch with the count and the 95th percentile nearest-neighbour distance.

MIT licensed. A proof of concept, pre 0.1.