Skip to content

DRAW checks

The DRAW checks of the check catalogue. Each check has a page of its own: what it catches, why it matters, an example, how better_erc finds it, the usual fix and where to read more, with the test schematics that show it firing.

These checks read the drawing, not the netlist: positions, angles, fields, text, the title block. The drawing facts (NET-21) carry labels and flags today; the geometry they need (wires with their ends, field positions and angles, text, text boxes, tables and groups, paper size, title block, symbol body extents) is NET-26, planned.

Boxes. Several checks compare item boxes: a symbol's body with its pins (from the library graphics, placed by its rotation and mirror), a field's or label's text box (from font size, text length, justification and the angle relative to its symbol), a power symbol with its name, a note box, a wire as a thin box. A symbol body is not one box but the set of what its library draws, each on the centreline of its stroke, the width left out: a rectangle, a circle, a closed or filled polyline as a filled shape, an open polyline segment or a piece of an arc as a line, a bezier by its control points' box. Two bodies, or a body and a box, are as far apart as their nearest primitives; the outer boxes are compared first, so a pair far apart costs one test. A text box drawn wholly around an item counts against it by its text alone: the border is a frame around the parts a note is about, not something in their way. An item the border crosses (partly inside) still overlaps the box. Against a wire a text box always counts by its text: its border may cross or run beside wires, its text may not. A prototype of this measure (Python, run on a real board's sheets) is kept with the house-style notes; it is the reference for NET-26.

Text extents. A text is measured in the font KiCad draws it in: its own face ((font (face "..."))), else the default font, else KiCad's stroke font. The default font is drawing.font, set in the project file or with --set; unset, it is KiCad's own (appearance.default_font in eeschema.json of the newest KiCad configuration, under $KICAD_CONFIG_HOME when that is set). Inside KiCad the schematic editor passes its live setting. An outline (TrueType, OpenType) family is found among the system's fonts, in the text's weight and slant, and measured as KiCad's outline font does: HarfBuzz's advances with kerning, at 1.4 times the text size; widths match kicad-cli's to 0.001 mm. The box height stays the text size, as for the stroke font: an outline font's cap height at KiCad's scale is within a few percent of it. A family the system does not have is measured in the stroke font, and the run's notes say so once. _{sub} and ^{super} text is measured at its smaller size. A free text (not a field or a label) sits higher than its anchor and justification alone say, and its box follows it. KiCad lifts every free text by 0.25 mm, and a text in an outline font by a further 0.4 times the amount its line box (the face's ascender plus descender) exceeds the text size. A 1.5 mm cost line in IBM Plex Sans sits 0.84 mm above where a field with the same anchor would, nearly half its height.

Style checks. Some checks judge only how the drawing looks: DRAW-1, 2, 5, 7 to 14, 16 to 18, 21, 24, 27 to 38 and 40 to 49 (erc_checks::STYLE). An editor shows their findings as a group of their own, so the reader can fix the circuit first and tidy the drawing later; the C++ bridge marks them with Violation::style. The other DRAW checks stay with the schematic findings, because what they catch can hide a real mistake, such as a T without a junction (DRAW-4) or a DNP part the BOM does not know about (DRAW-23).

Drawing settings. The spacing checks share named settings with defaults, set per project in its better_erc project file (CFG-2); see clearance margins:

Setting Default Meaning
drawing.clearance.part 1.27 mm margin around a symbol's body and its pins
drawing.clearance.power 1.27 mm margin around a power or ground symbol and its name
drawing.clearance.text 0.635 mm margin around a field, a label, a pin name or number, a note box
drawing.clearance.spacing tight tight: two parts' bodies, pins and fields need only the packed margin between them; sparse: their own margins
drawing.clearance.packed 0.127 mm margin around a part's body, pins and fields against another part's, in tight spacing
drawing.section_gap 10 mm gap that separates two sections (DRAW-31, DRAW-16)
drawing.bus_hint.places 3 places each net of a group must reach before DRAW-39 suggests a bus
drawing.bus_hint.members 4 nets a group needs before DRAW-39 suggests a bus
drawing.route.w_len, .w_bend, .w_cross, .w_cross_near, .w_symbol, .w_detour 1, 2, 4, 8, 6, 4 the routing cost weights (routing is a weighed compromise), DRAW-40
drawing.route.detour_max 1.5 drawn length over Manhattan length of a tie above which DRAW-40 looks for a cheaper drawing
drawing.pin_lead 1.27 mm straight wire at a pin or power symbol before the first bend (DRAW-41), and the least wire between two pins (DRAW-29)
drawing.align.window 20.32 mm neighbourhood within which items must align exactly (DRAW-36, DRAW-40)
drawing.align.snap 5.08 mm offsets below this (and above zero) are near misses (DRAW-36, DRAW-40)
drawing.align.reach 0.5 farthest apart two items may be and still be compared, as a share of the page's longer side (DRAW-36, DRAW-40)
drawing.font KiCad's default font font family a text that names none is measured in; KiCad Font is the stroke font (text extents)
drawing.label.stub_extra 1.27 mm stub a local label needs beyond its text length (DRAW-28)
drawing.heading_size 2.54 mm text size of a section heading (DRAW-31, DRAW-32)
drawing.group_heading_size 1.905 mm text size of a group heading (a table's title, a group of directives); free text this size or larger is a heading (DRAW-32)
drawing.leader.clear 0.635 mm gap from a leader's tip to the part's outline, along the leader's line (DRAW-46)
drawing.leader.aim 2.54 mm how far from the body centre a leader's line may pass (DRAW-46)
drawing.fields.pitch 2 mm baseline-to-baseline distance between the lines of a field column, the same on every part (berc place-fields)
drawing.fields.body_gap 0.635 mm space between a field column (or a packed part's Reference and Value) and the body and pins (berc place-fields)
drawing.fields.step 0.25 mm grid field anchors are placed on, and the step a column slides or moves out by (berc place-fields)
drawing.fields.gap_max 2 mm fields farther than this from their body are placed again (berc place-fields)
drawing.fields.ends_raise 1.27 mm how far above a horizontal packed part's pin line its Reference and Value sit (berc place-fields)
drawing.fields.rating_rounding_max 1 % most a rounded Voltage or Power text may differ from the lowest rating of a part's MPNs (BOM-12, berc fields sync)
drawing.leader.angle_slack 3° how far the last segment may be off 45° (DRAW-46)
drawing.leader.reach 5.08 mm how far from a part a leader's tip still counts as ending at it (DRAW-46)
DRAW-46.max_pins 4 most pins of a small part (DRAW-46)
drawing.note.item_words 15 most words in a sentence of a note item (DRAW-47)
drawing.note.item_marks 3 most ;, : and ( in one sentence of a note (DRAW-47)
drawing.note.colour_slack 8 counts per RGB channel a note box colour may be off its kind's colour (DRAW-32)
drawing.note.colour.todo, .information, .caution, .debug, .critical, .layout, .cost, .ref unset a note kind's box stroke colour, rgb(r, g, b); unset: a legend box's, else the drawing guide's (DRAW-32)
drawing.block.reach 25.4 mm how far from a block's nearest part or heading a note may stand and still belong to it (DRAW-48)
drawing.block.tie 2.54 mm blocks this much farther from a note than the nearest one get the note too (DRAW-48)
drawing.notes unset the board's notes files, paths relative to the project directory, separated by commas (DRAW-50)
drawing.route.k_power, .k_ground, .k_signal 2, 2, 1 factor on the bends and detours of power, ground and signal ties (DRAW-40)
drawing.route.min_saving 2 cost a redraw must save to be reported (DRAW-40)
drawing.route.step 2.54 mm the grid step wire is counted in (DRAW-40)
drawing.section.reach 5.08 mm how far left of its heading a section's parts may stand
drawing.section.snap 10.16 mm offsets of section tops or left edges below this are near misses (DRAW-45)
drawing.colour.pair_min 20 least CIEDE2000 difference between touching items (DRAW-42)

Checks

Check Severity Status
DRAW-1 Ground symbol not pointing down (rotated or mirrored) suggestion planned
DRAW-2 Positive supply symbol not pointing up (negative rails pointing down are right) suggestion planned
DRAW-3 Symbol pin, wire end, label anchor or sheet pin off the 1.27 mm connection grid ≈ WIRE-3 warning planned
DRAW-4 Wire end or pin on the middle of another wire without a junction: drawn as a T, not connected ≈ WIRE-15 warning planned
DRAW-5 Diagonal wire segment suggestion planned
DRAW-6 Wire drawn on top of another wire, or of zero length (left over after a drag) suggestion planned
DRAW-7 Wire running through a symbol body, a field or a label suggestion runs
DRAW-8 Reference or value reading vertically: the fields of a rotated part turned with it instead of being placed horizontally suggestion planned
DRAW-9 Text overlapping other text, a symbol body or a wire (fields, labels, notes) suggestion runs
DRAW-10 Labels stacked next to each other but not aligned (anchors a grid step or two apart) suggestion planned
DRAW-11 Net label written vertically where a horizontal wire stub would carry it suggestion planned
DRAW-12 Symbol placed so its inputs face right and its outputs left (pin types as drawn, after rotation and mirror), against the sheet's left-to-right flow info planned
DRAW-13 Hierarchical sheet symbol with input pins on its right side or output pins on its left suggestion planned
DRAW-14 Connector drawn in the middle of the circuit instead of at the sheet's edge, with its protection beside it suggestion planned
DRAW-15 Decoupling capacitor drawn far from the power pin it serves, or on another sheet ≈ LAY-17 suggestion planned
DRAW-16 Drawing fills too little of the sheet (paper too big for it) or runs into the frame or the title block suggestion planned
DRAW-17 Drawing not centred on the sheet suggestion planned
DRAW-18 Sheet too dense to read at its paper size: split it suggestion planned
DRAW-19 Title block without a title, revision or date, or with a text variable that does not resolve suggestion planned
DRAW-20 Sheets of one project with different revisions in their title blocks warning planned
DRAW-21 Sheets of one project on mixed paper sizes, or a sheet larger than A3 suggestion planned
DRAW-22 Reference designator hidden on a placed part (power symbols, logos and mounting holes aside) suggestion planned
DRAW-23 Value or a field says DNP, NF or DNF while the part's DNP attribute is not set: the sheet, the BOM and the placement files disagree ≈ BOM-13 warning planned
DRAW-24 Text smaller than 1.27 mm (fields, labels, pin names, notes): unreadable on a print of the sheet's paper size suggestion planned
DRAW-25 Hierarchical sheet without a meaningful name (Sheet1, Untitled), or two sheets with the same title suggestion planned
DRAW-26 Sheet with calculated parts (feedback divider, current-set resistor, filter, timing) and no note that gives the calculation or the reason suggestion planned
DRAW-27 Colour set by hand on wires, labels or text: it carries meaning a black and white print loses suggestion planned
DRAW-28 Label not lying on its wire: text hanging off the stub's end, or justified against its side (left of a block left-justified, right of it right-justified) suggestion runs
DRAW-29 Pin joined directly to another pin, with no wire between them suggestion runs
DRAW-30 Several power or ground symbols of one rail on one pin group of a part (adjacent pins on one side), instead of the pins wired together to one symbol suggestion runs
DRAW-31 Section of a sheet without a heading naming its function suggestion planned
DRAW-32 Free-standing text, or a note that is of no kind (TODO, Information, Caution, Debug, Critical, Layout, Cost, Ref) by its box colour or its prefix suggestion runs
DRAW-33 Note laid out as a table in plain text (aligned columns, one name: value per line) suggestion planned
DRAW-34 Items closer than their clearance margins (symbol bodies, power symbols, fields, labels, note boxes) ≈ DRAW-9 suggestion runs
DRAW-35 Capacitor between a rail and ground drawn horizontal suggestion runs
DRAW-36 Near-miss alignment: label anchors, power symbols, tie verticals or part edges on one side of a part or within a window, off a shared column or row by more than zero and less than the snap distance ≈ DRAW-10 suggestion runs
DRAW-37 Note box that names a part or block and has no leader to it suggestion planned
DRAW-38 Leader line crossing a wire, a part, a label or text suggestion planned
DRAW-39 Group of related nets (one stem with indices, or one prefix) each labelled in three or more places, with no bus: a bus would say they travel together suggestion planned
DRAW-40 Power or tie wiring much longer than its Manhattan minimum, where a cheaper drawing (a straight drop, a second symbol, a crossing) exists by the routing cost suggestion runs
DRAW-41 Wire bending right at a pin or power symbol: its first or last segment shorter than one major grid step, or across the pin's axis suggestion runs
DRAW-42 Touching items too close in colour (a wire and its pin, power symbol or label) on the light or the dark theme suggestion runs
DRAW-43 Sentence in a note, heading or table cell starting with a lower-case letter suggestion runs
DRAW-44 Two sections of a sheet closer than the section gap suggestion runs
DRAW-45 Section headings just off a shared row or column ≈ DRAW-36 suggestion runs
DRAW-46 Leader into a small part off its centre, not diagonal, or clipped by the outline suggestion runs
DRAW-47 Run-on note text: long sentences or chains of ;, :, ( suggestion runs
DRAW-48 Functional block (parts sharing a Block field) with no note on its sheet: nothing says what it does or why suggestion runs
DRAW-49 Placeholder left in a note, a text or a field (x V .. y V, TBD, ???, an empty Max current:) ≈ BOM-5 warning runs
DRAW-50 Note reference (See N12) to a note the board's notes file does not have warning runs
DRAW-51 Block name that contradicts its parts: a DC-DC or buck with a linear regulator and no inductor, an LDO with an inductor info runs