@tscircuit/footprinter 0.0.292 → 0.0.294

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/dist/index.js CHANGED
@@ -135,7 +135,17 @@ var platedhole = (pn, x, y, id, od) => {
135
135
 
136
136
  // src/helpers/platedHoleWithRectPad.ts
137
137
  import { mm as mm2 } from "@tscircuit/mm";
138
- var platedHoleWithRectPad = (pn, x, y, holeDiameter, rectPadWidth, rectPadHeight, holeOffsetX, holeOffsetY) => {
138
+ var platedHoleWithRectPad = (options) => {
139
+ const {
140
+ pn,
141
+ x,
142
+ y,
143
+ holeDiameter,
144
+ rectPadWidth,
145
+ rectPadHeight,
146
+ holeOffsetX = 0,
147
+ holeOffsetY = 0
148
+ } = options;
139
149
  return {
140
150
  pcb_plated_hole_id: "",
141
151
  type: "pcb_plated_hole",
@@ -235,14 +245,14 @@ var dip = (raw_params) => {
235
245
  );
236
246
  if (i === 0 && !parameters.nosquareplating) {
237
247
  platedHoles.push(
238
- platedHoleWithRectPad(
239
- i + 1,
248
+ platedHoleWithRectPad({
249
+ pn: i + 1,
240
250
  x,
241
251
  y,
242
- parameters.id ?? "0.8mm",
243
- parameters.od ?? "1mm",
244
- parameters.od ?? "1mm"
245
- )
252
+ holeDiameter: parameters.id ?? "0.8mm",
253
+ rectPadWidth: parameters.od ?? "1mm",
254
+ rectPadHeight: parameters.od ?? "1mm"
255
+ })
246
256
  );
247
257
  continue;
248
258
  }
@@ -603,6 +613,9 @@ var res0402Array2_def = base_def.extend({
603
613
  var padSpacing = 1;
604
614
  var res0402Array2 = (rawParams) => {
605
615
  const params = res0402Array2_def.parse(rawParams);
616
+ if (params.concave === true) {
617
+ return [];
618
+ }
606
619
  const padWidth = mm4(params.pw);
607
620
  const padHeight = mm4(params.ph);
608
621
  const padPitch = mm4(params.p);
@@ -2339,7 +2352,14 @@ var pinrow = (raw_params) => {
2339
2352
  } else {
2340
2353
  if (pinNumber === 1 && !parameters.nosquareplating) {
2341
2354
  holes.push(
2342
- platedHoleWithRectPad(pinNumber, xoff, yoff, id, od, od, 0, 0)
2355
+ platedHoleWithRectPad({
2356
+ pn: pinNumber,
2357
+ x: xoff,
2358
+ y: yoff,
2359
+ holeDiameter: id,
2360
+ rectPadWidth: od,
2361
+ rectPadHeight: od
2362
+ })
2343
2363
  );
2344
2364
  } else {
2345
2365
  holes.push(platedhole(pinNumber, xoff, yoff, id, od));
@@ -4044,16 +4064,14 @@ var to92 = (raw_params) => {
4044
4064
  if (parameters.num_pins === 3) {
4045
4065
  if (inline) {
4046
4066
  platedHoles = [
4047
- platedHoleWithRectPad(
4048
- 1,
4049
- -padSpacing7,
4050
- holeY - padSpacing7,
4051
- holeDia,
4052
- padDia,
4053
- padHeight,
4054
- 0,
4055
- 0
4056
- ),
4067
+ platedHoleWithRectPad({
4068
+ pn: 1,
4069
+ x: -padSpacing7,
4070
+ y: holeY - padSpacing7,
4071
+ holeDiameter: holeDia,
4072
+ rectPadWidth: padDia,
4073
+ rectPadHeight: padHeight
4074
+ }),
4057
4075
  platedHolePill(2, 0, holeY - padSpacing7, holeDia, padWidth, padHeight),
4058
4076
  platedHolePill(
4059
4077
  3,
@@ -4066,32 +4084,28 @@ var to92 = (raw_params) => {
4066
4084
  ];
4067
4085
  } else {
4068
4086
  platedHoles = [
4069
- platedHoleWithRectPad(
4070
- 1,
4071
- -padSpacing7,
4072
- holeY - padSpacing7,
4073
- holeDia,
4074
- padDia,
4075
- padDia,
4076
- 0,
4077
- 0
4078
- ),
4087
+ platedHoleWithRectPad({
4088
+ pn: 1,
4089
+ x: -padSpacing7,
4090
+ y: holeY - padSpacing7,
4091
+ holeDiameter: holeDia,
4092
+ rectPadWidth: padDia,
4093
+ rectPadHeight: padDia
4094
+ }),
4079
4095
  platedhole(2, 0, holeY, holeDia, padDia),
4080
4096
  platedhole(3, padSpacing7, holeY - padSpacing7, holeDia, padDia)
4081
4097
  ];
4082
4098
  }
4083
4099
  } else if (parameters.num_pins === 2) {
4084
4100
  platedHoles = [
4085
- platedHoleWithRectPad(
4086
- 1,
4087
- -padSpacing7,
4088
- holeY - padSpacing7,
4089
- holeDia,
4090
- padWidth,
4091
- padHeight,
4092
- 0,
4093
- 0
4094
- ),
4101
+ platedHoleWithRectPad({
4102
+ pn: 1,
4103
+ x: -padSpacing7,
4104
+ y: holeY - padSpacing7,
4105
+ holeDiameter: holeDia,
4106
+ rectPadWidth: padWidth,
4107
+ rectPadHeight: padHeight
4108
+ }),
4095
4109
  platedHolePill(
4096
4110
  2,
4097
4111
  padSpacing7,
@@ -6380,8 +6394,26 @@ function generatePads(variant, numPins, p, id, pw, pl) {
6380
6394
  const pads = [];
6381
6395
  if (variant === "ph") {
6382
6396
  const half_p = p / 2;
6383
- pads.push(platedHoleWithRectPad(1, -half_p, 2, id, pw, pl));
6384
- pads.push(platedHoleWithRectPad(2, half_p, 2, id, pw, pl));
6397
+ pads.push(
6398
+ platedHoleWithRectPad({
6399
+ pn: 1,
6400
+ x: -half_p,
6401
+ y: 2,
6402
+ holeDiameter: id,
6403
+ rectPadWidth: pw,
6404
+ rectPadHeight: pl
6405
+ })
6406
+ );
6407
+ pads.push(
6408
+ platedHoleWithRectPad({
6409
+ pn: 2,
6410
+ x: half_p,
6411
+ y: 2,
6412
+ holeDiameter: id,
6413
+ rectPadWidth: pw,
6414
+ rectPadHeight: pl
6415
+ })
6416
+ );
6385
6417
  } else {
6386
6418
  const startX = -((numPins - 1) / 2) * p;
6387
6419
  for (let i = 0; i < numPins; i++) {
@@ -7921,7 +7953,14 @@ var platedhole2 = (raw_params) => {
7921
7953
  const { d, pd, squarepad } = params;
7922
7954
  return {
7923
7955
  circuitJson: [
7924
- squarepad ? platedHoleWithRectPad(1, 0, 0, d, pd, pd) : platedhole(1, 0, 0, d, pd),
7956
+ squarepad ? platedHoleWithRectPad({
7957
+ pn: 1,
7958
+ x: 0,
7959
+ y: 0,
7960
+ holeDiameter: d,
7961
+ rectPadWidth: pd,
7962
+ rectPadHeight: pd
7963
+ }) : platedhole(1, 0, 0, d, pd),
7925
7964
  silkscreenRef(0, pd / 2 + 0.5, 0.2)
7926
7965
  ],
7927
7966
  parameters: params
@@ -8281,9 +8320,16 @@ var to92l = (raw_params) => {
8281
8320
  const od = parameters.inline ? 1.05 : Number.parseFloat(parameters.od);
8282
8321
  const padH = parameters.inline ? 1.5 : od;
8283
8322
  const holes = [
8284
- platedHoleWithRectPad(1, 0, 0, parameters.id, od, padH, 0, 0),
8285
- parameters.inline ? platedHolePill(2, p, 0, parameters.id, od, padH) : platedhole(2, p, p, parameters.id, od),
8286
- parameters.inline ? platedHolePill(3, p * 2, 0, parameters.id, od, padH) : platedhole(3, p * 2, 0, parameters.id, od)
8323
+ platedHoleWithRectPad({
8324
+ pn: 1,
8325
+ x: 0,
8326
+ y: 0,
8327
+ holeDiameter: parameters.id,
8328
+ rectPadWidth: od,
8329
+ rectPadHeight: padH
8330
+ }),
8331
+ parameters.inline ? platedHolePill(2, p, 0, Number.parseFloat(parameters.id), od, padH) : platedhole(2, p, p, parameters.id, od),
8332
+ parameters.inline ? platedHolePill(3, p * 2, 0, Number.parseFloat(parameters.id), od, padH) : platedhole(3, p * 2, 0, parameters.id, od)
8287
8333
  ];
8288
8334
  const radius = w / 2;
8289
8335
  const cx = parameters.inline ? p - 0.09 : p;