Skip to content

DRAW-36 Near-miss alignment

Severity Status Implementation
suggestion runs in better_erc mid, depends on NET-26

Data it needs: drawing geometry. Folds in: DRAW-10.

Looks at. The schematic drawing (geometry).

What it catches. Two alignable items (label anchors, power and ground symbol pins, vertical or horizontal tie wires, part body edges and centre lines) that are neighbours (on the same side of the same part, or within drawing.align.window of each other) and whose x (or y) differs by more than zero and less than drawing.align.snap. Each finding names the pair and the offset ("+3V3_LDO at x 152.4, GND at x 149.86: 2.54 mm"). Larger offsets are deliberate and not reported. Within a section the ladders are compared on their own: its ground symbols, its supplies, its input ports and its output ports (ladders). Wires that end on pins of one symbol are not compared (their pitch is the symbol's), and bodies of different size compare centres only (a shared pin line or edge clears them), and only when the two parts are wired to each other by a net without a power symbol: unrelated parts of different sizes only happen to stand near each other. Labels compare with labels of their own kind only (local labels on stubs, ports in port columns). "The same side of a part" counts along that side: a column for its left and right sides, a row for its top and bottom; across it the labels sit on the part's pin rows. Two ties whose wires overlap on neighbouring lines are not a miss: lining them up would join or cross them. Nothing farther apart than drawing.align.reach (a share of the page's longer side, half by default) is compared.

Only what can be lined up. A pair is reported only when one of the two can move onto the other's line and leave a drawing that works. A wire takes the wires joined at its ends along, stretched or shortened; a label or a power symbol slides along its wire or stretches it. A move fails when it would:

  • drag a wire that ends on a part's pin or a sheet pin (lining up means moving the part, and the part pair says so);
  • bend a wire at a label or a power symbol (DRAW-41);
  • touch or cross another tie, or run through a part's body;
  • run wire over a pin;
  • bring a fourth wire or pin to one point: a four-way junction;
  • put a new piece of wire, or a label the move carries, over another tie's text, field, pin name, power symbol, sheet box or sheet field;
  • take an item off a line it already shares with a neighbour of its kind: that trades one line for another.

Part bodies are compared as they are. When only one of the two can move, the message says which one and where to: wire of X at x 210.82 could move to x 208.28, in line with wire of Y.

One finding per item off a line. Misses that share an item are a group. An item off the line most of the group is on is one finding against all of them ("B6_D+ at x 231.12, off the column at x 231.14 of A10, A11, A2 and 6 more: 0.02 mm"); a group with no such line is reported pair by pair.

Settings

Set them in the project file under [checks."DRAW-36"], or for one run with --set DRAW-36.NAME=VALUE. A name that starts with drawing. is shared by several checks and is set under that name alone.

Setting Default Meaning
drawing.align.window 20.32 mm neighbourhood within which items must align exactly
drawing.align.snap 5.08 mm offsets below this (and above zero) are near misses
drawing.align.reach 0.5 farthest apart two items may be and still be compared, as a share of the page's longer side
drawing.heading_size 2.54 mm height of a section heading; larger bold text is a title
drawing.section.reach 5.08 mm how far left of its heading a section's parts may stand

Test schematics

Each schematic below is in test_schematics/sources. The block under it is what berc check --only DRAW-36 reports on it.

draw-36_near_miss

The test schematic draw-36_near_miss The test schematic draw-36_near_miss

  suggestion DRAW-36 #vrb   label AAA at x 53.34, label BBB at x 50.8: 2.54 mm
                            sheet /, item label AAA, item label BBB
                            fix: line them up, or move one clearly away

draw-36_neighbour_rows

The test schematic draw-36_neighbour_rows The test schematic draw-36_neighbour_rows

  suggestion DRAW-36 #tyn   wire of STEPA at y 50.8, wire of STEPB at y 53.34: 2.54 mm
                            sheet /, item wire of STEPA, item wire of STEPB
                            fix: line them up, or move one clearly away

draw-36_section_ladder

The test schematic draw-36_section_ladder The test schematic draw-36_section_ladder

  suggestion DRAW-36 #gza   label IN0 at x 30.48, label IN1 at x 33.02: 2.54 mm
                            sheet /, item label IN0, item label IN1
                            fix: line them up, or move one clearly away
  suggestion DRAW-36 #psm   label IN1 at x 33.02, label IN2 at x 35.56: 2.54 mm
                            sheet /, item label IN1, item label IN2
                            fix: line them up, or move one clearly away
  suggestion DRAW-36 #e86   section Ladder: ground symbols line up at y 66.04, off it: power GND at y 60.96, power GND at y 63.5
                            sheet /, item section Ladder ground symbols
                            fix: put them on one line, or clearly apart
  suggestion DRAW-36 #xps   section Ladder: input ports line up at x 30.48, off it: label IN1 at x 33.02, label IN2 at x 35.56
                            sheet /, item section Ladder input ports
                            fix: put them on one line, or clearly apart

draw-36_unrealisable

The test schematic draw-36_unrealisable The test schematic draw-36_unrealisable

  suggestion DRAW-36 #xfs   label G4 at x 120.65, off the column at x 119.38 of label G1, label G2, label G3: 1.27 mm
                            sheet /, item label G1, item label G2, item label G3, item label G4
                            fix: put it on their line, or clearly apart

DRAW-36 also fires on the test schematics of other checks: draw-40_power_text_clash.