-
Notifications
You must be signed in to change notification settings - Fork 63
feat: add sc70 footprint as JEDEC MO-203 / SOT-323 alias with correct defaults #550
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
Open
victorjzq
wants to merge
2
commits into
tscircuit:main
Choose a base branch
from
victorjzq:feat/sc70-alias
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import type { AnyCircuitElement } from "circuit-json" | ||
| import type { z } from "zod" | ||
| import { sot323, type sot323_def } from "./sot323" | ||
|
|
||
| /** | ||
| * SC-70 footprint — JEDEC MO-203 / SOT-323 package (same physical package). | ||
| * | ||
| * Defaults match the SC-70-3 (3-pin) package: | ||
| * body: 2.0mm × 1.25mm, pitch: 0.65mm | ||
| * | ||
| * The SC-70 name is an alias for SOT-323; the underlying layout is identical. | ||
| * Use `sc70` or `sc70_3` for the 3-pin variant. | ||
| */ | ||
| export const sc70 = ( | ||
| raw_params: z.input<typeof sot323_def> & { string?: string }, | ||
| ): { circuitJson: AnyCircuitElement[]; parameters: any } => { | ||
| // Apply SC-70 defaults (JEDEC MO-203 / KiCad SOT-323 dimensions) | ||
| const params = { | ||
| w: "2.0mm", | ||
| h: "1.25mm", | ||
| pl: "0.6mm", | ||
| pw: "0.35mm", | ||
| p: "1.1mm", | ||
| ...raw_params, | ||
| } | ||
| return sot323(params) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { test, expect } from "bun:test" | ||
| import { convertCircuitJsonToPcbSvg } from "circuit-to-svg" | ||
| import { fp } from "../src/footprinter" | ||
|
|
||
| test("sc70", () => { | ||
| const circuitJson = fp.string("sc70").circuitJson() | ||
| const svgContent = convertCircuitJsonToPcbSvg(circuitJson) | ||
| expect(svgContent).toMatchSvgSnapshot(import.meta.path, "sc70") | ||
| }) | ||
|
|
||
| test("sc70_3", () => { | ||
| const circuitJson = fp.string("sc70_3").circuitJson() | ||
| const svgContent = convertCircuitJsonToPcbSvg(circuitJson) | ||
| expect(svgContent).toMatchSvgSnapshot(import.meta.path, "sc70_3") | ||
| }) | ||
|
|
||
| test("sc70 custom params", () => { | ||
| const circuitJson = fp | ||
| .string("sc70_w2.0mm_h1.25mm_p0.65mm") | ||
| .circuitJson() | ||
| const svgContent = convertCircuitJsonToPcbSvg(circuitJson) | ||
| expect(svgContent).toMatchSvgSnapshot(import.meta.path, "sc70_custom") | ||
| }) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This test file contains 3 test() calls (lines 5, 11, and 17), which violates the rule that a *.test.ts file may have AT MOST one test(...). After that, the user should split into multiple, numbered files. This file should be split into separate files like sc701.test.ts, sc702.test.ts, and sc703.test.ts, with each file containing only one test() call.
Spotted by Graphite (based on custom rule: Custom rule)

Is this helpful? React 👍 or 👎 to let us know.