fix: default vson dimensions so vson8 renders from a bare name - #783
fix: default vson dimensions so vson8 renders from a bare name#783zkasuran wants to merge 2 commits into
Conversation
techmannih
left a comment
There was a problem hiding this comment.
Please add kicad parity test
Adds a parity case for the bare `vson8` name against the canonical KiCad VSON-8-1EP 3x3mm 0.65mm-pitch reference (Package_SON VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm). Tunes the vson defaults to that part (p 0.65mm, w 2.9mm, grid 3x3mm, pinw 0.85mm, pinh 0.35mm) so the default courtyard lines up with KiCad at 0.19% diff, the same metric the other parity tests assert. The exposed pad stays 0 so a bare `vson8` keeps 8 pads and tests/vson8.test.ts stays valid.
|
Added the kicad parity test. It compares the bare To make the defaults match a real part I retuned them to that VSON-8: pitch 0.65mm, row spacing 2.9mm, 3x3mm body, 0.85mm by 0.35mm pads. Courtyard diff comes out at 0.19%, under the 0.5 threshold the other SON parity tests assert. The 8 pins are dimensionally identical to KiCad's. I kept the exposed pad at 0 so a bare Full suite is green (523 pass), |
There was a problem hiding this comment.
why are we missing thermal pad, is it default?
There was a problem hiding this comment.
The thermal pad is deliberately opt-in via ep, not part of the bare default. Its size is part-specific, so a fixed default overflows smaller VSON bodies. Concretely, defaulting ep to the 3x3mm part's 1.65x2.4mm makes the existing VSON8_grid1.5x2mm test render a pad bigger than its own 1.5x2mm body.
So a bare vson8 renders the 8 signal pins plus the matching courtyard; the parity sits at 0.19% because the EP falls inside the courtyard. Pass ep=1.65x2.4mm to add the thermal pad for the full 1EP part. This matches the sibling son8, which also defaults its EP off.
If you would prefer the bare vson8 to be the full VSON-8-1EP, I can default the EP on and scale it to the body so smaller parts do not overflow. Your call.
| import { type SilkscreenRef, silkscreenRef } from "src/helpers/silkscreenRef" | ||
| import { createRectUnionOutline } from "src/helpers/rect-union-outline" | ||
|
|
||
| // can't use defaults because there is not a lot of common dimensions. |
There was a problem hiding this comment.
These defaults are one specific real part, the canonical KiCad VSON-8-1EP 3x3mm 0.65mm-pitch (Package_SON/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm), not a claim that every VSON shares those dims. The old comment was right that VSON dims vary, so instead of inventing an average I anchored the bare-name default to that one canonical part and pinned it with a KiCad parity test (courtyard 0.19%).
A bare vson8 now renders that real part instead of throwing; any other VSON is still just a matter of passing explicit dims. Same pattern the other defaulted footprint fns use.
Closes #782
vsonis advertised bygetFootprintNames(), butfp.string("vson8").circuitJson()throws a raw ZodError becausevson_defdeclaresp,w,grid,pinwandpinhwith no defaults. The sibling SON-family defs (son_def,wson_def) default every dimension and render from a bare name, soson8andwson8work whilevson8crashes.Repro
The change
Give
vson_defdefaults that describe the canonical KiCad VSON-8-1EP 3x3mm 0.65mm-pitch part (Package_SON.pretty/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm): pitch 0.65mm, row spacing 2.9mm, 3x3mm body, 0.85mm by 0.35mm pads. A barevson8now renders 8 pads likeson8andwson8. Its courtyard also lines up with that real KiCad footprint. Explicit dimensions still override for a specific part. The exposed pad default stays 0 so a barevson8keeps 8 pads; passepfor a part that needs the thermal pad. The old "can't use defaults" comment is dropped, since son and wson show the SON family does have workable defaults.Verification
tests/vson8.test.tsrendersvson8to a PCB SVG snapshot and asserts 8 pads.tests/kicad-parity/vson8_kicad_parity.test.tsadds a parity case for the barevson8against the KiCad VSON-8-1EP reference. Courtyard diff is 0.19%, under the 0.5 threshold the other SON parity tests use.bun run buildclean,biome formatclean.Disclosure
AI assistance (Claude, Anthropic) was used in developing this change. The design, review and verification were done by the author. Verified locally before submitting: the full
bun testsuite (523 pass),bun run buildandbiome format.