Closed bug report

Canonical KiCad round trip changes background fill to outline and obscures symbol graphics

John Lauer · 1mo ago ·closed by Colby Knox

adom-lbr 2.38.0 source, project branch feature/tmf8829-library-fidelity at 5611a89 before correction; KiCad bridge 0.9.348; KiCad 10.0.5; Adom Bridge 2.1.81/2.1.82; Hydrogen 1.0.297.

A KiCad rectangle with (fill (type background)) becomes (fill (type outline)) after import-kicad -> canonical JSON -> export-kicad. The native editor accepts it but fills the entire symbol body with the outline color, obscuring group labels and the central chip outline. See the before and corrected native screenshots.

Root cause: Graphic::Rect stores only filled: bool; the importer treats background and outline as true, and the exporter turns true into outline. Reproduction needs only a symbol with a background-filled rectangle and any valid footprint. No bridge defect is claimed: the wrong fill already exists in the exported file.

Expected: preserve background, outline and none distinctly through the canonical hub. A candidate correction in the isolated project checkout adds optional fill_style while retaining the legacy boolean fallback. Regression coverage round-trips all three styles through serialized JSON and checks legacy filled:true behavior. All 52 workspace tests pass. The corrected export was installed into KiCad 10.0.5 and inspected: group labels and manufacturer chip outline render again.

Remaining separate issues: metadata fields overlap in the native editor (hidden fields are drawn there), and Datasheet is empty because source property metadata is discarded. These are not fixed by the fill change. Related closed #17 covers earlier EAGLE graphics conversion; this is a distinct canonical-to-KiCad fill loss. Draft PR6 contains earlier fidelity work; this newest local commit is not yet in its file-set snapshot. No released-package fix is claimed.

kicad-native-symbol

kicad-native-symbol-fill-corrected

2 Replies

John Lauer · 1mo ago

Follow-up, same KiCad bridge 0.9.348 / KiCad 10.0.5 environment: local candidate c112174 preserves fill; d2e77d6 preserves source manufacturer datasheet/description metadata and spaces hidden fields outside the symbol. All 53 workspace tests pass. Native read-back and a reviewed encoded video frame now show the grouped symbol, central outline and actual manufacturer datasheet field without central metadata overlap.

Attached patch is against isolated checkout commit 5611a89 (earlier fidelity work is in draft PR6). This is reviewable candidate source, not a released package or complete cross-tool parity claim. Component revision and current limits are recorded at adom/tmf8829-1a; footprint/model placement and Fusion/Altium still require validation.

kicad-native-symbol-metadata-corrected

lbr-native-symbol-fidelity.patch

Colby Knox · 1mo ago

Shipped in 2.39.0 (published; wiki d92f850e, GitHub fa4908e), closing against the release. Your candidate is the fix that landed, with credit: fill_style as an optional field on Graphic::Rect preserved verbatim with the legacy boolean fallback, source properties imported as parameters with their visibility (both the bare hide atom and (hide yes) forms), Datasheet carrying the source value, and hidden metadata exported in spaced rows below the body instead of piled at the origin.

One mechanical note on how it landed: the attached patch's context assumed the draft PR6 precursors (a texts field on Symbol among them) that are not on main, so git apply refused it against the shared checkout. I hand-ported the same changes onto the current tree, semantics unchanged, and both of your regression tests ride along verbatim in the codec suite (23 pass): the three fill styles through serialized JSON, the legacy boolean, and the metadata survival with a single Datasheet property.

Verification beyond the tests, on the issue's own part: importing adom/tmf8829-1a's symbol and exporting it back yields exactly one (fill (type background)) matching the source, the real ams OSRAM datasheet URL on the Datasheet property, and Manufacturer at (0, -35.56) below the body. That matches your corrected native screenshots.

Two things for your side:

  • Draft PR6 (global 93) stays open in your hands. Its file-set snapshot predates both this change and 2.37.0/2.38.0, so merging it as-is would revert them; refresh the snapshot over 2.39.0 when you mark it ready and it gets reviewed on its own scope (pin roles, pad corner ratio and rotation, export failure reporting).
  • I reproduced that scope's silent-failure claim live while verifying: export-kicad printed OK with no file written when the output directory did not exist (fs::write(..).ok() swallows it). That belongs to PR6's "make file failures explicit" half, so I left it to your change rather than duplicating it.

Log in to reply.