← All Pull Requests

Quote the symbol and footprint so the library export links them #1

Open opened by Drew Owens

adom-wiki 1.8.0 · adom-aiflow 0.2.26 · KiCad 10.0.2 (service-kicad 1.1.0) · adom-lbr 2.47.9 · Linux container

What I did: added adom/cl10a105kb8nnnc to a Cloud Library and exported it for KiCad (an AI Flow board run).

Expected: a symbol whose Footprint field names a footprint in the bundle, and a footprint whose 3D model is in the bundle.

What happened: the symbol came out as (property Footprint cl10a105kb8nnnc:cl10a105kb8nnnc ...), unquoted and still pointing at the page's own library. The other parts in the same bundle were rewritten to the bundle's library. Three things broke:

  • The bundle has no cl10a105kb8nnnc footprint. The file came out as CL10A105KB8NNNC.kicad_mod.
  • The footprint's model stayed ${KIPRJMOD}/cl10a105kb8nnnc-package.step, which is not in 3dmodels/.
  • AI Flow reports: CL10A105KB8NNNC (C1): symbol cl10a105kb8nnnc -> no Footprint property.

Why: both cl10a105kb8nnnc.kicad_sym and cl10a105kb8nnnc.kicad_mod are written with bare atoms, for example (symbol cl10a105kb8nnnc, (property Footprint ..., (footprint cl10a105kb8nnnc and (model ${KIPRJMOD}/.... KiCad itself reads them. The export's rewriting expects KiCad's own quoting, (property "Footprint" "..."), and leaves the bare forms alone.

This PR: the same two files with KiCad's quoting and nothing else.

  • Every name, layer, pad number, property and path that KiCad writes in quotes is now quoted.
  • A parse of the old and new files gives identical trees, so the geometry, values, pins and pads are unchanged.
  • After it, the export names the footprint file cl10a105kb8nnnc.kicad_mod.
  • The symbol's Footprint becomes <bundle>:cl10a105kb8nnnc.
  • The model becomes 3dmodels/cl10a105kb8nnnc-mpn.step.

How this was checked

  1. A Cloud Library holding private forks of the six pages, exported with adom-wiki library export, before and after the change.
  2. AI Flow's own completeness check (tools/project-page.py, completeness()) run on both bundles.
    • Before: all six fail.
    • After: PASS: every part resolves symbol -> footprint -> 3D model, 6 included, 0 skipped.
  3. adom-wiki library availability: KiCad, Fusion and Altium all OK for all six after the change.
  4. KiCad 10.0.2 (service-kicad) loads every changed footprint (a test board, DRC) and every changed symbol (a test schematic, ERC) with no parse or library errors.

The forks and the test library were deleted afterwards.

🤖 Generated with Claude Code

Diff Skip to comments (1)

--- a/cl10a105kb8nnnc.kicad_mod+++ b/cl10a105kb8nnnc.kicad_mod@@ -1,1 +1,76 @@-(footprint cl10a105kb8nnnc (version 20260206) (generator kicad-footprint-generator) (layer F.Cu) (descr "Capacitor SMD 0603 (1608 Metric), square (rectangular) end terminal, IPC-7351 nominal, (Body size source: IPC-SM-782 page 76, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf)") (tags capacitor) (property Reference REF** (at 0 -1.43 0) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15)))) (property Value C_0603_1608Metric (at 0 1.43 0) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15)))) (property KiLib_Generator SMD_2terminal_chip_molded (at 0 0 0) (layer F.SilkS) (hide yes) (effects (font (size 1 1) (thickness 0.15)))) (attr smd) (duplicate_pad_numbers_are_jumpers no) (fp_line (start -0.14058 -0.51) (end 0.14058 -0.51) (stroke (width 0.12) (type solid)) (layer F.SilkS)) (fp_line (start -0.14058 0.51) (end 0.14058 0.51) (stroke (width 0.12) (type solid)) (layer F.SilkS)) (fp_rect (start -1.48 -0.73) (end 1.48 0.73) (stroke (width 0.05) (type solid)) (fill no) (layer F.CrtYd)) (fp_rect (start -0.8 -0.4) (end 0.8 0.4) (stroke (width 0.1) (type solid)) (fill no) (layer F.Fab)) (fp_text user ${REFERENCE} (at 0 0 0) (layer F.Fab) (effects (font (size 0.4 0.4) (thickness 0.06)))) (pad 1 smd roundrect (at -0.775 0) (size 0.9 0.95) (layers F.Cu F.Mask F.Paste) (roundrect_rratio 0.25)) (pad 2 smd roundrect (at 0.775 0) (size 0.9 0.95) (layers F.Cu F.Mask F.Paste) (roundrect_rratio 0.25)) (embedded_fonts no) (model ${KIPRJMOD}/cl10a105kb8nnnc-package.step (offset (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0))))+(footprint "cl10a105kb8nnnc"+	(version 20260206)+	(generator "kicad-footprint-generator")+	(layer "F.Cu")+	(descr "Capacitor SMD 0603 (1608 Metric), square (rectangular) end terminal, IPC-7351 nominal, (Body size source: IPC-SM-782 page 76, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf)"+	)+	(tags "capacitor")+	(property "Reference" "REF**"+		(at 0 -1.43 0)+		(layer "F.SilkS")+		(effects (font (size 1 1) (thickness 0.15)))+	)+	(property "Value" "C_0603_1608Metric"+		(at 0 1.43 0)+		(layer "F.Fab")+		(effects (font (size 1 1) (thickness 0.15)))+	)+	(property "KiLib_Generator" "SMD_2terminal_chip_molded"+		(at 0 0 0)+		(layer "F.SilkS")+		(hide yes)+		(effects (font (size 1 1) (thickness 0.15)))+	)+	(attr smd)+	(duplicate_pad_numbers_are_jumpers no)+	(fp_line+		(start -0.14058 -0.51)+		(end 0.14058 -0.51)+		(stroke (width 0.12) (type solid))+		(layer "F.SilkS")+	)+	(fp_line+		(start -0.14058 0.51)+		(end 0.14058 0.51)+		(stroke (width 0.12) (type solid))+		(layer "F.SilkS")+	)+	(fp_rect+		(start -1.48 -0.73)+		(end 1.48 0.73)+		(stroke (width 0.05) (type solid))+		(fill no)+		(layer "F.CrtYd")+	)+	(fp_rect+		(start -0.8 -0.4)+		(end 0.8 0.4)+		(stroke (width 0.1) (type solid))+		(fill no)+		(layer "F.Fab")+	)+	(fp_text user "${REFERENCE}"+		(at 0 0 0)+		(layer "F.Fab")+		(effects (font (size 0.4 0.4) (thickness 0.06)))+	)+	(pad "1" smd roundrect+		(at -0.775 0)+		(size 0.9 0.95)+		(layers "F.Cu" "F.Mask" "F.Paste")+		(roundrect_rratio 0.25)+	)+	(pad "2" smd roundrect+		(at 0.775 0)+		(size 0.9 0.95)+		(layers "F.Cu" "F.Mask" "F.Paste")+		(roundrect_rratio 0.25)+	)+	(embedded_fonts no)+	(model "${KIPRJMOD}/cl10a105kb8nnnc-package.step"+		(offset (xyz 0 0 0))+		(scale (xyz 1 1 1))+		(rotate (xyz 0 0 0))+	)+)+--- a/cl10a105kb8nnnc.kicad_sym+++ b/cl10a105kb8nnnc.kicad_sym@@ -1,1 +1,88 @@-(kicad_symbol_lib (version 20250114) (generator kicad_symbol_editor) (symbol cl10a105kb8nnnc (pin_numbers (hide yes)) (pin_names (offset 0.254) (hide yes)) (exclude_from_sim no) (in_bom yes) (on_board yes) (in_pos_files yes) (duplicate_pin_numbers_are_jumpers no) (property Reference C (at 0.254 1.778 0) (show_name no) (do_not_autoplace no) (effects (font (size 1.27 1.27)) (justify left))) (property Value CL10A105KB8NNNC (at 0.254 -2.032 0) (show_name no) (do_not_autoplace no) (effects (font (size 1.27 1.27)) (justify left))) (property Footprint cl10a105kb8nnnc:cl10a105kb8nnnc (at 0 0 0) (show_name no) (do_not_autoplace no) (hide yes) (effects (font (size 1.27 1.27)))) (property Datasheet "" (at 0 0 0) (show_name no) (do_not_autoplace no) (hide yes) (effects (font (size 1.27 1.27)))) (property Description "Unpolarized capacitor, small symbol" (at 0 0 0) (show_name no) (do_not_autoplace no) (hide yes) (effects (font (size 1.27 1.27)))) (property ki_keywords "capacitor cap" (at 0 0 0) (show_name no) (do_not_autoplace no) (hide yes) (effects (font (size 1.27 1.27)))) (property ki_fp_filters C_* (at 0 0 0) (show_name no) (do_not_autoplace no) (hide yes) (effects (font (size 1.27 1.27)))) (symbol cl10a105kb8nnnc_0_1 (polyline (pts (xy -1.524 0.508) (xy 1.524 0.508)) (stroke (width 0.3048) (type default)) (fill (type none))) (polyline (pts (xy -1.524 -0.508) (xy 1.524 -0.508)) (stroke (width 0.3302) (type default)) (fill (type none)))) (symbol cl10a105kb8nnnc_1_1 (pin passive line (at 0 2.54 270) (length 2.032) (name "" (effects (font (size 1.27 1.27)))) (number 1 (effects (font (size 1.27 1.27))))) (pin passive line (at 0 -2.54 90) (length 2.032) (name "" (effects (font (size 1.27 1.27)))) (number 2 (effects (font (size 1.27 1.27)))))) (embedded_fonts no)))+(kicad_symbol_lib+	(version 20250114)+	(generator "kicad_symbol_editor")+	(symbol "cl10a105kb8nnnc"+		(pin_numbers (hide yes))+		(pin_names (offset 0.254) (hide yes))+		(exclude_from_sim no)+		(in_bom yes)+		(on_board yes)+		(in_pos_files yes)+		(duplicate_pin_numbers_are_jumpers no)+		(property "Reference" "C"+			(at 0.254 1.778 0)+			(show_name no)+			(do_not_autoplace no)+			(effects (font (size 1.27 1.27)) (justify left))+		)+		(property "Value" "CL10A105KB8NNNC"+			(at 0.254 -2.032 0)+			(show_name no)+			(do_not_autoplace no)+			(effects (font (size 1.27 1.27)) (justify left))+		)+		(property "Footprint" "cl10a105kb8nnnc:cl10a105kb8nnnc"+			(at 0 0 0)+			(show_name no)+			(do_not_autoplace no)+			(hide yes)+			(effects (font (size 1.27 1.27)))+		)+		(property "Datasheet" ""+			(at 0 0 0)+			(show_name no)+			(do_not_autoplace no)+			(hide yes)+			(effects (font (size 1.27 1.27)))+		)+		(property "Description" "Unpolarized capacitor, small symbol"+			(at 0 0 0)+			(show_name no)+			(do_not_autoplace no)+			(hide yes)+			(effects (font (size 1.27 1.27)))+		)+		(property "ki_keywords" "capacitor cap"+			(at 0 0 0)+			(show_name no)+			(do_not_autoplace no)+			(hide yes)+			(effects (font (size 1.27 1.27)))+		)+		(property "ki_fp_filters" "C_*"+			(at 0 0 0)+			(show_name no)+			(do_not_autoplace no)+			(hide yes)+			(effects (font (size 1.27 1.27)))+		)+		(symbol "cl10a105kb8nnnc_0_1"+			(polyline+				(pts (xy -1.524 0.508) (xy 1.524 0.508))+				(stroke (width 0.3048) (type default))+				(fill (type none))+			)+			(polyline+				(pts (xy -1.524 -0.508) (xy 1.524 -0.508))+				(stroke (width 0.3302) (type default))+				(fill (type none))+			)+		)+		(symbol "cl10a105kb8nnnc_1_1"+			(pin passive line+				(at 0 2.54 270)+				(length 2.032)+				(name "" (effects (font (size 1.27 1.27))))+				(number "1" (effects (font (size 1.27 1.27))))+			)+			(pin passive line+				(at 0 -2.54 90)+				(length 2.032)+				(name "" (effects (font (size 1.27 1.27))))+				(number "2" (effects (font (size 1.27 1.27))))+			)+		)+		(embedded_fonts no)+	)+)+

Comments

Drew Owens ·

Also checked with KiCad 10.0.7 on a Mac (the KiCad bridge's kicad_lint_library, KiCad's own parser): every changed symbol and footprint in this PR reads with 0 errors and 0 warnings.

Log in to comment.