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 = ( 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) +})