What happens
Calling the fpc footprint by its bare name throws a raw Zod parse error before any geometry is built:
import { fp } from "@tscircuit/footprinter"
fp.string("fpc").circuitJson()
ZodError: [
{
"code": "invalid_type",
"expected": "number",
"received": "nan",
"path": ["num_pins"],
"message": "Expected number, received nan"
}
]
Why it happens
In src/fn/fpc.ts the pin count has no default:
num_pins: z.coerce.number().int().min(2),
When no count is given the proxy sets num_pins to undefined. z.coerce.number() turns that into NaN, so the parse fails.
Why it is a bug
Every other footprint that takes a pin count defaults it, so it renders from a bare name:
bga defaults to 64, quad to 64
ssop to 8, dip to 6, lga to 14
son to 8, sot223 to 4
- the two-pin parts (
sma, smc, sod123 and friends) default to 2
fpc is the only pin-count footprint that throws instead of rendering. This is the same gap #782 describes for vson8.
The fpc defaults are already tuned around a 12-pin part. The existing fpc12 test reproduces FPC-05F-12PH20 from nothing but the schema defaults (p0.5mm pw0.3mm pl1.25mm mpw2mm mpl2.5mm, with mpx and mpy computed to 8.88 and 2.575). A bare fpc therefore has an obvious intended result: the 12-pin FPC-05F-12PH20 layout.
Expected
fp.string("fpc").circuitJson() renders the 12-pin FPC-05F-12PH20 footprint (14 pads) instead of throwing.
What happens
Calling the
fpcfootprint by its bare name throws a raw Zod parse error before any geometry is built:Why it happens
In
src/fn/fpc.tsthe pin count has no default:When no count is given the proxy sets
num_pinstoundefined.z.coerce.number()turns that intoNaN, so the parse fails.Why it is a bug
Every other footprint that takes a pin count defaults it, so it renders from a bare name:
bgadefaults to 64,quadto 64ssopto 8,dipto 6,lgato 14sonto 8,sot223to 4sma,smc,sod123and friends) default to 2fpcis the only pin-count footprint that throws instead of rendering. This is the same gap #782 describes for vson8.The
fpcdefaults are already tuned around a 12-pin part. The existingfpc12test reproduces FPC-05F-12PH20 from nothing but the schema defaults (p0.5mm pw0.3mm pl1.25mm mpw2mm mpl2.5mm, withmpxandmpycomputed to 8.88 and 2.575). A barefpctherefore has an obvious intended result: the 12-pin FPC-05F-12PH20 layout.Expected
fp.string("fpc").circuitJson()renders the 12-pin FPC-05F-12PH20 footprint (14 pads) instead of throwing.