Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "@tscircuit/footprinter",
"dependencies": {
"@tscircuit/mm": "^0.0.8",
"zod": "^3.23.8",
"zod": "^3.25.74",
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
Expand Down Expand Up @@ -517,10 +517,14 @@

"yn": ["[email protected]", "", {}, "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q=="],

"zod": ["[email protected].64", "", {}, "sha512-hbP9FpSZf7pkS7hRVUrOjhwKJNyampPgtXKc3AN6DsWtoHsg2Sb4SQaS4Tcay380zSwd2VPo9G9180emBACp5g=="],
"zod": ["[email protected].74", "", {}, "sha512-J8poo92VuhKjNknViHRAIuuN6li/EwFbAC8OedzI8uxpEPGiXHGQu9wemIAioIpqgfB4SySaJhdk0mH5Y4ICBg=="],

"@jridgewell/gen-mapping/@jridgewell/trace-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="],

"@tscircuit/footprinter/zod": ["[email protected]", "", {}, "sha512-hbP9FpSZf7pkS7hRVUrOjhwKJNyampPgtXKc3AN6DsWtoHsg2Sb4SQaS4Tcay380zSwd2VPo9G9180emBACp5g=="],

"circuit-json/zod": ["[email protected]", "", {}, "sha512-hbP9FpSZf7pkS7hRVUrOjhwKJNyampPgtXKc3AN6DsWtoHsg2Sb4SQaS4Tcay380zSwd2VPo9G9180emBACp5g=="],

"circuit-to-svg/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-jnVe5ULKl6tijxUhvQeNbQG/84fHfg+yMak02cT8QVhBx/F05rAVxCGBYYTh2EKz22D6JF5ktXuNwdx7b9iEGw=="],

"color/color-convert": ["[email protected]", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"@tscircuit/mm": "^0.0.8",
"zod": "^3.23.8"
"zod": "^3.25.74"
},
"peerDependencies": {
"circuit-json": "*"
Expand Down
1 change: 1 addition & 0 deletions src/fn/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export { bga } from "./bga"
export { soic } from "./soic"
export { quad } from "./quad"
export { qfn } from "./qfn"
export { lqfn } from "./lqfn"
export { qfp } from "./qfp"
export { mlp } from "./mlp"
export { ssop } from "./ssop"
Expand Down
12 changes: 12 additions & 0 deletions src/fn/lqfn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { AnySoupElement } from "circuit-json"
import { base_quad_def, quad, quadTransform } from "./quad"
import type { z } from "zod"

export const lqfn_def = base_quad_def.extend({}).transform(quadTransform)

export const lqfn = (
parameters: z.input<typeof lqfn_def>,
): { circuitJson: AnySoupElement[]; parameters: any } => {
parameters.legsoutside = false
return quad(parameters)
}
1 change: 1 addition & 0 deletions src/footprinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export type Footprinter = {
| "circularpads"
>
qfn: (num_pins?: number) => FootprinterParamsBuilder<"w" | "h" | "p">
lqfn: (num_pins?: number) => FootprinterParamsBuilder<"w" | "h" | "p">
soic: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p" | "id" | "od">
mlp: (num_pins?: number) => FootprinterParamsBuilder<"w" | "h" | "p">
ssop: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p">
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/zod/AnyFootprinterDefinitionOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ms012_def } from "src/fn/ms012"
import { ms013_def } from "src/fn/ms013"
import { pinrow_def } from "src/fn/pinrow"
import { qfn_def } from "src/fn/qfn"
import { lqfn_def } from "src/fn/lqfn"
import { qfp_def } from "src/fn/qfp"
import { quad_def } from "src/fn/quad"
import { sod_def } from "src/fn/sod123"
Expand All @@ -32,6 +33,7 @@ export const any_footprinter_def = z.union([
ms013_def,
pinrow_def,
qfn_def,
lqfn_def,
qfp_def,
quad_def,
sod_def,
Expand Down
1 change: 1 addition & 0 deletions tests/__snapshots__/lqfn56_w7_h7_p0.4mm.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions tests/lqfn.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { test, expect } from "bun:test"
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
import { fp } from "../src/footprinter"

test("lqfn56_w7_h7_p0.4mm", () => {
const soup = fp.string("lqfn56_w7_h7_p0.4mm").circuitJson()
const svgContent = convertCircuitJsonToPcbSvg(soup)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "lqfn56_w7_h7_p0.4mm")
})
Loading