From dbfb7ecd1abf856a322adeb1c695b4d88425b020 Mon Sep 17 00:00:00 2001 From: Padmanabha Das <82430454+chayan-1906@users.noreply.github.com> Date: Fri, 3 Jul 2026 21:22:50 +0530 Subject: [PATCH 1/2] fix: number sot723 pins to match the datasheet (1 top-left, 3 right) Pins 1 and 3 were swapped: the lone right pad was numbered 1 and the top-left pad was numbered 3. KiCad's SOT-723 (Toshiba datasheet) and the repo's own sot23/sot323 convention put pin 1 top-left, pin 2 bottom-left and pin 3 alone on the right. Co-Authored-By: Claude Fable 5 --- src/fn/sot723.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fn/sot723.ts b/src/fn/sot723.ts index af8c69f8..8f99b7c7 100644 --- a/src/fn/sot723.ts +++ b/src/fn/sot723.ts @@ -61,12 +61,12 @@ export const getCcwSot723Coords = (parameters: { const { pn, w, h, pl, p } = parameters if (pn === 1) { - return { x: p, y: 0 } + return { x: -p, y: 0.4 } } if (pn === 2) { return { x: -p, y: -0.4 } } - return { x: -p, y: 0.4 } + return { x: p, y: 0 } } export const sot723WithoutParsing = ( From 8ff2cccb8b5899cf12970f87e422c09ba583c8af Mon Sep 17 00:00:00 2001 From: Padmanabha Das <82430454+chayan-1906@users.noreply.github.com> Date: Fri, 3 Jul 2026 21:23:34 +0530 Subject: [PATCH 2/2] test: lock sot723 pin numbering to pad positions The SVG snapshot and the KiCad parity test only compare copper shapes, so a pin-numbering swap passes both. This asserts the pin-to-position mapping directly so it can't regress invisibly again. Co-Authored-By: Claude Fable 5 --- tests/sot723.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/sot723.test.ts b/tests/sot723.test.ts index cd6893de..a81dc044 100644 --- a/tests/sot723.test.ts +++ b/tests/sot723.test.ts @@ -7,3 +7,19 @@ test("sot723", () => { const svgContent = convertCircuitJsonToPcbSvg(soup) expect(svgContent).toMatchSvgSnapshot(import.meta.path, "sot723") }) + +test("sot723 numbers pins like the datasheet: 1 top-left, 2 bottom-left, 3 right", () => { + const circuitJson = fp.string("sot723").circuitJson() as any[] + const pad = (pin: string) => + circuitJson.find( + (el) => el.type === "pcb_smtpad" && el.port_hints?.[0] === pin, + ) + // KiCad SOT-723 (Toshiba datasheet): pins 1 and 2 stack on the left + // (1 on top), pin 3 sits alone on the right, like sot23/sot323 + expect(pad("1").x).toBeCloseTo(-0.575) + expect(pad("1").y).toBeCloseTo(0.4) + expect(pad("2").x).toBeCloseTo(-0.575) + expect(pad("2").y).toBeCloseTo(-0.4) + expect(pad("3").x).toBeCloseTo(0.575) + expect(pad("3").y).toBeCloseTo(0) +})