-
Notifications
You must be signed in to change notification settings - Fork 41
add plcc fp #469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
add plcc fp #469
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import type { AnyCircuitElement } from "circuit-json" | ||
| import { quad, quad_def } from "./quad" | ||
| import type { z } from "zod" | ||
|
|
||
| export const plcc_def = quad_def | ||
|
|
||
| export const plcc = ( | ||
| raw_params: z.input<typeof quad_def>, | ||
| ): { circuitJson: AnyCircuitElement[]; parameters: any } => { | ||
| if (!raw_params.p) { | ||
| raw_params.p = 1.27 | ||
| } | ||
|
|
||
| if (!raw_params.pl) { | ||
| raw_params.pl = 1.7 | ||
| } | ||
|
|
||
| if (!raw_params.pw) { | ||
| raw_params.pw = 0.6 | ||
| } | ||
|
|
||
| if (raw_params.pcdfe === undefined && raw_params.w) { | ||
| const w = | ||
| typeof raw_params.w === "number" | ||
| ? raw_params.w | ||
| : parseFloat(raw_params.w as string) | ||
| if (!isNaN(w)) { | ||
| raw_params.pcdfe = 8.0 - w / 2 | ||
| } | ||
| } | ||
|
|
||
| return quad(raw_params) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { expect, test } from "bun:test" | ||
| import { compareFootprinterVsKicad } from "../fixtures/compareFootprinterVsKicad" | ||
| import { convertCircuitJsonToPcbSvg } from "circuit-to-svg" | ||
|
|
||
| test("parity/plcc44", async () => { | ||
| const { combinedFootprintElements, booleanDifferenceSvg } = | ||
| await compareFootprinterVsKicad( | ||
| "plcc44_w16.6_h16.6_p1.27mm", | ||
| "Package_LCC.pretty/PLCC-44_16.6x16.6mm_P1.27mm.circuit.json", | ||
| ) | ||
|
|
||
| const svgContent = convertCircuitJsonToPcbSvg(combinedFootprintElements) | ||
| expect(svgContent).toMatchSvgSnapshot(import.meta.path, "plcc44_parity") | ||
| expect(booleanDifferenceSvg).toMatchSvgSnapshot( | ||
| import.meta.path, | ||
| "plcc44_parity._boolean_difference", | ||
| ) | ||
| }) | ||
|
Comment on lines
+1
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test file name 'plcc_kikac_parity.test.ts' contains a typo ('kikac' instead of 'kicad') and doesn't follow proper kebab-case naming convention. The file name should be consistent with the project naming standards and should be 'plcc-kicad-parity.test.ts' to match kebab-case convention and correct the spelling error. Spotted by Graphite Agent (based on custom rule: Custom rule)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Sahil-Gupta584 your test file name is wrong.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ohh my bad |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { test, expect } from "bun:test" | ||
| import { convertCircuitJsonToPcbSvg } from "circuit-to-svg" | ||
| import { fp } from "../src/footprinter" | ||
|
|
||
| test("plcc44_w16.5_h16.5_p1.27mm", () => { | ||
| const soup = fp.string("plcc44_w16.5_h16.5_p1.27mm").circuitJson() | ||
| const svgContent = convertCircuitJsonToPcbSvg(soup) | ||
| expect(svgContent).toMatchSvgSnapshot( | ||
| import.meta.path, | ||
| "plcc44_w16.5_h16.5_p1.27mm", | ||
| ) | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its Pad Center Distance From Edge, actaully my parity test was failing as you know in pr.
I have introduced this to dyanmically able to change position of pads from center.
Earlier there was only one option of
legsoutside?: booleanbut this was enough to perfectly place pads to kikad footprint.I have take care for other taste to not break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should i Add comments for this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sahil-Gupta584 if you are using this flags then please describe it with . describe()