@tscircuit/footprinter 0.0.20 → 0.0.21

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/fn/quad.ts +18 -18
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/footprinter",
3
3
  "type": "module",
4
- "version": "0.0.20",
4
+ "version": "0.0.21",
5
5
  "description": "",
6
6
  "main": "dist/index.cjs",
7
7
  "scripts": {
package/src/fn/quad.ts CHANGED
@@ -60,14 +60,15 @@ const quad_def = base_quad_def.transform((v) => {
60
60
 
61
61
  const SIDES_CCW = ["left", "bottom", "right", "top"] as const
62
62
 
63
- export const getQuadCoords = (
64
- pinCount: number,
65
- pn: number, // pin number
66
- w: number, // width of the package
67
- h: number, // height (length) of the package
68
- p: number, // pitch between pins
63
+ export const getQuadCoords = (params: {
64
+ pin_count: number
65
+ pn: number // pin number
66
+ w: number // width of the package
67
+ h: number // height (length) of the package
68
+ p: number // pitch between pins
69
69
  pl: number // length of the pin
70
- ) => {
70
+ }) => {
71
+ const { pin_count: pinCount, pn, w, h, p, pl } = params
71
72
  const sidePinCount = pinCount / 4
72
73
  const side = SIDES_CCW[Math.floor((pn - 1) / sidePinCount)]
73
74
  const pos = (pn - 1) % sidePinCount
@@ -104,14 +105,14 @@ export const quad = (
104
105
  x,
105
106
  y,
106
107
  o: orientation,
107
- } = getQuadCoords(
108
- params.num_pins,
109
- i + 1,
110
- params.w,
111
- params.h,
112
- params.p ?? 0.5,
113
- params.pl
114
- )
108
+ } = getQuadCoords({
109
+ pin_count: params.num_pins,
110
+ pn: i + 1,
111
+ w: params.w,
112
+ h: params.h,
113
+ p: params.p ?? 0.5,
114
+ pl: params.pl,
115
+ })
115
116
 
116
117
  let pw = params.pw
117
118
  let pl = params.pl
@@ -125,9 +126,8 @@ export const quad = (
125
126
 
126
127
  if (params.thermalpad) {
127
128
  if (typeof params.thermalpad === "boolean") {
128
- const sidePinCount = params.num_pins / 4
129
- const ibw = params.p * (sidePinCount - 1) + params.pw
130
- const ibh = params.p * (sidePinCount - 1) + params.pw
129
+ const ibw = params.p * (spc - 1) + params.pw
130
+ const ibh = params.p * (spc - 1) + params.pw
131
131
  pads.push(rectpad(["thermalpad"], 0, 0, ibw, ibh))
132
132
  } else {
133
133
  pads.push(