app
Adom Symbol
Public Made by Adomby adom
KiCad symbol creator with interactive viewer and delivery to KiCad/Fusion 360
← Commit history
page.json+2−2@@ -38,7 +38,7 @@ "path": "adom-symbol-hero-v4.png" }, "org": "adom",- "updated_at": "2026-06-28T20:31:36.173Z",+ "updated_at": "2026-06-28T20:46:29.458Z", "source_visibility": "public",- "readme": "# adom-symbol\n\nStandalone Rust CLI + live app for **KiCad schematic symbols**. Generates\n`.kicad_sym` files natively in Rust, renders them as gorgeous dark-themed SVGs\nthrough the shared **service-kicad** container, and serves an AI-drivable live\nviewer. No Node, no gallia, no local KiCad install.\n\n\n\n## What it does\n\n- **Generate** `.kicad_sym` natively in Rust — rectangle-body ICs with grouped,\n side-sorted pins (Category A) and discrete passives derived from a KiCad\n baseline symbol (Category B).\n- **Render** the symbol to a cropped, dark-themed SVG via service-kicad\n (`POST /kicad/sch/export/svg`) — the same render path the chip-fetcher\n dashboard uses, so the thumbnail and the app match exactly. The default render\n composites the part's 3D-chip **vector outline** (with the part number lasered\n on) into the body centre.\n- **Emit an outline contract** — alongside `<mpn>-symbol.svg`, `render` writes\n `<mpn>-symbol-outline.mm.svg` + `<mpn>-symbol-outline.json` so **adom-lbr** can\n draw the exact same chip outline onto the EAGLE/Fusion 360 symbol with **zero\n guessing**. See [3D-chip outline contract](#3d-chip-outline-contract-for-adom-lbr).\n- **Serve** a live, AI-drivable app: the frontend stays connected to the Rust\n server (`GET /state` poller + `POST /eval` channel), so the AI can push a new\n symbol, hot-patch the UI, or read the console in real time.\n\n## Install\n\n```\nadompkg install adom-symbol\n```\n\n## Quick start\n\n```bash\n# Create a symbol from structured pin JSON (stdin or --file)\nadom-symbol create --file rp2040.json --out RP2040\n\n# Preview an existing .kicad_sym as a themed viewer\nadom-symbol preview --file RP2040/RP2040.kicad_sym\n\n# Render a .kicad_sym to a themed thumbnail SVG (+ outline contract for adom-lbr)\nadom-symbol render --file RP2040/RP2040.kicad_sym --out RP2040-symbol.svg\n\n# Run the live app (AI-drivable: /state, /load, /eval, /console)\nadom-symbol serve --port 8781 --file RP2040/RP2040.kicad_sym\n```\n\nOpen the served app through the Adom proxy URL\n(`https://<slug>.adom.cloud/proxy/8781/`), never `localhost:8781` — the webview\nrenders outside the container.\n\n## CLI reference\n\n| Command | Description |\n|---|---|\n| `create --file <json> [--out <dir>]` | Generate `.kicad_sym` + SVG + viewer HTML from pin JSON |\n| `preview --file <kicad_sym> [--out <dir>]` | Render an existing symbol to a themed viewer |\n| `render --file <kicad_sym> --out <svg> [--iso <png>]` | Render to a themed thumbnail SVG; auto-composites the 3D-chip outline + emits the outline contract |\n| `embed --file <kicad_sym> [--out <html>]` | Export a self-contained interactive HTML viewer (pan/zoom + pin info) |\n| `serve [--port 8781] [--file <kicad_sym>]` | Run the live AI-drivable app server |\n\n## 3D-chip outline contract (for adom-lbr)\n\nThe default `render` composites the part's **3D-chip vector outline** (white\n`heavy` style, with the part number lasered on the top face) into the symbol\nbody — sized to **0.62×** the body's smaller side, fitted from the source\n`320×320` outline canvas and centred on the body rectangle.\n\nBecause that exact placement was previously re-guessed downstream (adom-lbr fit\nthe outline to ~0.38× of a different reference frame, so it drifted ~30% small),\n`render` now **exposes the placement** so it can be transcribed 1:1. Next to\n`<mpn>-symbol.svg` it writes:\n\n| File | What it is |\n|---|---|\n| `<mpn>-symbol-outline.mm.svg` | The outline strokes **only**, as decimated (lite) `<polyline>`s, in the **same units / origin / viewBox** as `<mpn>-symbol.svg` (mm, Y-down). A drop-in overlay; each stroke keeps the source style's real colour/width/dash (and the neon glow `<defs>`, blur scaled to mm). |\n| `<mpn>-symbol-outline.json` | A self-describing sidecar: the canonical `default_variant`, the source viewBox, segment count, and the exact transform in **both** frames — EAGLE/KiCad **Y-up** (what adom-lbr maps to) and the symbol-svg **Y-down** overlay frame. |\n\n`adom-lbr generate --symbol-art <mpn>-symbol-outline.mm.svg` detects the contract\n(via the sibling `.json`), derives the svg→EAGLE offset/flip from the two frame\ncentres, and emits the outline as layer-94 `<wire>`s — no re-fitting, no\nre-decimation, so the art lands exactly where adom-symbol drew it.\n\n> The **canonical embedded variant is `heavy`** (white `#e6edf3`, single visible\n> layer) — clean as schematic wires. The multi-layer styles (`blueprint`/`xray`\n> add hidden dashed edges, `neon` is a 2-layer glow) are deliberately avoided for\n> embedding.\n\n### Outline placement (the math `render` exposes)\n\nFor a source outline point `(px, py)` in the `320×320` canvas:\n\n```\nscale = min(body_w, body_h) · 0.62 / 320 # mm per source unit\neagle_x = center_x + (px − 160) · scale # KiCad/EAGLE Y-up\neagle_y = center_y − (py − 160) · scale # (note the Y flip)\n```\n\n`center_x/center_y` (and the Y-down `symbol.svg`-frame equivalents) are written\nverbatim into the sidecar, so a consumer never has to reconstruct them.\n\n## Screenshots\n\n### Default symbol render — 3D-chip outline + lasered part number\n\n\n### The outline contract overlays the symbol 1:1\nThe emitted `.mm.svg` (shown here recoloured magenta) painted over the live\n`-symbol.svg` — it traces the chip body, pin-1 chamfer, every lead and the\nlasered name exactly. Zero drift.\n\n\n### Real EAGLE `.lbr` output — contract vs the old guess\nadom-lbr drawing the outline as layer-94 wires: **left** transcribed 1:1 from the\ncontract (exact 0.62 fit); **right** the legacy 0.38 centre+scale guess (~30%\ntoo small). Both round-tripped back through `adom-sfconvert`.\n\n\n### The lite `.mm.svg` outline\nDecimated to a few hundred segments for small libraries, in symbol mm-space.\n\n\n### The self-describing sidecar\n\n\n## Architecture\n\nPure Rust. Symbol generation (`src/sym_gen.rs`, `src/discrete_gen.rs`) is a\nbyte-for-byte port of the original generator, **verified against golden files**\nin `tests/`. The only network dependency is **service-kicad** for SVG rendering\n— a lightweight proxy to the shared KiCad-10 container, so nothing installs\nKiCad locally. The live app server (`src/server.rs`) follows the Adom\napp-creator contract: `GET /state`, `POST /load`, `POST /eval` +\n`GET /eval/pending` + `POST /eval/:id/result`, `GET/POST /console`,\n`POST /shutdown`, `GET /favicon.svg`, and best-effort HD port registration.\n\n## Build from source\n\nThe full source ships on the wiki app page — anyone in the community can build\nit locally:\n\n```bash\n# Fetch the source bundle from the wiki\nadompkg source adom-symbol # downloads + unpacks the repo\n\ncargo build --release # standalone — only needs Rust + cargo\ncargo test --release # runs the golden-file parity tests\ncp target/release/adom-symbol ~/.local/bin/\n```\n\nThe only runtime dependency is network access to a service-kicad endpoint\n(`KICAD_SERVICE_API`, defaults to the shared container).\n\n## Contribute back via pull request\n\nadom-symbol is public, source included. To propose a change:\n\n1. `adompkg source adom-symbol` to get the repo.\n2. Make your change and run `cargo test --release` (keep the golden tests green).\n3. Open a pull request against the wiki page for `adom-symbol`.\n\n> **Note:** real PR support on wiki.adom.inc is in progress. Until it lands,\n> send patches or a branch link to the maintainers and they will apply it.\n\n## Wiki\n\nhttps://wiki.adom.inc/apps/adom-symbol\n\n## Contributing & forking — open source under the Adom org\n\n**adom-symbol** is **open source** under the **adom** org on the [Adom Wiki](https://wiki.adom.inc/adom/adom-symbol). The full source lives in this page's repo — open the **Files** tab, or `adompkg install adom/adom-symbol` and edit the package. Third-party developers are welcome to modify it and contribute back.\n\n**Modify it**\n- Get the source from the Files tab (or `adompkg install adom/adom-symbol`), make your changes, and rebuild.\n\n**Contribute back to Adom — two paths**\n1. **Pull request (preferred).** The wiki runs a PR-per-page flow: propose your change on this page and the maintainer reviews + merges it — no fork needed.\n2. **Fork + breadcrumb.** Prefer your own fork or add-on? Publish it as your own wiki page, then drop a **breadcrumb on _this_ page** pointing at your fork so it's discoverable:\n - Read existing trails: `GET https://wiki.adom.inc/api/v1/pages/adom-symbol/breadcrumbs`\n - Attach a breadcrumb from your fork's page targeting this anchor (a short label + your slug).\n\n The breadcrumb leaves a **linked path back here**, so **Adom's AI can auto-discover your fork** and surface it to users — the trail is followable both ways. Your fork stays yours; the original stays discoverable.\n\n## License\n\n**MIT** — © 2026 Adom Industries Inc. Open source; see [LICENSE](LICENSE). Modify, fork, and redistribute freely.\n"+ "readme": "# adom-symbol\n\nStandalone Rust CLI + live app for **KiCad schematic symbols**. Generates\n`.kicad_sym` files natively in Rust, renders them as gorgeous dark-themed SVGs\nthrough the shared **service-kicad** container, and serves an AI-drivable live\nviewer. No Node, no gallia, no local KiCad install.\n\n\n\n## What it does\n\n- **Generate** `.kicad_sym` natively in Rust — rectangle-body ICs with grouped,\n side-sorted pins (Category A) and discrete passives derived from a KiCad\n baseline symbol (Category B).\n- **Render** the symbol to a cropped, dark-themed SVG via service-kicad\n (`POST /kicad/sch/export/svg`) — the same render path the chip-fetcher\n dashboard uses, so the thumbnail and the app match exactly. The default render\n **inlines** the part's 3D-chip **vector outline** (with the part number lasered\n on) into the body centre as real `<polyline>`s — crisp in every renderer\n (browser, librsvg thumbnailer, anything), not a rasterisable `<image>`.\n- **Emit an outline contract** — alongside `<mpn>-symbol.svg`, `render` writes\n `<mpn>-symbol-outline.mm.svg` + `<mpn>-symbol-outline.json` so **adom-lbr** can\n draw the exact same chip outline onto the EAGLE/Fusion 360 symbol with **zero\n guessing**. See [3D-chip outline contract](#3d-chip-outline-contract-for-adom-lbr).\n- **Serve** a live, AI-drivable app: the frontend stays connected to the Rust\n server (`GET /state` poller + `POST /eval` channel), so the AI can push a new\n symbol, hot-patch the UI, or read the console in real time.\n\n## Install\n\n```\nadompkg install adom-symbol\n```\n\n## Quick start\n\n```bash\n# Create a symbol from structured pin JSON (stdin or --file)\nadom-symbol create --file rp2040.json --out RP2040\n\n# Preview an existing .kicad_sym as a themed viewer\nadom-symbol preview --file RP2040/RP2040.kicad_sym\n\n# Render a .kicad_sym to a themed thumbnail SVG (+ outline contract for adom-lbr)\nadom-symbol render --file RP2040/RP2040.kicad_sym --out RP2040-symbol.svg\n\n# Run the live app (AI-drivable: /state, /load, /eval, /console)\nadom-symbol serve --port 8781 --file RP2040/RP2040.kicad_sym\n```\n\nOpen the served app through the Adom proxy URL\n(`https://<slug>.adom.cloud/proxy/8781/`), never `localhost:8781` — the webview\nrenders outside the container.\n\n## CLI reference\n\n| Command | Description |\n|---|---|\n| `create --file <json> [--out <dir>]` | Generate `.kicad_sym` + SVG + viewer HTML from pin JSON |\n| `preview --file <kicad_sym> [--out <dir>]` | Render an existing symbol to a themed viewer |\n| `render --file <kicad_sym> --out <svg> [--iso <png>]` | Render to a themed thumbnail SVG; auto-composites the 3D-chip outline + emits the outline contract |\n| `embed --file <kicad_sym> [--out <html>]` | Export a self-contained interactive HTML viewer (pan/zoom + pin info) |\n| `serve [--port 8781] [--file <kicad_sym>]` | Run the live AI-drivable app server |\n\n## 3D-chip outline contract (for adom-lbr)\n\nThe default `render` composites the part's **3D-chip vector outline** (white\n`heavy` style, with the part number lasered on the top face) into the symbol\nbody — sized to **0.62×** the body's smaller side, fitted from the source\n`320×320` outline canvas and centred on the body rectangle.\n\nBecause that exact placement was previously re-guessed downstream (adom-lbr fit\nthe outline to ~0.38× of a different reference frame, so it drifted ~30% small),\n`render` now **exposes the placement** so it can be transcribed 1:1. Next to\n`<mpn>-symbol.svg` it writes:\n\n| File | What it is |\n|---|---|\n| `<mpn>-symbol-outline.mm.svg` | The outline strokes **only**, as decimated (lite) `<polyline>`s, in the **same units / origin / viewBox** as `<mpn>-symbol.svg` (mm, Y-down). A drop-in overlay; each stroke keeps the source style's real colour/width/dash (and the neon glow `<defs>`, blur scaled to mm). |\n| `<mpn>-symbol-outline.json` | A self-describing sidecar: the canonical `default_variant`, the source viewBox, segment count, and the exact transform in **both** frames — EAGLE/KiCad **Y-up** (what adom-lbr maps to) and the symbol-svg **Y-down** overlay frame. |\n\n`adom-lbr generate --symbol-art <mpn>-symbol-outline.mm.svg` detects the contract\n(via the sibling `.json`), derives the svg→EAGLE offset/flip from the two frame\ncentres, and emits the outline as layer-94 `<wire>`s — no re-fitting, no\nre-decimation, so the art lands exactly where adom-symbol drew it.\n\n> The **canonical embedded variant is `heavy`** (white `#e6edf3`, single visible\n> layer) — clean as schematic wires. The multi-layer styles (`blueprint`/`xray`\n> add hidden dashed edges, `neon` is a 2-layer glow) are deliberately avoided for\n> embedding.\n\n### Outline placement (the math `render` exposes)\n\nFor a source outline point `(px, py)` in the `320×320` canvas:\n\n```\nscale = min(body_w, body_h) · 0.62 / 320 # mm per source unit\neagle_x = center_x + (px − 160) · scale # KiCad/EAGLE Y-up\neagle_y = center_y − (py − 160) · scale # (note the Y flip)\n```\n\n`center_x/center_y` (and the Y-down `symbol.svg`-frame equivalents) are written\nverbatim into the sidecar, so a consumer never has to reconstruct them.\n\n## Screenshots\n\n### Default symbol render — inline-vector 3D outline + lasered part number\nThe BQ25798 QFN's 3D outline inlined into the symbol body as crisp vector, with\nthe part number lasered on the top face.\n\n\n### The outline contract lands exactly where adom-symbol draws it\nThe emitted `.mm.svg` (shown here recoloured magenta) placed over the live\n`-symbol.svg` — it sits dead-centre in the body, framed by the real pins, tracing\nthe chip body, side pads and lasered name. Zero drift.\n\n\n### Real EAGLE `.lbr` output — contract vs the old guess\nadom-lbr drawing the outline as layer-94 wires: **left** transcribed 1:1 from the\ncontract (exact 0.62 fit, centred); **right** the legacy guess — too small *and*\nshoved off-centre, because it fit the source's ink bbox instead of the canvas.\nBoth round-tripped back through `adom-sfconvert`.\n\n\n### The lite `.mm.svg` outline\nDecimated to a few hundred segments for small libraries, in symbol mm-space.\n\n\n### The self-describing sidecar\n\n\n## Architecture\n\nPure Rust. Symbol generation (`src/sym_gen.rs`, `src/discrete_gen.rs`) is a\nbyte-for-byte port of the original generator, **verified against golden files**\nin `tests/`. The only network dependency is **service-kicad** for SVG rendering\n— a lightweight proxy to the shared KiCad-10 container, so nothing installs\nKiCad locally. The live app server (`src/server.rs`) follows the Adom\napp-creator contract: `GET /state`, `POST /load`, `POST /eval` +\n`GET /eval/pending` + `POST /eval/:id/result`, `GET/POST /console`,\n`POST /shutdown`, `GET /favicon.svg`, and best-effort HD port registration.\n\n## Build from source\n\nThe full source ships on the wiki app page — anyone in the community can build\nit locally:\n\n```bash\n# Fetch the source bundle from the wiki\nadompkg source adom-symbol # downloads + unpacks the repo\n\ncargo build --release # standalone — only needs Rust + cargo\ncargo test --release # runs the golden-file parity tests\ncp target/release/adom-symbol ~/.local/bin/\n```\n\nThe only runtime dependency is network access to a service-kicad endpoint\n(`KICAD_SERVICE_API`, defaults to the shared container).\n\n## Contribute back via pull request\n\nadom-symbol is public, source included. To propose a change:\n\n1. `adompkg source adom-symbol` to get the repo.\n2. Make your change and run `cargo test --release` (keep the golden tests green).\n3. Open a pull request against the wiki page for `adom-symbol`.\n\n> **Note:** real PR support on wiki.adom.inc is in progress. Until it lands,\n> send patches or a branch link to the maintainers and they will apply it.\n\n## Wiki\n\nhttps://wiki.adom.inc/apps/adom-symbol\n\n## Contributing & forking — open source under the Adom org\n\n**adom-symbol** is **open source** under the **adom** org on the [Adom Wiki](https://wiki.adom.inc/adom/adom-symbol). The full source lives in this page's repo — open the **Files** tab, or `adompkg install adom/adom-symbol` and edit the package. Third-party developers are welcome to modify it and contribute back.\n\n**Modify it**\n- Get the source from the Files tab (or `adompkg install adom/adom-symbol`), make your changes, and rebuild.\n\n**Contribute back to Adom — two paths**\n1. **Pull request (preferred).** The wiki runs a PR-per-page flow: propose your change on this page and the maintainer reviews + merges it — no fork needed.\n2. **Fork + breadcrumb.** Prefer your own fork or add-on? Publish it as your own wiki page, then drop a **breadcrumb on _this_ page** pointing at your fork so it's discoverable:\n - Read existing trails: `GET https://wiki.adom.inc/api/v1/pages/adom-symbol/breadcrumbs`\n - Attach a breadcrumb from your fork's page targeting this anchor (a short label + your slug).\n\n The breadcrumb leaves a **linked path back here**, so **Adom's AI can auto-discover your fork** and surface it to users — the trail is followable both ways. Your fork stays yours; the original stays discoverable.\n\n## License\n\n**MIT** — © 2026 Adom Industries Inc. Open source; see [LICENSE](LICENSE). Modify, fork, and redistribute freely.\n" }