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
5 changes: 5 additions & 0 deletions src/fn/lcc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ export const lcc = (
parameters: z.input<typeof lcc_def>,
): { circuitJson: AnySoupElement[]; parameters: any } => {
parameters.legsoutside = false
// Standard LCC/PLCC lead pitch is 1.27mm; quad's 0.5mm default leaves
// 0.6mm-wide pads overlapping by 0.1mm along the column.
if (!parameters.p) {
parameters.p = 1.27
}
if (!parameters.pl) {
parameters.pl = 1.0
}
Expand Down
34 changes: 34 additions & 0 deletions tests/lcc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,37 @@ test("lcc68", () => {

expect(svgContent).toMatchSvgSnapshot(import.meta.path, "lcc68")
})

test("lcc pads do not overlap along the pitch axis", () => {
for (const name of ["lcc20", "lcc44"]) {
const pads = fp
.string(name)
.circuitJson()
.filter((el: any) => el.type === "pcb_smtpad") as any[]

const maxX = Math.max(...pads.map((p) => p.x))
const colPads = pads.filter((p) => Math.abs(p.x - maxX) < 0.01)
const col = colPads.map((p) => p.y).sort((a: number, b: number) => b - a)
const maxExtent = Math.max(...colPads.map((p) => p.height))

for (let i = 1; i < col.length; i++) {
expect(
col[i - 1] - col[i],
`${name}: adjacent pads overlap`,
).toBeGreaterThanOrEqual(maxExtent)
}
}
})

test("lcc default pitch is 1.27mm", () => {
const pads = fp
.string("lcc44")
.circuitJson()
.filter((el: any) => el.type === "pcb_smtpad") as any[]
const maxX = Math.max(...pads.map((p) => p.x))
const col = pads
.filter((p) => Math.abs(p.x - maxX) < 0.01)
.map((p) => p.y)
.sort((a: number, b: number) => b - a)
expect(Math.round((col[0] - col[1]) * 1000) / 1000).toBe(1.27)
})
Loading