From 839b62c91664d9792823b02aac0e9813fd4faf15 Mon Sep 17 00:00:00 2001 From: dagangtj <2285648311@qq.com> Date: Fri, 27 Feb 2026 01:31:37 +1100 Subject: [PATCH 1/2] feat: add led5050 and led2835 footprints - led5050: 5.0mm x 5.0mm 6-pin RGB LED - led2835: 2.8mm x 3.5mm 2-pin SMD LED - Common LED packages for lighting applications Closes #122 --- src/fn/index.ts | 2 ++ src/fn/led2835.ts | 32 ++++++++++++++++++++++++++++++++ src/fn/led5050.ts | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 src/fn/led2835.ts create mode 100644 src/fn/led5050.ts diff --git a/src/fn/index.ts b/src/fn/index.ts index c3ee18a1..0b665c72 100644 --- a/src/fn/index.ts +++ b/src/fn/index.ts @@ -80,3 +80,5 @@ export { sot343 } from "./sot343" export { m2host } from "./m2host" export { mountedpcbmodule } from "./mountedpcbmodule" export { to92l } from "./to92l" +export { led5050 } from "./led5050" +export { led2835 } from "./led2835" diff --git a/src/fn/led2835.ts b/src/fn/led2835.ts new file mode 100644 index 00000000..c2c1a496 --- /dev/null +++ b/src/fn/led2835.ts @@ -0,0 +1,32 @@ +import type { AnySoupElement } from "circuit-json" +import { z } from "zod" +import { rectpad } from "../helpers/rectpad" +import { silkscreenRef } from "../helpers/silkscreenRef" + +export const led2835_def = z.object({ + fn: z.string().default("led2835"), + num_pins: z.number().default(2), +}) + +/** + * LED 2835 footprint (2.8mm x 3.5mm SMD LED) + * Common 2-pin white/single color LED package + */ +export const led2835 = ( + parameters: z.input, +): { circuitJson: AnySoupElement[]; parameters: any } => { + const pads: AnySoupElement[] = [] + + // 2835 LED: 2.8mm x 3.5mm body, 2 pads + const padWidth = 0.9 + const padHeight = 2.8 + const xOffset = 1.45 + + pads.push(rectpad(1, -xOffset, 0, padWidth, padHeight)) + pads.push(rectpad(2, xOffset, 0, padWidth, padHeight)) + + return { + circuitJson: [...pads, silkscreenRef(0, 2.2, 0.5)], + parameters, + } +} diff --git a/src/fn/led5050.ts b/src/fn/led5050.ts new file mode 100644 index 00000000..32bd96e6 --- /dev/null +++ b/src/fn/led5050.ts @@ -0,0 +1,40 @@ +import type { AnySoupElement } from "circuit-json" +import { z } from "zod" +import { rectpad } from "../helpers/rectpad" +import { silkscreenRef } from "../helpers/silkscreenRef" + +export const led5050_def = z.object({ + fn: z.string().default("led5050"), + num_pins: z.number().default(6), +}) + +/** + * LED 5050 footprint (5.0mm x 5.0mm SMD RGB LED) + * Common 6-pin RGB LED package + */ +export const led5050 = ( + parameters: z.input, +): { circuitJson: AnySoupElement[]; parameters: any } => { + const pads: AnySoupElement[] = [] + + // 5050 LED: 5.0mm x 5.0mm body, 6 pads (3 each side) + const padWidth = 1.5 + const padHeight = 0.9 + const xOffset = 2.2 + const ySpacing = 1.6 + + // Left side pads (1, 2, 3) + pads.push(rectpad(1, -xOffset, ySpacing, padWidth, padHeight)) + pads.push(rectpad(2, -xOffset, 0, padWidth, padHeight)) + pads.push(rectpad(3, -xOffset, -ySpacing, padWidth, padHeight)) + + // Right side pads (4, 5, 6) + pads.push(rectpad(4, xOffset, -ySpacing, padWidth, padHeight)) + pads.push(rectpad(5, xOffset, 0, padWidth, padHeight)) + pads.push(rectpad(6, xOffset, ySpacing, padWidth, padHeight)) + + return { + circuitJson: [...pads, silkscreenRef(0, 3.5, 0.5)], + parameters, + } +} From 54e662f6e13ce1f82c696a35f859ce12c682adbb Mon Sep 17 00:00:00 2001 From: dagangtj <2285648311@qq.com> Date: Thu, 5 Mar 2026 23:19:22 +0800 Subject: [PATCH 2/2] fix: remove unused num_pins parameter from led2835 and led5055 schemas As suggested by graphite-app[bot], the num_pins parameter was defined but never validated or used in the function implementation. Since these LED footprints have fixed pin counts (2 for 2835, 6 for 5050), removed the misleading parameter from the schema. --- src/fn/led2835.ts | 1 - src/fn/led5050.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/fn/led2835.ts b/src/fn/led2835.ts index c2c1a496..2a8ace83 100644 --- a/src/fn/led2835.ts +++ b/src/fn/led2835.ts @@ -5,7 +5,6 @@ import { silkscreenRef } from "../helpers/silkscreenRef" export const led2835_def = z.object({ fn: z.string().default("led2835"), - num_pins: z.number().default(2), }) /** diff --git a/src/fn/led5050.ts b/src/fn/led5050.ts index 32bd96e6..56597cc7 100644 --- a/src/fn/led5050.ts +++ b/src/fn/led5050.ts @@ -5,7 +5,6 @@ import { silkscreenRef } from "../helpers/silkscreenRef" export const led5050_def = z.object({ fn: z.string().default("led5050"), - num_pins: z.number().default(6), }) /**