Closed bug report

Single-row parts (1xN headers): interior pin labels land between the pads

noah · ·closed by Ray

component-hero 0.1.2 (scripts/hero_glb.py sha256 429e437a3f2e) · adom/core 4.15.3 · Python 3.12 · Hydrogen local workspace (WSL2)

What I did. Built the hero for a 1x04 2.54 mm pin header (adom/61300411121, Wurth WR-PHD 61300411121) with the standard command:

python3 scripts/hero_glb.py 61300411121-etched.glb 61300411121.kicad_mod page.json 61300411121-hero.glb --png preview.png

The footprint is KiCad's PinHeader_1x04_P2.54mm_Vertical (one column: pads at x = 0, y = 0, 2.54, 5.08, 7.62).

Expected. Each pin name beside its own pad, clear of the other pads.

What happened. The run says align OK, but the labels go top and bottom, vertical, and the two interior labels land in the gaps between pads (overlay sidecar):

pad 1  Pin_1  x 0.0  y -1.95  vertical  (above pad 1)
pad 2  Pin_2  x 0.0  y  1.49  vertical  (between pads 1 and 2)
pad 3  Pin_3  x 0.0  y  6.13  vertical  (between pads 3 and 4)
pad 4  Pin_4  x 0.0  y  8.67  vertical  (below pad 4)

See before.png: Pin_2 and Pin_3 run across the neighbouring pads.

Cause. In label_plan, a single column has max(xs) - min(xs) == 0, so hx falls back to 1e-6 and dxn is 0 for every pad. Every pad then takes T or B by dyn, and the interior pads get a top or bottom label that sits inside the row. A single row (1xN horizontal, SIP) has the same problem with L/R.

Suggested fix (attached patch, tested on this part). When there are more than two signal pads and they all share one x (or one y), put every label on one side (R for a column, B for a row) and align them on one line. The patch also counts silkscreen lines (not only filled shapes) as obstacles, so a label beside a through-hole pad steps out past the body outline instead of sitting under the insulator. Result in after.png: Pin_1 to Pin_4 beside their pads, x = 1.59 mm, horizontal. The live page shows it: https://wiki.adom.inc/adom/61300411121

The factory's copy (adom/component-page-verify lib/hero_glb.py) has the same label_plan, so factory-built 1xN connector pages likely carry the same overlap.

before

after

hero_glb-single-row.patch

1 Reply

Ray ·

Thanks Noah, your read of the cause was right: with one column the x extent is zero, so every pad got sorted to top or bottom and the interior labels landed in the gaps. We took your one-side approach with two changes. The single-row rule also checks that the pads' copper lines up, because on SOT-89 pad 2 is a custom pad that runs over the tab and the patch pushed labels 1 and 3 out past it. And silk lines are obstacles per segment rather than per shape, since a closed outline's bounding box covers everything inside it. It's in component-hero 0.1.3 and component-page-verify 0.5.9, with a test for a 1x4 column, a 1x3 row and SOT-89, and we're rebuilding the heroes on the affected pages now. Your 61300411121 page is yours, so I left it alone; a rebuild with 0.1.3 should match what your patch gave you.

Ray closed this ·

Log in to reply.