Native PCB SVG foundation
The native toon command is public. The native pcb-svg
command is dispatched, and toon is one of its built-in configs drawn
through the same pipeline. Their shared Rust infrastructure retains
one typed, source-bound board plotter artifact. Physical rendering uses
kicad-monkey-svg directly; equal viewport and presentation requests
reuse the completed artifact. Layer geometry remains available through the typed
plotter document rather than being recovered from serialized SVG.
Configuration authority
src/tsp/kicad_cruncher/main.tsp governs the existing
kicad_cruncher.pcb_svg.config.a0 shape. From the repository root, run
node packages/kicad_cruncher/scripts/generate-svg-contracts.mjs to
generate JSON Schema, TypeScript editor types and Rust data types; append
--check to detect stale artifacts. Open style extensions and authored
presence are retained: an omitted property, an empty list/object, and explicit
null where allowed remain distinct.
Generated Rust types represent data; Serde decoding alone does not enforce all
JSON Schema constraints. Native pcb-svg overlays an authored config
on resources/pcb.svg.default.jsonc and decodes the merged config
into those types; it has no runtime JSON Schema validation yet. Native
toon reads its preset, resources/toon.config.json, as a
pcb.svg.config.
Models and fitting
Native commands support embedded models only. This intentionally differs from the existing Python SVG command's external STEP lookup. The reader uses public owner-scoped Monkey APIs, handles all visible attachments, decodes and hashes a resource once, and shares equal model content. External references, unsupported embedded extensions and failed payloads produce named diagnostics.
PCB Autodoc's geometry-based designator fitter is the authority for the shared Rust fitting module. It retains polygon candidate centers, two-axis rotation, binary maximum-size search, fill and size caps, the horizontal tie preference, and translation-relative fit reuse. Projected model outlines are preferred; model-free footprints use visible electrical-pad envelopes. The current Altium Cruncher implementation remains the functional reference for Toon composition, presentation defaults, virtual-layer ordering, and Geometer request tuning.
Native Toon command
The public native Toon command composes Monkey physical copper and
silkscreen, a closed Edge.Cuts board domain, physical pad/via bores,
a translucent top or bottom solder-mask film, and one-pass Geometer model
illustrations. Bottom output is presentation-mirrored and uses the bottom model
pose and projection direction. The board domain uses the same four-decimal endpoint
quantization and floating-point tie epsilon as the reviewed Python compositor,
including the Yoshi arc/line profile regression.
The SVG draw order matches the Altium Toon preset:
BOARD_SUBSTRATE, side copper, side solder-mask film, side
silkscreen, BOARD_CUTOUTS, DRILLS, SLOTS,
BOARD_OUTLINE, then the side illustration. Bores are transparent
cuts in the substrate and also remain explicit light-gray drill/slot virtual
objects over solid pad and via copper. The virtual objects are clipped only to
the physical board domain, so interior drills remain complete while holes that
cross the outer profile or an interior cutout render as castellated partial
holes. Solder-mask openings do not clip drill or slot objects. Tented and
filled/capped via drill marks are filtered before composition. The default
presentation uses the side's saved stackup mask color with an off-white
fallback, contrasting silk, #DFC951 copper, and the Altium
cutout hatch/outline and 0.25 mm board-outline defaults. The canvas outside the
closed board domain is transparent. Multi-layer zone records select each filled
ring by its own layer, so silkscreen knockout clearances cannot be repainted by
an adjacent courtyard fill. --soldermask-color #RRGGBB overrides
the film color without changing the physical or virtual-layer composition.
Geometer requests use 0.025 mm HLR outline and 0.01375 mm detail widths, matching Altium Cruncher. SVG line elements retain the widths returned by Geometer; shaded-surface seam widths likewise retain Geometer's presentation values instead of being rewritten by Cruncher.
Standard circle, oval, rectangle, and rounded-rectangle mask apertures apply the resolved KiCad board/footprint/pad mask margin. Copper remains nominal and negative margins contract the aperture. Custom-polygon and trapezoid mask offsets still require a geometric offset provider before configuration parity is claimed.
The command accepts a PCB or adjacent project, renders top, bottom, or both,
and publishes SVGs plus a portable digest-indexed manifest transactionally.
Geometer release, C ABI generation, and exact source revision are recorded in
the manifest. Toon loads the generated PCB-SVG contract through an editable
JSON/JSONC toon.config; named themes and explicit mask colors apply
after authored values for both views. Each view's style overrides, layer
omissions, and painter ordering are resolved independently. The resolved config
SHA-256 is recorded in both manifest and timing artifacts, whose presentation
records preserve the requested colors for each side. A failed render does not
replace prior output.
--assembly inserts the side-specific designator layer after model
illustrations, including bottom-view mirror compensation and component-level
show_designator: false. Project inputs also accept
--variant and --all-variants. DNP population suppresses
models and labels while retaining physical PCB geometry; scoped outputs use
portable per-variant directories, reuse the same model cache, and bind the
variant identity into manifest and timing records.
Current checks and remaining integration
Focused checks cover physical artifact reuse versus side/style changes, config extension and presence preservation, and embedded-only diagnostics. The retained Python SVG command now defaults to fast HLR detail and fast mesh shadow.
The native client is pinned to Geometer 2026.9.13 at release commit
703e600. Cruncher discovers a matching executable through
GEOMETER_EXECUTABLE or as a sibling of kcr, negotiates
the exact operation catalog, and rejects a different release or C ABI generation.
The release-source manifest binds qualified Windows x64, Linux x64, Linux ARM64
and macOS ARM64 archives and their SHA-256 values. Extraction also verifies the
clean-source build attestation, executable digest and bundled licenses.
Native pcb-svg still requires runtime schema validation and the
remaining report-oriented virtual layers. Native Toon consumes embedded
STEP/STP models from footprint or board scope, but does not resolve
project-relative paths, ${KIPRJMOD}, absolute paths, or KiCad
3D-model environment variables while rendering; those references are reported
and omitted. The planned
source-preserving
model-embedding workflow is the intended repair path for resolvable external
references. Custom-polygon or trapezoid mask offsets also remain follow-up
scope. Top and bottom Yoshi and
Taillight and Speedy corpus SVGs provide the standing visual acceptance set,
including knockout text, drill, slot, and interior-cutout coverage. The installed
Windows archive test exercises the public command with its sibling Geometer;
Linux x64, Linux ARM64, and macOS ARM64 exercise the same process contract in
CI source builds.