@tscircuit/footprinter 0.0.22 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/fn/mlp.ts +13 -0
- package/src/footprinter.ts +4 -1
- package/tests/mlp.test.ts +10 -0
package/package.json
CHANGED
package/src/fn/mlp.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AnySoupElement } from "@tscircuit/soup"
|
|
2
|
+
import { base_quad_def, quad, quad_def, quadTransform } from "./quad"
|
|
3
|
+
import type { z } from "zod"
|
|
4
|
+
|
|
5
|
+
export const mlp_def = base_quad_def.extend({}).transform(quadTransform)
|
|
6
|
+
|
|
7
|
+
export const mlp = (params: z.input<typeof mlp_def>): AnySoupElement[] => {
|
|
8
|
+
params.legsoutside = false
|
|
9
|
+
if (params.thermalpad === undefined) {
|
|
10
|
+
params.thermalpad = true
|
|
11
|
+
}
|
|
12
|
+
return quad(params)
|
|
13
|
+
}
|
package/src/footprinter.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { soic } from "./fn/soic"
|
|
|
8
8
|
import { quad } from "./fn/quad"
|
|
9
9
|
import { qfn } from "./fn/qfn"
|
|
10
10
|
import { qfp } from "./fn/qfp"
|
|
11
|
+
import { mlp } from "./fn/mlp"
|
|
11
12
|
import type { AnySoupElement } from "@tscircuit/soup"
|
|
12
13
|
import { isNotNull } from "./helpers/is-not-null"
|
|
13
14
|
|
|
@@ -51,7 +52,8 @@ export type Footprinter = {
|
|
|
51
52
|
>
|
|
52
53
|
qfn: (num_pins: number) => FootprinterParamsBuilder<"w" | "h" | "p">
|
|
53
54
|
soic: (num_pins: number) => FootprinterParamsBuilder<"w" | "p" | "id" | "od">
|
|
54
|
-
|
|
55
|
+
mlp: (num_pins: number) => FootprinterParamsBuilder<"w" | "h" | "p">,
|
|
56
|
+
params: () => any,
|
|
55
57
|
soup: () => AnySoupElement[]
|
|
56
58
|
}
|
|
57
59
|
|
|
@@ -91,6 +93,7 @@ export const footprinter = (): Footprinter & { string: typeof string } => {
|
|
|
91
93
|
if ("quad" in target) return () => quad(target)
|
|
92
94
|
if ("qfn" in target) return () => qfn(target)
|
|
93
95
|
if ("qfp" in target) return () => qfp(target)
|
|
96
|
+
if ("mlp" in target) return () => mlp(target)
|
|
94
97
|
|
|
95
98
|
return () => {
|
|
96
99
|
// TODO improve error
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import test from "ava"
|
|
2
|
+
import { getTestFixture, toPinPositionString } from "./fixtures"
|
|
3
|
+
|
|
4
|
+
test("mlp16_w4_h4_p0.5mm", async (t) => {
|
|
5
|
+
const { fp, logSoup } = await getTestFixture(t)
|
|
6
|
+
const soup = fp.string("mlp16_w4_h4_p0.5mm").soup()
|
|
7
|
+
|
|
8
|
+
await logSoup(soup)
|
|
9
|
+
t.pass()
|
|
10
|
+
})
|