Closed general

generate drops np_thru_hole pads: .lbr has no guide/peg/holddown holes (lint passes)

Caleb · ·closed by Colby Knox

adom-lbr generate 2.47.7 (current) leaves out every np_thru_hole pad, so the .lbr has no <hole> elements, and lint still passes. Fusion/EAGLE users get footprints without guide-post, board-peg or holddown holes, and those parts can't be inserted on a board made from the library.

Minimal repro:

(footprint "NPTH_TEST" (version 20241229) (generator "repro") (layer "F.Cu")
  (pad "1" thru_hole circle (at 0 0) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask"))
  (pad "" np_thru_hole circle (at 5 0) (size 3.2 3.2) (drill 3.2) (layers "*.Cu" "*.Mask")))

adom-lbr generate --fp t.kicad_mod -o t.lbr gives <pad name="1" ...> and no <hole>. Lint: PASSED with 0 error(s).

Live examples: adom/et60s-s03-5-05-000-s-r1-s (2 × 3.2 mm guide posts), adom/hr911130a (2 × 3.25 mm locating pegs), adom/0741640110 (2 × 2.36 mm board pegs). These now carry the holes only because I added them to each .lbr by hand.

Expected: each round np_thru_hole becomes <hole x y drill> in the package, with EAGLE's y-up flip like the pads. An oval NPTH (slot) needs a milling contour on layer 46.

Also suggested: lint should warn when the .kicad_mod has NPTH pads and the package has no holes.

3 Replies

Ray ·

Fix with a test: https://github.com/adom-inc/adom-lbr/pull/4, left for Colby or Ray to merge. Each np_thru_hole becomes <hole x y drill> with the pads' y-flip. A named one (an MP pad) also stops coming out as a plated <pad>. An oval slot drills at its short width, with its outline on layer 46 Milling. On your three pages the regenerated .lbr gains exactly the holes the footprint has. Your lint suggestion (warn when the footprint has NPTH pads and the package has none) is not in the PR yet.

I filed #37 for the same thing before I saw this one, and I'm closing it as a duplicate.

Ray ·

Merged (a396654) and released as 2.47.8 (GitHub 81c55d6, wiki updated, installed on the factory host). hr911130a regenerated with the release binary gets both 3.25 mm holes and validates. The lint warning you suggested is still open.

Colby Knox ·

2.47.9 adds one follow-up to Ray's 2.47.8.

A symbol can have an MP pin wired to a named non-plated pad. In 2.47.8 that pad became a <hole>, so the pin's connect pointed at a pad that no longer existed, and lint and validate failed (2.47.7 passed). EAGLE only connects pins to pads, never to holes. So when a symbol pin, a --pin-map entry or an alternate gate reaches a named non-plated pad, that pad now stays a pad, and generate prints WARN: [npth-wired]. Every non-plated pad that no pin reaches is still a <hole>.

With 2.47.9, all three of your pages (et60s-s03-5-05-000-s-r1-s, hr911130a, 0741640110) regenerate with exactly the holes you added by hand: same positions, same drills, and lint passes.

On the lint suggestion: lint only reads the .lbr, so it can't see the .kicad_mod's non-plated pads. generate now writes every one of them as a hole, so the case it would catch no longer comes out of generate. A hand-edited .lbr that loses its holes would still pass lint. If that matters, it belongs in a separate check that compares the .lbr with its source footprint, and I can add one if you want it.

Colby Knox closed this ·

Log in to reply.