DRAW-34 Items closer than their clearance margins (symbol bodies, power symbols, fields, labels, note boxes)¶
| Severity | Status | Implementation |
|---|---|---|
| suggestion | runs in better_erc | hard, depends on NET-26 |
Data it needs: drawing geometry. Folds in: DRAW-9.
Looks at. The schematic drawing (geometry).
What it catches. Two items whose boxes, each grown by its own margin (drawing.clearance.part, .power, .text), overlap, when the bare boxes do not (that is DRAW-9). With the defaults: two parts less than 2.54 mm apart, a field less than 1.905 mm from another part, two labels less than 0.635 mm apart: two texts share one margin, the larger of theirs, so labels on neighbouring 2.54 mm rows pass. A power symbol counts as text here, since its box is mostly its name: two power symbols, or a power symbol and a text, need 1.27 mm between them, not the sum of their margins. Two ground symbols at 5.08 mm pitch, whose names in IBM Plex Sans are 1.4 mm apart, pass. In tight spacing (drawing.clearance.spacing, the default) two parts' bodies, pins and fields are held only to drawing.clearance.packed each, so parts packed at grid pitch pass; sparse holds them to their own margins. A body is measured by its drawn primitives, never closer than the box of the same primitives would be; a text box against anything but text by its text, clipped to the box: its border may run close by, as when it is drawn around the wire it points at; two boxes are apart by the larger of the x and y gaps, anything else by the straight distance between the drawn outlines.
Why it matters. A sheet where every gap is the minimum reads as one block, and a field close to the next part is read as belonging to it. The margins are settings because how much air a sheet needs is taste: Roman's own dense real-board sheets were too dense at zero, the defaults stay small.
Example. A +3V3 power symbol on a one-step stub beside a series resistor: its name lies 0.5 mm from the resistor's body.
How to check. The item boxes at the top of this page, grown by their margins; exempt a part's own fields and pin names against its own body, a label against any wire of its own net, a heading against its parameter box, a wire against the sheet box whose pin it ends on (coming in from outside). Report per sheet, closest pairs first.
Fix. berc place-fields PROJECT moves the fields of each symbol in the way into a column beside its body, on the side where the column hits nothing (see the README, "Placing fields").
Settings¶
Set them in the project file under [checks."DRAW-34"], or for one run with --set DRAW-34.NAME=VALUE. A name that starts with drawing. is shared by several checks and is set under that name alone.
| 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.font |
unset | font family a text that names none is measured in, as KiCad draws it (KiCad Font: the stroke font); unset: KiCad's own default font (eeschema appearance.default_font) |
drawing.clearance.packed |
0.127 mm | margin around a part's body, pins and fields against another part's, in tight spacing |
drawing.fields.pitch |
2 mm | baseline-to-baseline distance between the lines of a field column, the same on every part |
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 |
drawing.fields.step |
0.25 mm | grid field anchors are placed on, and the step a column slides or moves out by |
drawing.fields.gap_max |
2 mm | fields farther than this from their body are placed again |
drawing.fields.ends_raise |
1.27 mm | how far above a horizontal packed part's pin line its Reference and Value sit |
drawing.fields.hide_defaults |
in_the_way |
in_the_way: a rating at its default is hidden only where the fields need room; always: wherever it is shown |
Test schematics¶
Each schematic below is in test_schematics/sources. The block under it is what berc check --only DRAW-34 reports on it.
draw-34_power_row¶
suggestion DRAW-34 #qyh power GND at x 80.01 y 63.5 is 0.7 mm short of its margin to power GND at x 84.46 y 63.5
sheet /, item power GND
fix: give them room: move one, or set the drawing.clearance margins
draw-34_too_close¶
suggestion DRAW-34 #wrp R1 body at x 60.96 y 50.8 is 0.7 mm short of its margin to text box "Near" at x 47.63 y 50.8
sheet /, item R1 body, item text box "Near"
fix: give them room: move one, or set the drawing.clearance margins
DRAW-34 also fires on the test schematics of other checks: draw-36_unrealisable, draw-9_text_overlap.