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
3 changes: 3 additions & 0 deletions src/fn/lcc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export const lcc = (
parameters: z.input<typeof lcc_def>,
): { circuitJson: AnySoupElement[]; parameters: any } => {
parameters.legsoutside = false
if (!parameters.p) {
parameters.p = 1.27
}
if (!parameters.pl) {
parameters.pl = 1.0
}
Expand Down
22 changes: 22 additions & 0 deletions tests/lcc-pitch.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { test, expect } from "bun:test"
import { fp } from "../src/index"

test("lcc defaults to standard 1.27mm pitch without overlapping pads (#794)", () => {
const elements = fp.string("lcc44").circuitJson()
const smtpads = elements.filter(
(e: any) => e.type === "pcb_smtpad",
) as Array<any>

expect(smtpads.length).toBe(44)

// Pin 1 and Pin 2 on the left side
const pin1 = smtpads.find((p) => p.port_hints?.includes("1"))!
const pin2 = smtpads.find((p) => p.port_hints?.includes("2"))!

expect(pin1).toBeDefined()
expect(pin2).toBeDefined()

const pitch = Math.abs(pin1.y - pin2.y)
expect(pitch).toBeCloseTo(1.27, 2)
expect(pin1.height).toBeLessThanOrEqual(pitch)
})
Loading