@tscircuit/footprinter 0.0.316 → 0.0.318

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
@@ -82,6 +82,7 @@ __export(fn_exports, {
82
82
  stampboard: () => stampboard,
83
83
  stampreceiver: () => stampreceiver,
84
84
  to220: () => to220,
85
+ to220f: () => to220f,
85
86
  to92: () => to92,
86
87
  to92l: () => to92l,
87
88
  to92s: () => to92s,
@@ -146,7 +147,8 @@ var platedHoleWithRectPad = (options) => {
146
147
  rectPadWidth,
147
148
  rectPadHeight,
148
149
  holeOffsetX = 0,
149
- holeOffsetY = 0
150
+ holeOffsetY = 0,
151
+ rectBorderRadius
150
152
  } = options;
151
153
  return {
152
154
  pcb_plated_hole_id: "",
@@ -159,6 +161,9 @@ var platedHoleWithRectPad = (options) => {
159
161
  pad_shape: "rect",
160
162
  rect_pad_width: mm2(rectPadWidth),
161
163
  rect_pad_height: mm2(rectPadHeight),
164
+ ...rectBorderRadius !== void 0 && {
165
+ rect_border_radius: rectBorderRadius
166
+ },
162
167
  pcb_port_id: "",
163
168
  layers: ["top", "bottom"],
164
169
  port_hints: [pn.toString()],
@@ -5219,14 +5224,14 @@ var sot89_3 = (parameters) => {
5219
5224
  const pads = [];
5220
5225
  const padGap = Number.parseFloat(parameters.p);
5221
5226
  const padWidth = Number.parseFloat(parameters.pw);
5222
- const length62 = Number.parseFloat(parameters.w);
5227
+ const length63 = Number.parseFloat(parameters.w);
5223
5228
  const padHeight = Number.parseFloat(parameters.pl);
5224
5229
  const centerExtra = 0.175;
5225
5230
  const outerPadXShift = (padHeight - (padHeight + centerExtra)) / 2;
5226
5231
  pads.push(
5227
- rectpad(1, -length62 / 2 + outerPadXShift, padGap, padHeight, padWidth),
5228
- rectpad(2, -length62 / 2, 0, padHeight + centerExtra, padWidth),
5229
- rectpad(3, -length62 / 2 + outerPadXShift, -padGap, padHeight, padWidth)
5232
+ rectpad(1, -length63 / 2 + outerPadXShift, padGap, padHeight, padWidth),
5233
+ rectpad(2, -length63 / 2, 0, padHeight + centerExtra, padWidth),
5234
+ rectpad(3, -length63 / 2 + outerPadXShift, -padGap, padHeight, padWidth)
5230
5235
  );
5231
5236
  const silkscreenRefText = silkscreenRef(0, 0, 0.3);
5232
5237
  const width = Number.parseFloat(parameters.w) / 2 - 1;
@@ -5266,7 +5271,7 @@ var sot89_5 = (parameters) => {
5266
5271
  const pads = [];
5267
5272
  const padGap = Number.parseFloat(parameters.p);
5268
5273
  const padWidth = Number.parseFloat(parameters.pw);
5269
- const length62 = Number.parseFloat(parameters.w);
5274
+ const length63 = Number.parseFloat(parameters.w);
5270
5275
  pads.push(
5271
5276
  rectpad(1, -1.85, -1.5, 1.5, 0.7),
5272
5277
  rectpad(2, -1.85, 1.5, 1.5, 0.7),
@@ -5349,8 +5354,8 @@ var to220_def = base_def.extend({
5349
5354
  });
5350
5355
  var to220 = (raw_params) => {
5351
5356
  const parameters = to220_def.parse(raw_params);
5352
- const { fn, id, od, w, h, string: string3 } = parameters;
5353
- const numPins = Number.parseInt(string3?.split("_")[1] ?? "3");
5357
+ const { id, od, w, h, string: string3 } = parameters;
5358
+ const numPins = parameters.num_pins ?? Number.parseInt(string3?.match(/^to220(?:_|-)(\d+)/i)?.[1] ?? "3");
5354
5359
  const holeY = -1;
5355
5360
  const halfWidth = w / 2;
5356
5361
  const halfHeight = h / 2;
@@ -5424,23 +5429,84 @@ var to220 = (raw_params) => {
5424
5429
  };
5425
5430
  };
5426
5431
 
5427
- // src/fn/minimelf.ts
5428
- import { z as z49 } from "zod";
5432
+ // src/fn/to220f.ts
5433
+ import { mm as mm14 } from "@tscircuit/mm";
5429
5434
  import { length as length39 } from "circuit-json";
5430
- var minimelf_def = base_def.extend({
5435
+ import { z as z49 } from "zod";
5436
+ var TO220F_PITCH_MM = 2.54;
5437
+ var to220f_def = base_def.extend({
5431
5438
  fn: z49.string(),
5432
- num_pins: z49.literal(2).default(2),
5433
- w: z49.string().default("5.40mm"),
5434
- h: z49.string().default("2.30mm"),
5435
- pl: z49.string().default("1.30mm"),
5436
- pw: z49.string().default("1.70mm"),
5437
- p: z49.string().default("3.5mm")
5439
+ // KiCad TO-220F-3_Vertical: hole=1.2mm, pad=1.905×2.0mm, pitch=2.54mm
5440
+ id: length39.optional().default("1.2mm"),
5441
+ od: length39.optional().default("1.905mm"),
5442
+ pad_h: length39.optional().default("2mm"),
5443
+ w: length39.optional().default("13mm"),
5444
+ h: length39.optional().default("7mm"),
5445
+ num_pins: z49.number().optional(),
5446
+ string: z49.string().optional()
5447
+ });
5448
+ var to220f = (raw_params) => {
5449
+ const parameters = to220f_def.parse(raw_params);
5450
+ const numPins = parameters.num_pins ?? Number.parseInt(
5451
+ parameters.string?.match(/^to220f(?:_|-)(\d+)/i)?.[1] ?? "3"
5452
+ );
5453
+ const baseResult = to220({
5454
+ ...parameters,
5455
+ fn: "to220",
5456
+ string: parameters.string?.replace(/^to220f/i, "to220"),
5457
+ num_pins: numPins
5458
+ });
5459
+ const holeY = -1;
5460
+ const newHoles = Array.from(
5461
+ { length: numPins },
5462
+ (_, i) => {
5463
+ const x = numPins % 2 === 0 ? (i - numPins / 2 + 0.5) * TO220F_PITCH_MM : (i - Math.floor(numPins / 2)) * TO220F_PITCH_MM;
5464
+ if (i === 0) {
5465
+ return platedHoleWithRectPad({
5466
+ pn: 1,
5467
+ x,
5468
+ y: holeY,
5469
+ holeDiameter: parameters.id,
5470
+ rectPadWidth: parameters.od,
5471
+ rectPadHeight: parameters.pad_h
5472
+ });
5473
+ }
5474
+ return platedHolePill(
5475
+ i + 1,
5476
+ x,
5477
+ holeY,
5478
+ mm14(parameters.id),
5479
+ mm14(parameters.od),
5480
+ mm14(parameters.pad_h)
5481
+ );
5482
+ }
5483
+ );
5484
+ const nonHoleElements = baseResult.circuitJson.filter(
5485
+ (e) => e.type !== "pcb_plated_hole"
5486
+ );
5487
+ return {
5488
+ circuitJson: [...newHoles, ...nonHoleElements],
5489
+ parameters: { ...parameters, p: TO220F_PITCH_MM, num_pins: numPins }
5490
+ };
5491
+ };
5492
+
5493
+ // src/fn/minimelf.ts
5494
+ import { z as z50 } from "zod";
5495
+ import { length as length40 } from "circuit-json";
5496
+ var minimelf_def = base_def.extend({
5497
+ fn: z50.string(),
5498
+ num_pins: z50.literal(2).default(2),
5499
+ w: z50.string().default("5.40mm"),
5500
+ h: z50.string().default("2.30mm"),
5501
+ pl: z50.string().default("1.30mm"),
5502
+ pw: z50.string().default("1.70mm"),
5503
+ p: z50.string().default("3.5mm")
5438
5504
  });
5439
5505
  var minimelf = (raw_params) => {
5440
5506
  const parameters = minimelf_def.parse(raw_params);
5441
5507
  const silkscreenRefText = silkscreenRef(
5442
5508
  0,
5443
- length39.parse(parameters.h) / 2 + 0.4,
5509
+ length40.parse(parameters.h) / 2 + 0.4,
5444
5510
  0.3
5445
5511
  );
5446
5512
  const silkscreenLine = {
@@ -5449,20 +5515,20 @@ var minimelf = (raw_params) => {
5449
5515
  pcb_component_id: "",
5450
5516
  route: [
5451
5517
  {
5452
- x: length39.parse(parameters.p) / 2,
5453
- y: length39.parse(parameters.h) / 2
5518
+ x: length40.parse(parameters.p) / 2,
5519
+ y: length40.parse(parameters.h) / 2
5454
5520
  },
5455
5521
  {
5456
- x: -length39.parse(parameters.w) / 2,
5457
- y: length39.parse(parameters.h) / 2
5522
+ x: -length40.parse(parameters.w) / 2,
5523
+ y: length40.parse(parameters.h) / 2
5458
5524
  },
5459
5525
  {
5460
- x: -length39.parse(parameters.w) / 2,
5461
- y: -length39.parse(parameters.h) / 2
5526
+ x: -length40.parse(parameters.w) / 2,
5527
+ y: -length40.parse(parameters.h) / 2
5462
5528
  },
5463
5529
  {
5464
- x: length39.parse(parameters.p) / 2,
5465
- y: -length39.parse(parameters.h) / 2
5530
+ x: length40.parse(parameters.p) / 2,
5531
+ y: -length40.parse(parameters.h) / 2
5466
5532
  }
5467
5533
  ],
5468
5534
  stroke_width: 0.1,
@@ -5501,22 +5567,22 @@ var miniMelfWithoutParsing = (parameters) => {
5501
5567
  };
5502
5568
 
5503
5569
  // src/fn/sod882d.ts
5504
- import { z as z50 } from "zod";
5505
- import { length as length40 } from "circuit-json";
5570
+ import { z as z51 } from "zod";
5571
+ import { length as length41 } from "circuit-json";
5506
5572
  var sod_def11 = base_def.extend({
5507
- fn: z50.string(),
5508
- num_pins: z50.literal(2).default(2),
5509
- w: z50.string().default("1.90mm"),
5510
- h: z50.string().default("1.33mm"),
5511
- pl: z50.string().default("0.5mm"),
5512
- pw: z50.string().default("0.7mm"),
5513
- p: z50.string().default("0.8mm")
5573
+ fn: z51.string(),
5574
+ num_pins: z51.literal(2).default(2),
5575
+ w: z51.string().default("1.90mm"),
5576
+ h: z51.string().default("1.33mm"),
5577
+ pl: z51.string().default("0.5mm"),
5578
+ pw: z51.string().default("0.7mm"),
5579
+ p: z51.string().default("0.8mm")
5514
5580
  });
5515
5581
  var sod882d = (raw_params) => {
5516
5582
  const parameters = sod_def11.parse(raw_params);
5517
5583
  const silkscreenRefText = silkscreenRef(
5518
5584
  0,
5519
- length40.parse(parameters.h) + 0.1,
5585
+ length41.parse(parameters.h) + 0.1,
5520
5586
  0.3
5521
5587
  );
5522
5588
  const silkscreenLine = {
@@ -5525,20 +5591,20 @@ var sod882d = (raw_params) => {
5525
5591
  pcb_component_id: "",
5526
5592
  route: [
5527
5593
  {
5528
- x: length40.parse(parameters.p) / 2 + 0.1,
5529
- y: length40.parse(parameters.h) / 2
5594
+ x: length41.parse(parameters.p) / 2 + 0.1,
5595
+ y: length41.parse(parameters.h) / 2
5530
5596
  },
5531
5597
  {
5532
- x: -length40.parse(parameters.w) / 2,
5533
- y: length40.parse(parameters.h) / 2
5598
+ x: -length41.parse(parameters.w) / 2,
5599
+ y: length41.parse(parameters.h) / 2
5534
5600
  },
5535
5601
  {
5536
- x: -length40.parse(parameters.w) / 2,
5537
- y: -length40.parse(parameters.h) / 2
5602
+ x: -length41.parse(parameters.w) / 2,
5603
+ y: -length41.parse(parameters.h) / 2
5538
5604
  },
5539
5605
  {
5540
- x: length40.parse(parameters.p) / 2 + 0.1,
5541
- y: -length40.parse(parameters.h) / 2
5606
+ x: length41.parse(parameters.p) / 2 + 0.1,
5607
+ y: -length41.parse(parameters.h) / 2
5542
5608
  }
5543
5609
  ],
5544
5610
  stroke_width: 0.1,
@@ -5581,22 +5647,22 @@ var sodWithoutParsing12 = (parameters) => {
5581
5647
  };
5582
5648
 
5583
5649
  // src/fn/melf.ts
5584
- import { z as z51 } from "zod";
5585
- import { length as length41 } from "circuit-json";
5650
+ import { z as z52 } from "zod";
5651
+ import { length as length42 } from "circuit-json";
5586
5652
  var melf_def = base_def.extend({
5587
- fn: z51.string(),
5588
- num_pins: z51.literal(2).default(2),
5589
- w: z51.string().default("7.0mm"),
5590
- h: z51.string().default("3.35mm"),
5591
- pl: z51.string().default("1.50mm"),
5592
- pw: z51.string().default("2.70mm"),
5593
- p: z51.string().default("4.8mm")
5653
+ fn: z52.string(),
5654
+ num_pins: z52.literal(2).default(2),
5655
+ w: z52.string().default("7.0mm"),
5656
+ h: z52.string().default("3.35mm"),
5657
+ pl: z52.string().default("1.50mm"),
5658
+ pw: z52.string().default("2.70mm"),
5659
+ p: z52.string().default("4.8mm")
5594
5660
  });
5595
5661
  var melf = (raw_params) => {
5596
5662
  const parameters = melf_def.parse(raw_params);
5597
5663
  const silkscreenRefText = silkscreenRef(
5598
5664
  0,
5599
- length41.parse(parameters.h),
5665
+ length42.parse(parameters.h),
5600
5666
  0.3
5601
5667
  );
5602
5668
  const silkscreenLine = {
@@ -5605,20 +5671,20 @@ var melf = (raw_params) => {
5605
5671
  pcb_component_id: "",
5606
5672
  route: [
5607
5673
  {
5608
- x: length41.parse(parameters.p) / 2,
5609
- y: length41.parse(parameters.h) / 2
5674
+ x: length42.parse(parameters.p) / 2,
5675
+ y: length42.parse(parameters.h) / 2
5610
5676
  },
5611
5677
  {
5612
- x: -length41.parse(parameters.w) / 2,
5613
- y: length41.parse(parameters.h) / 2
5678
+ x: -length42.parse(parameters.w) / 2,
5679
+ y: length42.parse(parameters.h) / 2
5614
5680
  },
5615
5681
  {
5616
- x: -length41.parse(parameters.w) / 2,
5617
- y: -length41.parse(parameters.h) / 2
5682
+ x: -length42.parse(parameters.w) / 2,
5683
+ y: -length42.parse(parameters.h) / 2
5618
5684
  },
5619
5685
  {
5620
- x: length41.parse(parameters.p) / 2,
5621
- y: -length41.parse(parameters.h) / 2
5686
+ x: length42.parse(parameters.p) / 2,
5687
+ y: -length42.parse(parameters.h) / 2
5622
5688
  }
5623
5689
  ],
5624
5690
  stroke_width: 0.1,
@@ -5661,22 +5727,22 @@ var melfWithoutParsing = (parameters) => {
5661
5727
  };
5662
5728
 
5663
5729
  // src/fn/micromelf.ts
5664
- import { z as z52 } from "zod";
5665
- import { length as length42 } from "circuit-json";
5730
+ import { z as z53 } from "zod";
5731
+ import { length as length43 } from "circuit-json";
5666
5732
  var micromelf_def = base_def.extend({
5667
- fn: z52.string(),
5668
- num_pins: z52.literal(2).default(2),
5669
- w: z52.string().default("3.0mm"),
5670
- h: z52.string().default("1.80mm"),
5671
- pl: z52.string().default("0.80mm"),
5672
- pw: z52.string().default("1.20mm"),
5673
- p: z52.string().default("1.6mm")
5733
+ fn: z53.string(),
5734
+ num_pins: z53.literal(2).default(2),
5735
+ w: z53.string().default("3.0mm"),
5736
+ h: z53.string().default("1.80mm"),
5737
+ pl: z53.string().default("0.80mm"),
5738
+ pw: z53.string().default("1.20mm"),
5739
+ p: z53.string().default("1.6mm")
5674
5740
  });
5675
5741
  var micromelf = (raw_params) => {
5676
5742
  const parameters = micromelf_def.parse(raw_params);
5677
5743
  const silkscreenRefText = silkscreenRef(
5678
5744
  0,
5679
- length42.parse(parameters.h),
5745
+ length43.parse(parameters.h),
5680
5746
  0.3
5681
5747
  );
5682
5748
  const silkscreenLine = {
@@ -5685,20 +5751,20 @@ var micromelf = (raw_params) => {
5685
5751
  pcb_component_id: "",
5686
5752
  route: [
5687
5753
  {
5688
- x: length42.parse(parameters.p) / 2,
5689
- y: length42.parse(parameters.h) / 2
5754
+ x: length43.parse(parameters.p) / 2,
5755
+ y: length43.parse(parameters.h) / 2
5690
5756
  },
5691
5757
  {
5692
- x: -length42.parse(parameters.w) / 2 - 0.1,
5693
- y: length42.parse(parameters.h) / 2
5758
+ x: -length43.parse(parameters.w) / 2 - 0.1,
5759
+ y: length43.parse(parameters.h) / 2
5694
5760
  },
5695
5761
  {
5696
- x: -length42.parse(parameters.w) / 2 - 0.1,
5697
- y: -length42.parse(parameters.h) / 2
5762
+ x: -length43.parse(parameters.w) / 2 - 0.1,
5763
+ y: -length43.parse(parameters.h) / 2
5698
5764
  },
5699
5765
  {
5700
- x: length42.parse(parameters.p) / 2,
5701
- y: -length42.parse(parameters.h) / 2
5766
+ x: length43.parse(parameters.p) / 2,
5767
+ y: -length43.parse(parameters.h) / 2
5702
5768
  }
5703
5769
  ],
5704
5770
  stroke_width: 0.1,
@@ -5741,22 +5807,22 @@ var microMelfWithoutParsing = (parameters) => {
5741
5807
  };
5742
5808
 
5743
5809
  // src/fn/sma.ts
5744
- import { z as z53 } from "zod";
5745
- import { length as length43 } from "circuit-json";
5810
+ import { z as z54 } from "zod";
5811
+ import { length as length44 } from "circuit-json";
5746
5812
  var sma_def = base_def.extend({
5747
- fn: z53.string(),
5748
- num_pins: z53.literal(2).default(2),
5749
- w: z53.string().default("7.10mm"),
5750
- h: z53.string().default("3.40mm"),
5751
- pl: z53.string().default("2.45mm"),
5752
- pw: z53.string().default("1.80mm"),
5753
- p: z53.string().default("4.05mm")
5813
+ fn: z54.string(),
5814
+ num_pins: z54.literal(2).default(2),
5815
+ w: z54.string().default("7.10mm"),
5816
+ h: z54.string().default("3.40mm"),
5817
+ pl: z54.string().default("2.45mm"),
5818
+ pw: z54.string().default("1.80mm"),
5819
+ p: z54.string().default("4.05mm")
5754
5820
  });
5755
5821
  var sma = (raw_params) => {
5756
5822
  const parameters = sma_def.parse(raw_params);
5757
5823
  const silkscreenRefText = silkscreenRef(
5758
5824
  0,
5759
- length43.parse(parameters.h) / 2 + 0.5,
5825
+ length44.parse(parameters.h) / 2 + 0.5,
5760
5826
  0.3
5761
5827
  );
5762
5828
  const silkscreenLine = {
@@ -5765,20 +5831,20 @@ var sma = (raw_params) => {
5765
5831
  pcb_component_id: "",
5766
5832
  route: [
5767
5833
  {
5768
- x: length43.parse(parameters.p) / 2,
5769
- y: length43.parse(parameters.h) / 2
5834
+ x: length44.parse(parameters.p) / 2,
5835
+ y: length44.parse(parameters.h) / 2
5770
5836
  },
5771
5837
  {
5772
- x: -length43.parse(parameters.w) / 2 - 0.5,
5773
- y: length43.parse(parameters.h) / 2
5838
+ x: -length44.parse(parameters.w) / 2 - 0.5,
5839
+ y: length44.parse(parameters.h) / 2
5774
5840
  },
5775
5841
  {
5776
- x: -length43.parse(parameters.w) / 2 - 0.5,
5777
- y: -length43.parse(parameters.h) / 2
5842
+ x: -length44.parse(parameters.w) / 2 - 0.5,
5843
+ y: -length44.parse(parameters.h) / 2
5778
5844
  },
5779
5845
  {
5780
- x: length43.parse(parameters.p) / 2,
5781
- y: -length43.parse(parameters.h) / 2
5846
+ x: length44.parse(parameters.p) / 2,
5847
+ y: -length44.parse(parameters.h) / 2
5782
5848
  }
5783
5849
  ],
5784
5850
  stroke_width: 0.1,
@@ -5820,22 +5886,22 @@ var smaWithoutParsing = (parameters) => {
5820
5886
  };
5821
5887
 
5822
5888
  // src/fn/smf.ts
5823
- import { z as z54 } from "zod";
5824
- import { length as length44 } from "circuit-json";
5889
+ import { z as z55 } from "zod";
5890
+ import { length as length45 } from "circuit-json";
5825
5891
  var smf_def = base_def.extend({
5826
- fn: z54.string(),
5827
- num_pins: z54.literal(2).default(2),
5828
- w: z54.string().default("4.80mm"),
5829
- h: z54.string().default("2.10mm"),
5830
- pl: z54.string().default("1.30mm"),
5831
- pw: z54.string().default("1.40mm"),
5832
- p: z54.string().default("2.9mm")
5892
+ fn: z55.string(),
5893
+ num_pins: z55.literal(2).default(2),
5894
+ w: z55.string().default("4.80mm"),
5895
+ h: z55.string().default("2.10mm"),
5896
+ pl: z55.string().default("1.30mm"),
5897
+ pw: z55.string().default("1.40mm"),
5898
+ p: z55.string().default("2.9mm")
5833
5899
  });
5834
5900
  var smf = (raw_params) => {
5835
5901
  const parameters = smf_def.parse(raw_params);
5836
5902
  const silkscreenRefText = silkscreenRef(
5837
5903
  0,
5838
- length44.parse(parameters.h) - 0.5,
5904
+ length45.parse(parameters.h) - 0.5,
5839
5905
  0.3
5840
5906
  );
5841
5907
  const silkscreenLine = {
@@ -5844,20 +5910,20 @@ var smf = (raw_params) => {
5844
5910
  pcb_component_id: "",
5845
5911
  route: [
5846
5912
  {
5847
- x: length44.parse(parameters.p) / 2,
5848
- y: length44.parse(parameters.h) / 2
5913
+ x: length45.parse(parameters.p) / 2,
5914
+ y: length45.parse(parameters.h) / 2
5849
5915
  },
5850
5916
  {
5851
- x: -length44.parse(parameters.w) / 2,
5852
- y: length44.parse(parameters.h) / 2
5917
+ x: -length45.parse(parameters.w) / 2,
5918
+ y: length45.parse(parameters.h) / 2
5853
5919
  },
5854
5920
  {
5855
- x: -length44.parse(parameters.w) / 2,
5856
- y: -length44.parse(parameters.h) / 2
5921
+ x: -length45.parse(parameters.w) / 2,
5922
+ y: -length45.parse(parameters.h) / 2
5857
5923
  },
5858
5924
  {
5859
- x: length44.parse(parameters.p) / 2,
5860
- y: -length44.parse(parameters.h) / 2
5925
+ x: length45.parse(parameters.p) / 2,
5926
+ y: -length45.parse(parameters.h) / 2
5861
5927
  }
5862
5928
  ],
5863
5929
  stroke_width: 0.1,
@@ -5900,22 +5966,22 @@ var smfWithoutParsing = (parameters) => {
5900
5966
  };
5901
5967
 
5902
5968
  // src/fn/smb.ts
5903
- import { z as z55 } from "zod";
5904
- import { length as length45 } from "circuit-json";
5969
+ import { z as z56 } from "zod";
5970
+ import { length as length46 } from "circuit-json";
5905
5971
  var smb_def = base_def.extend({
5906
- fn: z55.string(),
5907
- num_pins: z55.literal(2).default(2),
5908
- w: z55.string().default("7.30mm"),
5909
- h: z55.string().default("4.40mm"),
5910
- pl: z55.string().default("2.50mm"),
5911
- pw: z55.string().default("2.30mm"),
5912
- p: z55.string().default("4.30mm")
5972
+ fn: z56.string(),
5973
+ num_pins: z56.literal(2).default(2),
5974
+ w: z56.string().default("7.30mm"),
5975
+ h: z56.string().default("4.40mm"),
5976
+ pl: z56.string().default("2.50mm"),
5977
+ pw: z56.string().default("2.30mm"),
5978
+ p: z56.string().default("4.30mm")
5913
5979
  });
5914
5980
  var smb = (raw_params) => {
5915
5981
  const parameters = smb_def.parse(raw_params);
5916
5982
  const silkscreenRefText = silkscreenRef(
5917
5983
  0,
5918
- length45.parse(parameters.h) / 2 + 0.5,
5984
+ length46.parse(parameters.h) / 2 + 0.5,
5919
5985
  0.3
5920
5986
  );
5921
5987
  const silkscreenLine = {
@@ -5924,20 +5990,20 @@ var smb = (raw_params) => {
5924
5990
  pcb_component_id: "",
5925
5991
  route: [
5926
5992
  {
5927
- x: length45.parse(parameters.p) / 2,
5928
- y: length45.parse(parameters.h) / 2
5993
+ x: length46.parse(parameters.p) / 2,
5994
+ y: length46.parse(parameters.h) / 2
5929
5995
  },
5930
5996
  {
5931
- x: -length45.parse(parameters.w) / 2 - 0.1,
5932
- y: length45.parse(parameters.h) / 2
5997
+ x: -length46.parse(parameters.w) / 2 - 0.1,
5998
+ y: length46.parse(parameters.h) / 2
5933
5999
  },
5934
6000
  {
5935
- x: -length45.parse(parameters.w) / 2 - 0.1,
5936
- y: -length45.parse(parameters.h) / 2
6001
+ x: -length46.parse(parameters.w) / 2 - 0.1,
6002
+ y: -length46.parse(parameters.h) / 2
5937
6003
  },
5938
6004
  {
5939
- x: length45.parse(parameters.p) / 2,
5940
- y: -length45.parse(parameters.h) / 2
6005
+ x: length46.parse(parameters.p) / 2,
6006
+ y: -length46.parse(parameters.h) / 2
5941
6007
  }
5942
6008
  ],
5943
6009
  stroke_width: 0.1,
@@ -5980,16 +6046,16 @@ var smbWithoutParsing = (parameters) => {
5980
6046
  };
5981
6047
 
5982
6048
  // src/fn/smc.ts
5983
- import { z as z56 } from "zod";
5984
- import { length as length46 } from "circuit-json";
6049
+ import { z as z57 } from "zod";
6050
+ import { length as length47 } from "circuit-json";
5985
6051
  var smc_def = base_def.extend({
5986
- fn: z56.string(),
5987
- num_pins: z56.literal(2).default(2),
5988
- w: z56.string().default("10.70mm"),
5989
- h: z56.string().default("6.60mm"),
5990
- pl: z56.string().default("3.30mm"),
5991
- pw: z56.string().default("2.50mm"),
5992
- p: z56.string().default("6.80mm")
6052
+ fn: z57.string(),
6053
+ num_pins: z57.literal(2).default(2),
6054
+ w: z57.string().default("10.70mm"),
6055
+ h: z57.string().default("6.60mm"),
6056
+ pl: z57.string().default("3.30mm"),
6057
+ pw: z57.string().default("2.50mm"),
6058
+ p: z57.string().default("6.80mm")
5993
6059
  });
5994
6060
  var smc = (raw_params) => {
5995
6061
  const parameters = smc_def.parse(raw_params);
@@ -6000,20 +6066,20 @@ var smc = (raw_params) => {
6000
6066
  pcb_component_id: "",
6001
6067
  route: [
6002
6068
  {
6003
- x: length46.parse(parameters.p) / 2,
6004
- y: length46.parse(parameters.h) / 2 - 0.8
6069
+ x: length47.parse(parameters.p) / 2,
6070
+ y: length47.parse(parameters.h) / 2 - 0.8
6005
6071
  },
6006
6072
  {
6007
- x: -length46.parse(parameters.w) / 2 - 0.8,
6008
- y: length46.parse(parameters.h) / 2 - 0.8
6073
+ x: -length47.parse(parameters.w) / 2 - 0.8,
6074
+ y: length47.parse(parameters.h) / 2 - 0.8
6009
6075
  },
6010
6076
  {
6011
- x: -length46.parse(parameters.w) / 2 - 0.8,
6012
- y: -length46.parse(parameters.h) / 2 + 0.8
6077
+ x: -length47.parse(parameters.w) / 2 - 0.8,
6078
+ y: -length47.parse(parameters.h) / 2 + 0.8
6013
6079
  },
6014
6080
  {
6015
- x: length46.parse(parameters.p) / 2,
6016
- y: -length46.parse(parameters.h) / 2 + 0.8
6081
+ x: length47.parse(parameters.p) / 2,
6082
+ y: -length47.parse(parameters.h) / 2 + 0.8
6017
6083
  }
6018
6084
  ],
6019
6085
  stroke_width: 0.1,
@@ -6055,16 +6121,16 @@ var smcWithoutParsing = (parameters) => {
6055
6121
  };
6056
6122
 
6057
6123
  // src/fn/sot223.ts
6058
- import { z as z57 } from "zod";
6124
+ import { z as z58 } from "zod";
6059
6125
  var sot223_def = base_def.extend({
6060
- fn: z57.string(),
6061
- num_pins: z57.number().default(4),
6062
- w: z57.string().default("8.50mm"),
6063
- h: z57.string().default("6.90mm"),
6064
- pl: z57.string().default("2mm"),
6065
- pw: z57.string().default("1.5mm"),
6066
- p: z57.string().default("2.30mm"),
6067
- string: z57.string().optional()
6126
+ fn: z58.string(),
6127
+ num_pins: z58.number().default(4),
6128
+ w: z58.string().default("8.50mm"),
6129
+ h: z58.string().default("6.90mm"),
6130
+ pl: z58.string().default("2mm"),
6131
+ pw: z58.string().default("1.5mm"),
6132
+ p: z58.string().default("2.30mm"),
6133
+ string: z58.string().optional()
6068
6134
  });
6069
6135
  var sot223 = (raw_params) => {
6070
6136
  const match = raw_params.string?.match(/^sot223_(\d+)/);
@@ -6310,16 +6376,16 @@ var sot223_6 = (parameters) => {
6310
6376
  };
6311
6377
 
6312
6378
  // src/fn/sot23w.ts
6313
- import { z as z58 } from "zod";
6379
+ import { z as z59 } from "zod";
6314
6380
  var sot23w_def = base_def.extend({
6315
- fn: z58.string(),
6316
- num_pins: z58.number().default(3),
6317
- w: z58.string().default("3.40mm"),
6318
- h: z58.string().default("3.30mm"),
6319
- pl: z58.string().default("1mm"),
6320
- pw: z58.string().default("0.7mm"),
6321
- p: z58.string().default("1.2mm"),
6322
- string: z58.string().optional()
6381
+ fn: z59.string(),
6382
+ num_pins: z59.number().default(3),
6383
+ w: z59.string().default("3.40mm"),
6384
+ h: z59.string().default("3.30mm"),
6385
+ pl: z59.string().default("1mm"),
6386
+ pw: z59.string().default("0.7mm"),
6387
+ p: z59.string().default("1.2mm"),
6388
+ string: z59.string().optional()
6323
6389
  });
6324
6390
  var sot23w = (raw_params) => {
6325
6391
  const match = raw_params.string?.match(/^sot23w_(\d+)/);
@@ -6407,16 +6473,16 @@ var sot23w_3 = (parameters) => {
6407
6473
  };
6408
6474
 
6409
6475
  // src/fn/to92s.ts
6410
- import { z as z59 } from "zod";
6476
+ import { z as z60 } from "zod";
6411
6477
  var to92s_def = base_def.extend({
6412
- fn: z59.string(),
6413
- num_pins: z59.union([z59.literal(3), z59.literal(2)]).default(3),
6414
- p: z59.string().default("1.27mm"),
6415
- id: z59.string().default("0.72mm"),
6416
- od: z59.string().default("0.95mm"),
6417
- w: z59.string().default("2.5mm"),
6418
- h: z59.string().default("4.2mm"),
6419
- string: z59.string().optional()
6478
+ fn: z60.string(),
6479
+ num_pins: z60.union([z60.literal(3), z60.literal(2)]).default(3),
6480
+ p: z60.string().default("1.27mm"),
6481
+ id: z60.string().default("0.72mm"),
6482
+ od: z60.string().default("0.95mm"),
6483
+ w: z60.string().default("2.5mm"),
6484
+ h: z60.string().default("4.2mm"),
6485
+ string: z60.string().optional()
6420
6486
  });
6421
6487
  var to92s_3 = (parameters) => {
6422
6488
  const { p, id, od, w, h } = parameters;
@@ -6483,45 +6549,57 @@ var to92s = (raw_params) => {
6483
6549
 
6484
6550
  // src/fn/jst.ts
6485
6551
  import {
6486
- length as length47
6552
+ length as length48
6487
6553
  } from "circuit-json";
6488
- import { z as z60 } from "zod";
6554
+ import { z as z61 } from "zod";
6489
6555
  var jst_def = base_def.extend({
6490
- fn: z60.string(),
6491
- p: length47.optional(),
6492
- id: length47.optional(),
6493
- pw: length47.optional(),
6494
- pl: length47.optional(),
6495
- w: length47.optional(),
6496
- h: length47.optional(),
6497
- sh: z60.boolean().optional().describe(
6556
+ fn: z61.string(),
6557
+ p: length48.optional(),
6558
+ id: length48.optional(),
6559
+ pw: length48.optional(),
6560
+ pl: length48.optional(),
6561
+ w: length48.optional(),
6562
+ h: length48.optional(),
6563
+ sh: z61.boolean().optional().describe(
6498
6564
  'JST SH (Surface-mount) connector family. SH stands for "Super High-density".'
6499
6565
  ),
6500
- ph: z60.boolean().optional().describe(
6566
+ ph: z61.boolean().optional().describe(
6501
6567
  'JST PH (Through-hole) connector family. PH stands for "Pin Header".'
6502
6568
  ),
6503
- string: z60.string().optional()
6569
+ zh: z61.boolean().optional().describe(
6570
+ "JST ZH (Through-hole) connector family. 1.5mm pitch wire-to-board."
6571
+ ),
6572
+ string: z61.string().optional()
6504
6573
  });
6505
6574
  var variantDefaults = {
6506
6575
  ph: {
6507
- p: length47.parse("2.2mm"),
6508
- id: length47.parse("0.70mm"),
6509
- pw: length47.parse("1.20mm"),
6510
- pl: length47.parse("1.20mm"),
6511
- w: length47.parse("6mm"),
6512
- h: length47.parse("5mm")
6576
+ p: length48.parse("2.2mm"),
6577
+ id: length48.parse("0.70mm"),
6578
+ pw: length48.parse("1.20mm"),
6579
+ pl: length48.parse("1.20mm"),
6580
+ w: length48.parse("6mm"),
6581
+ h: length48.parse("5mm")
6513
6582
  },
6514
6583
  sh: {
6515
- p: length47.parse("1mm"),
6516
- pw: length47.parse("0.6mm"),
6517
- pl: length47.parse("1.55mm"),
6518
- w: length47.parse("5.8mm"),
6519
- h: length47.parse("7.8mm")
6584
+ p: length48.parse("1mm"),
6585
+ pw: length48.parse("0.6mm"),
6586
+ pl: length48.parse("1.55mm"),
6587
+ w: length48.parse("5.8mm"),
6588
+ h: length48.parse("7.8mm")
6589
+ },
6590
+ zh: {
6591
+ p: length48.parse("1.5mm"),
6592
+ id: length48.parse("0.73mm"),
6593
+ pw: length48.parse("1.03mm"),
6594
+ pl: length48.parse("1.73mm"),
6595
+ w: length48.parse("3mm"),
6596
+ h: length48.parse("3.5mm")
6520
6597
  }
6521
6598
  };
6522
6599
  function getVariant(params) {
6523
6600
  if (params.sh) return "sh";
6524
6601
  if (params.ph) return "ph";
6602
+ if (params.zh) return "zh";
6525
6603
  return "ph";
6526
6604
  }
6527
6605
  function generatePads(variant, numPins, p, id, pw, pl) {
@@ -6541,6 +6619,26 @@ function generatePads(variant, numPins, p, id, pw, pl) {
6541
6619
  })
6542
6620
  );
6543
6621
  }
6622
+ } else if (variant === "zh") {
6623
+ const startX = -((numPins - 1) / 2) * p;
6624
+ for (let i = 0; i < numPins; i++) {
6625
+ const x = startX + i * p;
6626
+ if (i === 0) {
6627
+ pads.push(
6628
+ platedHoleWithRectPad({
6629
+ pn: i + 1,
6630
+ x,
6631
+ y: 0,
6632
+ holeDiameter: id,
6633
+ rectPadWidth: pw,
6634
+ rectPadHeight: pl,
6635
+ rectBorderRadius: 0.12499977
6636
+ })
6637
+ );
6638
+ } else {
6639
+ pads.push(platedHolePill(i + 1, x, 0, id, pw, pl));
6640
+ }
6641
+ }
6544
6642
  } else {
6545
6643
  const startX = -((numPins - 1) / 2) * p;
6546
6644
  for (let i = 0; i < numPins; i++) {
@@ -6553,7 +6651,7 @@ function generatePads(variant, numPins, p, id, pw, pl) {
6553
6651
  }
6554
6652
  return pads;
6555
6653
  }
6556
- function generateSilkscreenBody(variant, w, h) {
6654
+ function generateSilkscreenBody(variant, w, h, numPins, p) {
6557
6655
  if (variant === "ph") {
6558
6656
  return {
6559
6657
  type: "pcb_silkscreen_path",
@@ -6569,6 +6667,26 @@ function generateSilkscreenBody(variant, w, h) {
6569
6667
  stroke_width: 0.1,
6570
6668
  pcb_silkscreen_path_id: ""
6571
6669
  };
6670
+ } else if (variant === "zh" && numPins && p) {
6671
+ const pinSpan = (numPins - 1) * p;
6672
+ const bodyLeft = -pinSpan / 2 - 1.5;
6673
+ const bodyRight = pinSpan / 2 + 1.5;
6674
+ const bodyTop = -h / 2;
6675
+ const bodyBottom = h / 2;
6676
+ return {
6677
+ type: "pcb_silkscreen_path",
6678
+ layer: "top",
6679
+ pcb_component_id: "",
6680
+ route: [
6681
+ { x: bodyLeft, y: bodyTop },
6682
+ { x: bodyRight, y: bodyTop },
6683
+ { x: bodyRight, y: bodyBottom },
6684
+ { x: bodyLeft, y: bodyBottom },
6685
+ { x: bodyLeft, y: bodyTop }
6686
+ ],
6687
+ stroke_width: 0.1,
6688
+ pcb_silkscreen_path_id: ""
6689
+ };
6572
6690
  } else {
6573
6691
  return {
6574
6692
  type: "pcb_silkscreen_path",
@@ -6597,8 +6715,15 @@ var jst = (raw_params) => {
6597
6715
  }
6598
6716
  const str = typeof raw_params.string === "string" ? raw_params.string : "";
6599
6717
  const match = str.match(/(?:^|_)jst(\d+)(?:_|$)/);
6718
+ const zhMatch = str.match(/(?:^|_)zh(\d+)(?:_|$)/);
6600
6719
  if (match && match[1]) {
6601
- const parsed = parseInt(match[1], 10);
6720
+ const parsed = Number.parseInt(match[1], 10);
6721
+ if (!Number.isNaN(parsed)) {
6722
+ numPins = parsed;
6723
+ }
6724
+ }
6725
+ if (zhMatch && zhMatch[1]) {
6726
+ const parsed = Number.parseInt(zhMatch[1], 10);
6602
6727
  if (!Number.isNaN(parsed)) {
6603
6728
  numPins = parsed;
6604
6729
  }
@@ -6609,7 +6734,7 @@ var jst = (raw_params) => {
6609
6734
  );
6610
6735
  }
6611
6736
  const pads = generatePads(variant, numPins, p, id, pw, pl);
6612
- const silkscreenBody = generateSilkscreenBody(variant, w, h);
6737
+ const silkscreenBody = generateSilkscreenBody(variant, w, h, numPins, p);
6613
6738
  const silkscreenRefText = silkscreenRef(0, h / 2 + 1, 0.5);
6614
6739
  return {
6615
6740
  circuitJson: [...pads, silkscreenBody, silkscreenRefText],
@@ -6623,28 +6748,29 @@ var jst = (raw_params) => {
6623
6748
  h,
6624
6749
  num_pins: numPins,
6625
6750
  sh: variant === "sh",
6626
- ph: variant === "ph"
6751
+ ph: variant === "ph",
6752
+ zh: variant === "zh"
6627
6753
  }
6628
6754
  };
6629
6755
  };
6630
6756
 
6631
6757
  // src/fn/sod110.ts
6632
- import { z as z61 } from "zod";
6633
- import { length as length48 } from "circuit-json";
6758
+ import { z as z62 } from "zod";
6759
+ import { length as length49 } from "circuit-json";
6634
6760
  var sod_def12 = base_def.extend({
6635
- fn: z61.string(),
6636
- num_pins: z61.literal(2).default(2),
6637
- w: z61.string().default("3.30mm"),
6638
- h: z61.string().default("1.70mm"),
6639
- pl: z61.string().default("0.80mm"),
6640
- pw: z61.string().default("1mm"),
6641
- p: z61.string().default("1.90mm")
6761
+ fn: z62.string(),
6762
+ num_pins: z62.literal(2).default(2),
6763
+ w: z62.string().default("3.30mm"),
6764
+ h: z62.string().default("1.70mm"),
6765
+ pl: z62.string().default("0.80mm"),
6766
+ pw: z62.string().default("1mm"),
6767
+ p: z62.string().default("1.90mm")
6642
6768
  });
6643
6769
  var sod110 = (raw_params) => {
6644
6770
  const parameters = sod_def12.parse(raw_params);
6645
6771
  const silkscreenRefText = silkscreenRef(
6646
6772
  0,
6647
- length48.parse(parameters.h) / 2 + 0.5,
6773
+ length49.parse(parameters.h) / 2 + 0.5,
6648
6774
  0.3
6649
6775
  );
6650
6776
  const silkscreenLine = {
@@ -6653,20 +6779,20 @@ var sod110 = (raw_params) => {
6653
6779
  pcb_component_id: "",
6654
6780
  route: [
6655
6781
  {
6656
- x: length48.parse(parameters.p) / 2,
6657
- y: length48.parse(parameters.h) / 2
6782
+ x: length49.parse(parameters.p) / 2,
6783
+ y: length49.parse(parameters.h) / 2
6658
6784
  },
6659
6785
  {
6660
- x: -length48.parse(parameters.w) / 2,
6661
- y: length48.parse(parameters.h) / 2
6786
+ x: -length49.parse(parameters.w) / 2,
6787
+ y: length49.parse(parameters.h) / 2
6662
6788
  },
6663
6789
  {
6664
- x: -length48.parse(parameters.w) / 2,
6665
- y: -length48.parse(parameters.h) / 2
6790
+ x: -length49.parse(parameters.w) / 2,
6791
+ y: -length49.parse(parameters.h) / 2
6666
6792
  },
6667
6793
  {
6668
- x: length48.parse(parameters.p) / 2,
6669
- y: -length48.parse(parameters.h) / 2
6794
+ x: length49.parse(parameters.p) / 2,
6795
+ y: -length49.parse(parameters.h) / 2
6670
6796
  }
6671
6797
  ],
6672
6798
  stroke_width: 0.1,
@@ -6708,8 +6834,8 @@ var sodWithoutParsing13 = (parameters) => {
6708
6834
  };
6709
6835
 
6710
6836
  // src/fn/vssop.ts
6711
- import { z as z62 } from "zod";
6712
- import { length as length49 } from "circuit-json";
6837
+ import { z as z63 } from "zod";
6838
+ import { length as length50 } from "circuit-json";
6713
6839
  var getDefaultValues = (num_pins) => {
6714
6840
  switch (num_pins) {
6715
6841
  case 8:
@@ -6739,23 +6865,23 @@ var getDefaultValues = (num_pins) => {
6739
6865
  }
6740
6866
  };
6741
6867
  var vssop_def = base_def.extend({
6742
- fn: z62.string(),
6743
- num_pins: z62.union([z62.literal(8), z62.literal(10)]).default(8),
6744
- w: z62.string().optional(),
6745
- h: z62.string().optional(),
6746
- p: z62.string().optional(),
6747
- pl: z62.string().optional(),
6748
- pw: z62.string().optional(),
6749
- string: z62.string().optional()
6868
+ fn: z63.string(),
6869
+ num_pins: z63.union([z63.literal(8), z63.literal(10)]).default(8),
6870
+ w: z63.string().optional(),
6871
+ h: z63.string().optional(),
6872
+ p: z63.string().optional(),
6873
+ pl: z63.string().optional(),
6874
+ pw: z63.string().optional(),
6875
+ string: z63.string().optional()
6750
6876
  });
6751
6877
  var vssop = (raw_params) => {
6752
6878
  const parameters = vssop_def.parse(raw_params);
6753
6879
  const defaults = getDefaultValues(parameters.num_pins);
6754
- const w = length49.parse(parameters.w || defaults.w);
6755
- const h = length49.parse(parameters.h || defaults.h);
6756
- const p = length49.parse(parameters.p || defaults.p);
6757
- const pl = length49.parse(parameters.pl || defaults.pl);
6758
- const pw = length49.parse(parameters.pw || defaults.pw);
6880
+ const w = length50.parse(parameters.w || defaults.w);
6881
+ const h = length50.parse(parameters.h || defaults.h);
6882
+ const p = length50.parse(parameters.p || defaults.p);
6883
+ const pl = length50.parse(parameters.pl || defaults.pl);
6884
+ const pw = length50.parse(parameters.pw || defaults.pw);
6759
6885
  const pads = [];
6760
6886
  const half = parameters.num_pins / 2;
6761
6887
  for (let i = 0; i < parameters.num_pins; i++) {
@@ -6832,14 +6958,14 @@ var getVssopPadCoord = (pinCount, pn, w, p) => {
6832
6958
  const col = pn <= half ? -1 : 1;
6833
6959
  const row = (half - 1) / 2 - rowIndex;
6834
6960
  return {
6835
- x: col * length49.parse(pinCount === 8 ? "1.8mm" : "2.2mm"),
6961
+ x: col * length50.parse(pinCount === 8 ? "1.8mm" : "2.2mm"),
6836
6962
  y: row * p
6837
6963
  };
6838
6964
  };
6839
6965
 
6840
6966
  // src/fn/msop.ts
6841
- import { z as z63 } from "zod";
6842
- import { length as length50 } from "circuit-json";
6967
+ import { z as z64 } from "zod";
6968
+ import { length as length51 } from "circuit-json";
6843
6969
  var getDefaultValues2 = (num_pins) => {
6844
6970
  switch (num_pins) {
6845
6971
  case 10:
@@ -6877,14 +7003,14 @@ var getDefaultValues2 = (num_pins) => {
6877
7003
  }
6878
7004
  };
6879
7005
  var msop_def = base_def.extend({
6880
- fn: z63.string(),
6881
- num_pins: z63.union([z63.literal(8), z63.literal(10), z63.literal(12), z63.literal(16)]).default(8),
6882
- w: z63.string().optional(),
6883
- h: z63.string().optional(),
6884
- p: z63.string().optional(),
6885
- pl: z63.string().optional(),
6886
- pw: z63.string().optional(),
6887
- string: z63.string().optional()
7006
+ fn: z64.string(),
7007
+ num_pins: z64.union([z64.literal(8), z64.literal(10), z64.literal(12), z64.literal(16)]).default(8),
7008
+ w: z64.string().optional(),
7009
+ h: z64.string().optional(),
7010
+ p: z64.string().optional(),
7011
+ pl: z64.string().optional(),
7012
+ pw: z64.string().optional(),
7013
+ string: z64.string().optional()
6888
7014
  });
6889
7015
  var getMsopCoords = (pinCount, pn, w, p) => {
6890
7016
  const half = pinCount / 2;
@@ -6892,18 +7018,18 @@ var getMsopCoords = (pinCount, pn, w, p) => {
6892
7018
  const col = pn <= half ? -1 : 1;
6893
7019
  const row = (half - 1) / 2 - rowIndex;
6894
7020
  return {
6895
- x: col * length50.parse("2mm"),
7021
+ x: col * length51.parse("2mm"),
6896
7022
  y: row * p
6897
7023
  };
6898
7024
  };
6899
7025
  var msop = (raw_params) => {
6900
7026
  const parameters = msop_def.parse(raw_params);
6901
7027
  const defaults = getDefaultValues2(parameters.num_pins);
6902
- const w = length50.parse(parameters.w || defaults.w);
6903
- const h = length50.parse(parameters.h || defaults.h);
6904
- const p = length50.parse(parameters.p || defaults.p);
6905
- const pl = length50.parse(parameters.pl || defaults.pl);
6906
- const pw = length50.parse(parameters.pw || defaults.pw);
7028
+ const w = length51.parse(parameters.w || defaults.w);
7029
+ const h = length51.parse(parameters.h || defaults.h);
7030
+ const p = length51.parse(parameters.p || defaults.p);
7031
+ const pl = length51.parse(parameters.pl || defaults.pl);
7032
+ const pw = length51.parse(parameters.pw || defaults.pw);
6907
7033
  const pads = [];
6908
7034
  for (let i = 0; i < parameters.num_pins; i++) {
6909
7035
  const { x, y } = getMsopCoords(parameters.num_pins, i + 1, w, p);
@@ -6974,22 +7100,22 @@ var msop = (raw_params) => {
6974
7100
  };
6975
7101
 
6976
7102
  // src/fn/sod323w.ts
6977
- import { z as z64 } from "zod";
6978
- import { length as length51 } from "circuit-json";
7103
+ import { z as z65 } from "zod";
7104
+ import { length as length52 } from "circuit-json";
6979
7105
  var sod323w_def = base_def.extend({
6980
- fn: z64.string(),
6981
- num_pins: z64.literal(2).default(2),
6982
- w: z64.string().default("3.8mm"),
6983
- h: z64.string().default("1.65mm"),
6984
- pl: z64.string().default("1.2mm"),
6985
- pw: z64.string().default("1.2mm"),
6986
- pad_spacing: z64.string().default("2.6mm")
7106
+ fn: z65.string(),
7107
+ num_pins: z65.literal(2).default(2),
7108
+ w: z65.string().default("3.8mm"),
7109
+ h: z65.string().default("1.65mm"),
7110
+ pl: z65.string().default("1.2mm"),
7111
+ pw: z65.string().default("1.2mm"),
7112
+ pad_spacing: z65.string().default("2.6mm")
6987
7113
  });
6988
7114
  var sod323w = (raw_params) => {
6989
7115
  const parameters = sod323w_def.parse(raw_params);
6990
7116
  const silkscreenRefText = silkscreenRef(
6991
7117
  0,
6992
- length51.parse(parameters.h),
7118
+ length52.parse(parameters.h),
6993
7119
  0.3
6994
7120
  );
6995
7121
  const silkscreenLine = {
@@ -6998,20 +7124,20 @@ var sod323w = (raw_params) => {
6998
7124
  pcb_component_id: "",
6999
7125
  route: [
7000
7126
  {
7001
- x: length51.parse(parameters.pad_spacing) / 2,
7002
- y: length51.parse(parameters.h) / 2
7127
+ x: length52.parse(parameters.pad_spacing) / 2,
7128
+ y: length52.parse(parameters.h) / 2
7003
7129
  },
7004
7130
  {
7005
- x: -length51.parse(parameters.w) / 2 - 0.2,
7006
- y: length51.parse(parameters.h) / 2
7131
+ x: -length52.parse(parameters.w) / 2 - 0.2,
7132
+ y: length52.parse(parameters.h) / 2
7007
7133
  },
7008
7134
  {
7009
- x: -length51.parse(parameters.w) / 2 - 0.2,
7010
- y: -length51.parse(parameters.h) / 2
7135
+ x: -length52.parse(parameters.w) / 2 - 0.2,
7136
+ y: -length52.parse(parameters.h) / 2
7011
7137
  },
7012
7138
  {
7013
- x: length51.parse(parameters.pad_spacing) / 2,
7014
- y: -length51.parse(parameters.h) / 2
7139
+ x: length52.parse(parameters.pad_spacing) / 2,
7140
+ y: -length52.parse(parameters.h) / 2
7015
7141
  }
7016
7142
  ],
7017
7143
  stroke_width: 0.1,
@@ -7054,22 +7180,22 @@ var sodWithoutParsing14 = (parameters) => {
7054
7180
  };
7055
7181
 
7056
7182
  // src/fn/sod323fl.ts
7057
- import { z as z65 } from "zod";
7058
- import { length as length52 } from "circuit-json";
7183
+ import { z as z66 } from "zod";
7184
+ import { length as length53 } from "circuit-json";
7059
7185
  var sod323FL_def = base_def.extend({
7060
- fn: z65.string(),
7061
- num_pins: z65.literal(2).default(2),
7062
- w: z65.string().default("3.20mm"),
7063
- h: z65.string().default("1.65mm"),
7064
- pl: z65.string().default("0.8mm"),
7065
- pw: z65.string().default("0.9mm"),
7066
- pad_spacing: z65.string().default("2.1mm")
7186
+ fn: z66.string(),
7187
+ num_pins: z66.literal(2).default(2),
7188
+ w: z66.string().default("3.20mm"),
7189
+ h: z66.string().default("1.65mm"),
7190
+ pl: z66.string().default("0.8mm"),
7191
+ pw: z66.string().default("0.9mm"),
7192
+ pad_spacing: z66.string().default("2.1mm")
7067
7193
  });
7068
7194
  var sod323fl = (raw_params) => {
7069
7195
  const parameters = sod323FL_def.parse(raw_params);
7070
7196
  const silkscreenRefText = silkscreenRef(
7071
7197
  0,
7072
- length52.parse(parameters.h),
7198
+ length53.parse(parameters.h),
7073
7199
  0.3
7074
7200
  );
7075
7201
  const silkscreenLine = {
@@ -7078,20 +7204,20 @@ var sod323fl = (raw_params) => {
7078
7204
  pcb_component_id: "",
7079
7205
  route: [
7080
7206
  {
7081
- x: length52.parse(parameters.pad_spacing) / 2,
7082
- y: length52.parse(parameters.h) / 2
7207
+ x: length53.parse(parameters.pad_spacing) / 2,
7208
+ y: length53.parse(parameters.h) / 2
7083
7209
  },
7084
7210
  {
7085
- x: -length52.parse(parameters.w) / 2 - 0.2,
7086
- y: length52.parse(parameters.h) / 2
7211
+ x: -length53.parse(parameters.w) / 2 - 0.2,
7212
+ y: length53.parse(parameters.h) / 2
7087
7213
  },
7088
7214
  {
7089
- x: -length52.parse(parameters.w) / 2 - 0.2,
7090
- y: -length52.parse(parameters.h) / 2
7215
+ x: -length53.parse(parameters.w) / 2 - 0.2,
7216
+ y: -length53.parse(parameters.h) / 2
7091
7217
  },
7092
7218
  {
7093
- x: length52.parse(parameters.pad_spacing) / 2,
7094
- y: -length52.parse(parameters.h) / 2
7219
+ x: length53.parse(parameters.pad_spacing) / 2,
7220
+ y: -length53.parse(parameters.h) / 2
7095
7221
  }
7096
7222
  ],
7097
7223
  stroke_width: 0.1,
@@ -7134,20 +7260,20 @@ var sodWithoutParsing15 = (parameters) => {
7134
7260
  };
7135
7261
 
7136
7262
  // src/fn/son.ts
7137
- import { z as z66 } from "zod";
7138
- import { length as length53 } from "circuit-json";
7263
+ import { z as z67 } from "zod";
7264
+ import { length as length54 } from "circuit-json";
7139
7265
  var son_def = base_def.extend({
7140
- fn: z66.string(),
7141
- num_pins: z66.union([z66.literal(6), z66.literal(8)]).default(8),
7142
- w: z66.string().default("3mm"),
7143
- h: z66.string().default("3mm"),
7144
- p: z66.string().default("0.5mm"),
7145
- pl: z66.string().default("0.52mm"),
7146
- pw: z66.string().default("0.35mm"),
7147
- epw: z66.string().default("1.40mm"),
7148
- eph: z66.string().default("1.60mm"),
7149
- string: z66.string().optional(),
7150
- ep: z66.boolean().default(false)
7266
+ fn: z67.string(),
7267
+ num_pins: z67.union([z67.literal(6), z67.literal(8)]).default(8),
7268
+ w: z67.string().default("3mm"),
7269
+ h: z67.string().default("3mm"),
7270
+ p: z67.string().default("0.5mm"),
7271
+ pl: z67.string().default("0.52mm"),
7272
+ pw: z67.string().default("0.35mm"),
7273
+ epw: z67.string().default("1.40mm"),
7274
+ eph: z67.string().default("1.60mm"),
7275
+ string: z67.string().optional(),
7276
+ ep: z67.boolean().default(false)
7151
7277
  });
7152
7278
  var son = (raw_params) => {
7153
7279
  if (raw_params.string && raw_params.string.includes("_ep")) {
@@ -7159,13 +7285,13 @@ var son = (raw_params) => {
7159
7285
  ...raw_params,
7160
7286
  num_pins: numPins
7161
7287
  });
7162
- const w = length53.parse(parameters.w);
7163
- const h = length53.parse(parameters.h);
7164
- const p = length53.parse(parameters.p);
7165
- const pl = length53.parse(parameters.pl);
7166
- const pw = length53.parse(parameters.pw);
7167
- const epw = length53.parse(parameters.epw);
7168
- const eph = length53.parse(parameters.eph);
7288
+ const w = length54.parse(parameters.w);
7289
+ const h = length54.parse(parameters.h);
7290
+ const p = length54.parse(parameters.p);
7291
+ const pl = length54.parse(parameters.pl);
7292
+ const pw = length54.parse(parameters.pw);
7293
+ const epw = length54.parse(parameters.epw);
7294
+ const eph = length54.parse(parameters.eph);
7169
7295
  const pads = [];
7170
7296
  for (let i = 0; i < parameters.num_pins; i++) {
7171
7297
  const { x, y } = getSonPadCoord(parameters.num_pins, i + 1, w, p);
@@ -7243,24 +7369,24 @@ var getSonPadCoord = (num_pins, pn, w, p) => {
7243
7369
  const col = pn <= half ? -1 : 1;
7244
7370
  const row = (half - 1) / 2 - rowIndex;
7245
7371
  return {
7246
- x: col * length53.parse("1.4mm"),
7372
+ x: col * length54.parse("1.4mm"),
7247
7373
  y: row * p
7248
7374
  };
7249
7375
  };
7250
7376
 
7251
7377
  // src/fn/vson.ts
7252
- import { z as z67 } from "zod";
7253
- import { length as length54, distance as distance3 } from "circuit-json";
7378
+ import { z as z68 } from "zod";
7379
+ import { length as length55, distance as distance3 } from "circuit-json";
7254
7380
  var vson_def = base_def.extend({
7255
- fn: z67.string(),
7256
- num_pins: z67.number().optional().default(8),
7381
+ fn: z68.string(),
7382
+ num_pins: z68.number().optional().default(8),
7257
7383
  p: distance3.describe("pitch (distance between center of each pin)"),
7258
- w: length54.describe("width between vertical rows of pins"),
7384
+ w: length55.describe("width between vertical rows of pins"),
7259
7385
  grid: dim2d.describe("width and height of the border of the footprint"),
7260
7386
  ep: dim2d.default("0x0mm").describe("width and height of the central exposed thermal pad"),
7261
- epx: length54.default("0mm").describe("x offset of the center of the central exposed thermal pad"),
7262
- pinw: length54.describe("width of the pin pads"),
7263
- pinh: length54.describe("height of the pin pads")
7387
+ epx: length55.default("0mm").describe("x offset of the center of the central exposed thermal pad"),
7388
+ pinw: length55.describe("width of the pin pads"),
7389
+ pinh: length55.describe("height of the pin pads")
7264
7390
  });
7265
7391
  var vson = (raw_params) => {
7266
7392
  const parameters = vson_def.parse(raw_params);
@@ -7367,12 +7493,12 @@ var getSilkscreenPaths = (grid) => {
7367
7493
  };
7368
7494
 
7369
7495
  // src/fn/solderjumper.ts
7370
- import { length as length55 } from "circuit-json";
7496
+ import { length as length56 } from "circuit-json";
7371
7497
  var solderjumper = (params) => {
7372
7498
  const { num_pins, bridged, p = 2.54, pw = 1.5, ph = 1.5 } = params;
7373
- const padSpacing7 = length55.parse(p);
7374
- const padWidth = length55.parse(pw);
7375
- const padHeight = length55.parse(ph);
7499
+ const padSpacing7 = length56.parse(p);
7500
+ const padWidth = length56.parse(pw);
7501
+ const padHeight = length56.parse(ph);
7376
7502
  const traceWidth = Math.min(padHeight / 4, 0.5);
7377
7503
  const pads = [];
7378
7504
  for (let i = 0; i < num_pins; i++) {
@@ -7460,34 +7586,34 @@ var solderjumper = (params) => {
7460
7586
  };
7461
7587
 
7462
7588
  // src/fn/sot457.ts
7463
- import { z as z68 } from "zod";
7589
+ import { z as z69 } from "zod";
7464
7590
  var commonSchema = {
7465
- fn: z68.literal("sot457"),
7466
- num_pins: z68.literal(6).default(6),
7467
- pillh: z68.string().default("0.45mm"),
7468
- pillw: z68.string().default("1.45mm"),
7469
- pl: z68.string(),
7470
- pw: z68.string(),
7471
- p: z68.string(),
7472
- wave: z68.boolean().optional(),
7473
- reflow: z68.boolean().optional()
7591
+ fn: z69.literal("sot457"),
7592
+ num_pins: z69.literal(6).default(6),
7593
+ pillh: z69.string().default("0.45mm"),
7594
+ pillw: z69.string().default("1.45mm"),
7595
+ pl: z69.string(),
7596
+ pw: z69.string(),
7597
+ p: z69.string(),
7598
+ wave: z69.boolean().optional(),
7599
+ reflow: z69.boolean().optional()
7474
7600
  };
7475
7601
  var sot457DefSchema = base_def.extend({
7476
7602
  ...commonSchema,
7477
- h: z68.string().default("2.5mm"),
7478
- w: z68.string().default("2.7mm"),
7479
- pl: z68.string().default("0.8mm"),
7480
- pw: z68.string().default("0.55mm"),
7481
- p: z68.string().default("0.95mm")
7603
+ h: z69.string().default("2.5mm"),
7604
+ w: z69.string().default("2.7mm"),
7605
+ pl: z69.string().default("0.8mm"),
7606
+ pw: z69.string().default("0.55mm"),
7607
+ p: z69.string().default("0.95mm")
7482
7608
  });
7483
7609
  var sot457WaveSchema = base_def.extend({
7484
7610
  ...commonSchema,
7485
- h: z68.string().default("3mm"),
7486
- w: z68.string().default("4mm"),
7487
- pillr: z68.string().default("0.225mm"),
7488
- pl: z68.string().default("1.45mm"),
7489
- pw: z68.string().default("1.5mm"),
7490
- p: z68.string().default("1.475mm")
7611
+ h: z69.string().default("3mm"),
7612
+ w: z69.string().default("4mm"),
7613
+ pillr: z69.string().default("0.225mm"),
7614
+ pl: z69.string().default("1.45mm"),
7615
+ pw: z69.string().default("1.5mm"),
7616
+ p: z69.string().default("1.475mm")
7491
7617
  }).transform((data) => ({
7492
7618
  ...data,
7493
7619
  wave: data.wave ?? (data.reflow === void 0 ? true : !data.reflow),
@@ -7626,25 +7752,25 @@ var sot457 = (rawParams) => {
7626
7752
  };
7627
7753
 
7628
7754
  // src/fn/sot963.ts
7629
- import { z as z69 } from "zod";
7630
- import { length as length56 } from "circuit-json";
7755
+ import { z as z70 } from "zod";
7756
+ import { length as length57 } from "circuit-json";
7631
7757
  var sot963_def = base_def.extend({
7632
- fn: z69.string(),
7633
- num_pins: z69.literal(6).default(6),
7634
- w: z69.string().default("1.1mm"),
7635
- h: z69.string().default("1.45mm"),
7636
- p: z69.string().default("0.35mm"),
7637
- pl: z69.string().default("0.2mm"),
7638
- pw: z69.string().default("0.2mm"),
7639
- string: z69.string().optional()
7758
+ fn: z70.string(),
7759
+ num_pins: z70.literal(6).default(6),
7760
+ w: z70.string().default("1.1mm"),
7761
+ h: z70.string().default("1.45mm"),
7762
+ p: z70.string().default("0.35mm"),
7763
+ pl: z70.string().default("0.2mm"),
7764
+ pw: z70.string().default("0.2mm"),
7765
+ string: z70.string().optional()
7640
7766
  });
7641
7767
  var sot963 = (raw_params) => {
7642
7768
  const parameters = sot963_def.parse({ ...raw_params, fn: "sot963" });
7643
- const w = length56.parse(parameters.w);
7644
- const h = length56.parse(parameters.h);
7645
- const p = length56.parse(parameters.p);
7646
- const pl = length56.parse(parameters.pl);
7647
- const pw = length56.parse(parameters.pw);
7769
+ const w = length57.parse(parameters.w);
7770
+ const h = length57.parse(parameters.h);
7771
+ const p = length57.parse(parameters.p);
7772
+ const pl = length57.parse(parameters.pl);
7773
+ const pw = length57.parse(parameters.pw);
7648
7774
  const pads = [];
7649
7775
  for (let i = 0; i < 6; i++) {
7650
7776
  const { x, y } = getSot963PadCoord(i + 1, w, p, pl);
@@ -7707,19 +7833,19 @@ var getSot963PadCoord = (pn, w, p, pl) => {
7707
7833
  };
7708
7834
 
7709
7835
  // src/fn/potentiometer.ts
7710
- import { z as z70 } from "zod";
7836
+ import { z as z71 } from "zod";
7711
7837
  var potentiometer_def = base_def.extend({
7712
- fn: z70.string(),
7713
- num_pins: z70.union([z70.literal(3), z70.literal(2)]).default(3),
7714
- p: z70.string().default("3.8mm"),
7715
- id: z70.string().default("1.25mm"),
7716
- od: z70.string().default("2.35mm"),
7717
- ca: z70.string().default("14mm").describe(
7838
+ fn: z71.string(),
7839
+ num_pins: z71.union([z71.literal(3), z71.literal(2)]).default(3),
7840
+ p: z71.string().default("3.8mm"),
7841
+ id: z71.string().default("1.25mm"),
7842
+ od: z71.string().default("2.35mm"),
7843
+ ca: z71.string().default("14mm").describe(
7718
7844
  "Caliper axis (width or diameter of the potentiometer body or adjustment knob)"
7719
7845
  ),
7720
- w: z70.string().default("5.35mm"),
7721
- h: z70.string().default("4mm"),
7722
- string: z70.string().optional()
7846
+ w: z71.string().default("5.35mm"),
7847
+ h: z71.string().default("4mm"),
7848
+ string: z71.string().optional()
7723
7849
  });
7724
7850
  var potentiometer_acp = (parameters) => {
7725
7851
  const { p, id, od, h, ca } = parameters;
@@ -7786,15 +7912,15 @@ var potentiometer = (raw_params) => {
7786
7912
 
7787
7913
  // src/fn/electrolytic.ts
7788
7914
  import {
7789
- length as length57
7915
+ length as length58
7790
7916
  } from "circuit-json";
7791
- import { z as z71 } from "zod";
7917
+ import { z as z72 } from "zod";
7792
7918
  var electrolytic_def = base_def.extend({
7793
- fn: z71.string(),
7794
- p: length57.optional().default("7.5mm"),
7795
- id: length57.optional().default("1mm"),
7796
- od: length57.optional().default("2mm"),
7797
- d: length57.optional().default("10.5mm")
7919
+ fn: z72.string(),
7920
+ p: length58.optional().default("7.5mm"),
7921
+ id: length58.optional().default("1mm"),
7922
+ od: length58.optional().default("2mm"),
7923
+ d: length58.optional().default("10.5mm")
7798
7924
  });
7799
7925
  var generate_circle_arcs = (centerX, centerY, radius, cut, cutHeight) => {
7800
7926
  const topArc = [];
@@ -7901,22 +8027,22 @@ var electrolytic = (raw_params) => {
7901
8027
  };
7902
8028
 
7903
8029
  // src/fn/smbf.ts
7904
- import { z as z72 } from "zod";
7905
- import { length as length58 } from "circuit-json";
8030
+ import { z as z73 } from "zod";
8031
+ import { length as length59 } from "circuit-json";
7906
8032
  var smbf_def = base_def.extend({
7907
- fn: z72.string(),
7908
- num_pins: z72.literal(2).default(2),
7909
- w: z72.string().default("6.5mm"),
7910
- h: z72.string().default("3mm"),
7911
- pl: z72.string().default("1.75mm"),
7912
- pw: z72.string().default("2.40mm"),
7913
- p: z72.string().default("4.75mm")
8033
+ fn: z73.string(),
8034
+ num_pins: z73.literal(2).default(2),
8035
+ w: z73.string().default("6.5mm"),
8036
+ h: z73.string().default("3mm"),
8037
+ pl: z73.string().default("1.75mm"),
8038
+ pw: z73.string().default("2.40mm"),
8039
+ p: z73.string().default("4.75mm")
7914
8040
  });
7915
8041
  var smbf = (raw_params) => {
7916
8042
  const parameters = smbf_def.parse(raw_params);
7917
8043
  const silkscreenRefText = silkscreenRef(
7918
8044
  0,
7919
- length58.parse(parameters.h) - 0.5,
8045
+ length59.parse(parameters.h) - 0.5,
7920
8046
  0.3
7921
8047
  );
7922
8048
  const silkscreenLine = {
@@ -7925,20 +8051,20 @@ var smbf = (raw_params) => {
7925
8051
  pcb_component_id: "",
7926
8052
  route: [
7927
8053
  {
7928
- x: length58.parse(parameters.p) / 2,
7929
- y: length58.parse(parameters.h) / 2
8054
+ x: length59.parse(parameters.p) / 2,
8055
+ y: length59.parse(parameters.h) / 2
7930
8056
  },
7931
8057
  {
7932
- x: -length58.parse(parameters.w) / 2 - 0.3,
7933
- y: length58.parse(parameters.h) / 2
8058
+ x: -length59.parse(parameters.w) / 2 - 0.3,
8059
+ y: length59.parse(parameters.h) / 2
7934
8060
  },
7935
8061
  {
7936
- x: -length58.parse(parameters.w) / 2 - 0.3,
7937
- y: -length58.parse(parameters.h) / 2
8062
+ x: -length59.parse(parameters.w) / 2 - 0.3,
8063
+ y: -length59.parse(parameters.h) / 2
7938
8064
  },
7939
8065
  {
7940
- x: length58.parse(parameters.p) / 2,
7941
- y: -length58.parse(parameters.h) / 2
8066
+ x: length59.parse(parameters.p) / 2,
8067
+ y: -length59.parse(parameters.h) / 2
7942
8068
  }
7943
8069
  ],
7944
8070
  stroke_width: 0.1,
@@ -7980,16 +8106,16 @@ var smbfWithoutParsing = (parameters) => {
7980
8106
  };
7981
8107
 
7982
8108
  // src/fn/sot323.ts
7983
- import { z as z73 } from "zod";
8109
+ import { z as z74 } from "zod";
7984
8110
  var sot323_def = base_def.extend({
7985
- fn: z73.string(),
7986
- num_pins: z73.number().default(3),
7987
- w: z73.string().default("2.45mm"),
7988
- h: z73.string().default("2.40mm"),
7989
- pl: z73.string().default("0.92mm"),
7990
- pw: z73.string().default("0.45mm"),
7991
- p: z73.string().default("0.891mm"),
7992
- string: z73.string().optional()
8111
+ fn: z74.string(),
8112
+ num_pins: z74.number().default(3),
8113
+ w: z74.string().default("2.45mm"),
8114
+ h: z74.string().default("2.40mm"),
8115
+ pl: z74.string().default("0.92mm"),
8116
+ pw: z74.string().default("0.45mm"),
8117
+ p: z74.string().default("0.891mm"),
8118
+ string: z74.string().optional()
7993
8119
  });
7994
8120
  var sot323 = (raw_params) => {
7995
8121
  const match = raw_params.string?.match(/^sot323_(\d+)/);
@@ -8077,30 +8203,30 @@ var sot323_3 = (parameters) => {
8077
8203
  };
8078
8204
 
8079
8205
  // src/fn/smtpad.ts
8080
- import { z as z74 } from "zod";
8081
- import { length as length59 } from "circuit-json";
8082
- import { mm as mm14 } from "@tscircuit/mm";
8206
+ import { z as z75 } from "zod";
8207
+ import { length as length60 } from "circuit-json";
8208
+ import { mm as mm15 } from "@tscircuit/mm";
8083
8209
  var smtpad_def = base_def.extend({
8084
- fn: z74.string(),
8085
- circle: z74.boolean().optional(),
8086
- rect: z74.boolean().optional(),
8087
- square: z74.boolean().optional(),
8088
- pill: z74.boolean().optional(),
8089
- d: length59.optional(),
8090
- pd: length59.optional(),
8091
- diameter: length59.optional(),
8092
- r: length59.optional(),
8093
- pr: length59.optional(),
8094
- radius: length59.optional(),
8095
- w: length59.optional(),
8096
- pw: length59.optional(),
8097
- width: length59.optional(),
8098
- h: length59.optional(),
8099
- ph: length59.optional(),
8100
- height: length59.optional(),
8101
- s: length59.optional(),
8102
- size: length59.optional(),
8103
- string: z74.string().optional()
8210
+ fn: z75.string(),
8211
+ circle: z75.boolean().optional(),
8212
+ rect: z75.boolean().optional(),
8213
+ square: z75.boolean().optional(),
8214
+ pill: z75.boolean().optional(),
8215
+ d: length60.optional(),
8216
+ pd: length60.optional(),
8217
+ diameter: length60.optional(),
8218
+ r: length60.optional(),
8219
+ pr: length60.optional(),
8220
+ radius: length60.optional(),
8221
+ w: length60.optional(),
8222
+ pw: length60.optional(),
8223
+ width: length60.optional(),
8224
+ h: length60.optional(),
8225
+ ph: length60.optional(),
8226
+ height: length60.optional(),
8227
+ s: length60.optional(),
8228
+ size: length60.optional(),
8229
+ string: z75.string().optional()
8104
8230
  }).transform((v) => {
8105
8231
  let shape = "rect";
8106
8232
  if (v.circle) shape = "circle";
@@ -8111,27 +8237,27 @@ var smtpad_def = base_def.extend({
8111
8237
  let width;
8112
8238
  let height;
8113
8239
  if (shape === "circle") {
8114
- if (v.r !== void 0) radius = mm14(v.r);
8115
- else if (v.pr !== void 0) radius = mm14(v.pr);
8116
- else if (v.radius !== void 0) radius = mm14(v.radius);
8117
- else if (v.d !== void 0) radius = mm14(v.d) / 2;
8118
- else if (v.pd !== void 0) radius = mm14(v.pd) / 2;
8119
- else if (v.diameter !== void 0) radius = mm14(v.diameter) / 2;
8120
- else radius = mm14("1mm") / 2;
8240
+ if (v.r !== void 0) radius = mm15(v.r);
8241
+ else if (v.pr !== void 0) radius = mm15(v.pr);
8242
+ else if (v.radius !== void 0) radius = mm15(v.radius);
8243
+ else if (v.d !== void 0) radius = mm15(v.d) / 2;
8244
+ else if (v.pd !== void 0) radius = mm15(v.pd) / 2;
8245
+ else if (v.diameter !== void 0) radius = mm15(v.diameter) / 2;
8246
+ else radius = mm15("1mm") / 2;
8121
8247
  } else {
8122
- if (v.w !== void 0) width = mm14(v.w);
8123
- else if (v.pw !== void 0) width = mm14(v.pw);
8124
- else if (v.width !== void 0) width = mm14(v.width);
8125
- else if (v.s !== void 0) width = mm14(v.s);
8126
- else if (v.size !== void 0) width = mm14(v.size);
8127
- else width = mm14("1mm");
8128
- if (v.h !== void 0) height = mm14(v.h);
8129
- else if (v.ph !== void 0) height = mm14(v.ph);
8130
- else if (v.height !== void 0) height = mm14(v.height);
8248
+ if (v.w !== void 0) width = mm15(v.w);
8249
+ else if (v.pw !== void 0) width = mm15(v.pw);
8250
+ else if (v.width !== void 0) width = mm15(v.width);
8251
+ else if (v.s !== void 0) width = mm15(v.s);
8252
+ else if (v.size !== void 0) width = mm15(v.size);
8253
+ else width = mm15("1mm");
8254
+ if (v.h !== void 0) height = mm15(v.h);
8255
+ else if (v.ph !== void 0) height = mm15(v.ph);
8256
+ else if (v.height !== void 0) height = mm15(v.height);
8131
8257
  else if (shape === "square") height = width;
8132
8258
  else if (shape === "rect")
8133
8259
  height = width;
8134
- else height = mm14("1mm");
8260
+ else height = mm15("1mm");
8135
8261
  }
8136
8262
  return {
8137
8263
  fn: v.fn,
@@ -8166,28 +8292,28 @@ var smtpad = (raw_params) => {
8166
8292
  };
8167
8293
 
8168
8294
  // src/fn/platedhole.ts
8169
- import { z as z75 } from "zod";
8170
- import { length as length60 } from "circuit-json";
8171
- import { mm as mm15 } from "@tscircuit/mm";
8295
+ import { z as z76 } from "zod";
8296
+ import { length as length61 } from "circuit-json";
8297
+ import { mm as mm16 } from "@tscircuit/mm";
8172
8298
  var platedhole_def = base_def.extend({
8173
- fn: z75.string(),
8174
- d: length60.optional(),
8175
- hd: length60.optional(),
8176
- r: length60.optional(),
8177
- hr: length60.optional(),
8178
- pd: length60.optional(),
8179
- pr: length60.optional(),
8180
- squarepad: z75.boolean().optional().default(false)
8299
+ fn: z76.string(),
8300
+ d: length61.optional(),
8301
+ hd: length61.optional(),
8302
+ r: length61.optional(),
8303
+ hr: length61.optional(),
8304
+ pd: length61.optional(),
8305
+ pr: length61.optional(),
8306
+ squarepad: z76.boolean().optional().default(false)
8181
8307
  }).transform((v) => {
8182
8308
  let holeD;
8183
- if (v.d !== void 0) holeD = mm15(v.d);
8184
- else if (v.hd !== void 0) holeD = mm15(v.hd);
8185
- else if (v.r !== void 0) holeD = mm15(v.r) * 2;
8186
- else if (v.hr !== void 0) holeD = mm15(v.hr) * 2;
8187
- else holeD = mm15("1mm");
8309
+ if (v.d !== void 0) holeD = mm16(v.d);
8310
+ else if (v.hd !== void 0) holeD = mm16(v.hd);
8311
+ else if (v.r !== void 0) holeD = mm16(v.r) * 2;
8312
+ else if (v.hr !== void 0) holeD = mm16(v.hr) * 2;
8313
+ else holeD = mm16("1mm");
8188
8314
  let padD;
8189
- if (v.pd !== void 0) padD = mm15(v.pd);
8190
- else if (v.pr !== void 0) padD = mm15(v.pr) * 2;
8315
+ if (v.pd !== void 0) padD = mm16(v.pd);
8316
+ else if (v.pr !== void 0) padD = mm16(v.pr) * 2;
8191
8317
  else padD = holeD * (1.5 / 1);
8192
8318
  return {
8193
8319
  fn: v.fn,
@@ -8216,14 +8342,14 @@ var platedhole2 = (raw_params) => {
8216
8342
  };
8217
8343
 
8218
8344
  // src/fn/sot.ts
8219
- import { z as z76 } from "zod";
8345
+ import { z as z77 } from "zod";
8220
8346
  var sot_def = base_def.extend({
8221
- fn: z76.string(),
8222
- num_pins: z76.literal(6).default(6),
8223
- h: z76.string().default("1.6mm"),
8224
- pl: z76.string().default("1mm"),
8225
- pw: z76.string().default("0.7mm"),
8226
- p: z76.string().default("0.95mm")
8347
+ fn: z77.string(),
8348
+ num_pins: z77.literal(6).default(6),
8349
+ h: z77.string().default("1.6mm"),
8350
+ pl: z77.string().default("1mm"),
8351
+ pw: z77.string().default("0.7mm"),
8352
+ p: z77.string().default("0.95mm")
8227
8353
  });
8228
8354
  var sot = (raw_params) => {
8229
8355
  const parameters = sot_def.parse(raw_params);
@@ -8340,16 +8466,16 @@ var sotWithoutParsing = (parameters) => {
8340
8466
  };
8341
8467
 
8342
8468
  // src/fn/sot343.ts
8343
- import { z as z77 } from "zod";
8469
+ import { z as z78 } from "zod";
8344
8470
  var sot343_def = base_def.extend({
8345
- fn: z77.string(),
8346
- num_pins: z77.number().default(4),
8347
- w: z77.string().default("3.2mm"),
8348
- h: z77.string().default("2.6mm"),
8349
- pl: z77.string().default("1.05mm"),
8350
- pw: z77.string().default("0.45mm"),
8351
- p: z77.string().default("0.55mm"),
8352
- string: z77.string().optional()
8471
+ fn: z78.string(),
8472
+ num_pins: z78.number().default(4),
8473
+ w: z78.string().default("3.2mm"),
8474
+ h: z78.string().default("2.6mm"),
8475
+ pl: z78.string().default("1.05mm"),
8476
+ pw: z78.string().default("0.45mm"),
8477
+ p: z78.string().default("0.55mm"),
8478
+ string: z78.string().optional()
8353
8479
  });
8354
8480
  var sot343 = (raw_params) => {
8355
8481
  const match = raw_params.string?.match(/^sot343_(\d+)/);
@@ -8444,9 +8570,9 @@ var sot343_4 = (parameters) => {
8444
8570
  };
8445
8571
 
8446
8572
  // src/fn/m2host.ts
8447
- import { z as z78 } from "zod";
8573
+ import { z as z79 } from "zod";
8448
8574
  var m2host_def = base_def.extend({
8449
- fn: z78.string()
8575
+ fn: z79.string()
8450
8576
  });
8451
8577
  var m2host = (raw_params) => {
8452
8578
  const parameters = m2host_def.parse(raw_params);
@@ -8550,42 +8676,42 @@ var m2host = (raw_params) => {
8550
8676
  };
8551
8677
 
8552
8678
  // src/fn/mountedpcbmodule.ts
8553
- import { length as length61 } from "circuit-json";
8554
- import { z as z79 } from "zod";
8679
+ import { length as length62 } from "circuit-json";
8680
+ import { z as z80 } from "zod";
8555
8681
  var mountedpcbmodule_def = base_def.extend({
8556
- fn: z79.string(),
8557
- numPins: z79.number().optional().default(0),
8558
- rows: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional().default(1).describe("number of rows"),
8559
- p: length61.default("2.54mm").describe("pitch"),
8560
- id: length61.default("1.0mm").describe("inner diameter"),
8561
- od: length61.default("1.5mm").describe("outer diameter"),
8562
- male: z79.boolean().optional().describe("the module uses male headers"),
8563
- nopin: z79.boolean().optional().default(false).describe("omit pins rendering"),
8564
- female: z79.boolean().optional().describe("the module uses female headers"),
8565
- smd: z79.boolean().optional().describe("surface mount device"),
8566
- pinlabeltextalignleft: z79.boolean().optional().default(false),
8567
- pinlabeltextaligncenter: z79.boolean().optional().default(false),
8568
- pinlabeltextalignright: z79.boolean().optional().default(false),
8569
- pinlabelverticallyinverted: z79.boolean().optional().default(false),
8570
- pinlabelorthogonal: z79.boolean().optional().default(false),
8571
- nopinlabels: z79.boolean().optional().default(false).describe("omit silkscreen pin labels"),
8572
- doublesidedpinlabel: z79.boolean().optional().default(false).describe("add silkscreen pins in top and bottom layers"),
8573
- bottomsidepinlabel: z79.boolean().optional().default(false).describe(
8682
+ fn: z80.string(),
8683
+ numPins: z80.number().optional().default(0),
8684
+ rows: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional().default(1).describe("number of rows"),
8685
+ p: length62.default("2.54mm").describe("pitch"),
8686
+ id: length62.default("1.0mm").describe("inner diameter"),
8687
+ od: length62.default("1.5mm").describe("outer diameter"),
8688
+ male: z80.boolean().optional().describe("the module uses male headers"),
8689
+ nopin: z80.boolean().optional().default(false).describe("omit pins rendering"),
8690
+ female: z80.boolean().optional().describe("the module uses female headers"),
8691
+ smd: z80.boolean().optional().describe("surface mount device"),
8692
+ pinlabeltextalignleft: z80.boolean().optional().default(false),
8693
+ pinlabeltextaligncenter: z80.boolean().optional().default(false),
8694
+ pinlabeltextalignright: z80.boolean().optional().default(false),
8695
+ pinlabelverticallyinverted: z80.boolean().optional().default(false),
8696
+ pinlabelorthogonal: z80.boolean().optional().default(false),
8697
+ nopinlabels: z80.boolean().optional().default(false).describe("omit silkscreen pin labels"),
8698
+ doublesidedpinlabel: z80.boolean().optional().default(false).describe("add silkscreen pins in top and bottom layers"),
8699
+ bottomsidepinlabel: z80.boolean().optional().default(false).describe(
8574
8700
  "place the silkscreen reference text on the bottom layer instead of top"
8575
8701
  ),
8576
- pinRowSide: z79.enum(["left", "right", "top", "bottom"]).optional().default("left"),
8577
- pinrowleft: z79.boolean().optional().default(false),
8578
- pinrowright: z79.boolean().optional().default(false),
8579
- pinrowtop: z79.boolean().optional().default(false),
8580
- pinrowbottom: z79.boolean().optional().default(false),
8581
- pinrowleftpins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
8582
- pinrowrightpins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
8583
- pinrowtoppins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
8584
- pinrowbottompins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
8585
- width: length61.optional(),
8586
- height: length61.optional(),
8587
- pinRowHoleEdgeToEdgeDist: length61.default("2mm"),
8588
- holes: z79.union([z79.string(), z79.array(z79.string())]).optional().transform((val) => {
8702
+ pinRowSide: z80.enum(["left", "right", "top", "bottom"]).optional().default("left"),
8703
+ pinrowleft: z80.boolean().optional().default(false),
8704
+ pinrowright: z80.boolean().optional().default(false),
8705
+ pinrowtop: z80.boolean().optional().default(false),
8706
+ pinrowbottom: z80.boolean().optional().default(false),
8707
+ pinrowleftpins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
8708
+ pinrowrightpins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
8709
+ pinrowtoppins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
8710
+ pinrowbottompins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
8711
+ width: length62.optional(),
8712
+ height: length62.optional(),
8713
+ pinRowHoleEdgeToEdgeDist: length62.default("2mm"),
8714
+ holes: z80.union([z80.string(), z80.array(z80.string())]).optional().transform((val) => {
8589
8715
  if (!val) return val;
8590
8716
  if (Array.isArray(val)) return val;
8591
8717
  if (val.startsWith("(") && val.endsWith(")")) {
@@ -8593,23 +8719,23 @@ var mountedpcbmodule_def = base_def.extend({
8593
8719
  }
8594
8720
  return [val];
8595
8721
  }),
8596
- holeXDist: length61.optional(),
8597
- holeYDist: length61.optional(),
8598
- holeInset: length61.default("1mm"),
8599
- pinrow: z79.union([z79.string(), z79.number()]).optional(),
8600
- usbposition: z79.enum(["left", "right", "top", "bottom"]).optional().default("left"),
8601
- usbleft: z79.boolean().optional().default(false),
8602
- usbtop: z79.boolean().optional().default(false),
8603
- usbright: z79.boolean().optional().default(false),
8604
- usbbottom: z79.boolean().optional().default(false),
8605
- usbtype: z79.enum(["micro", "c"]).optional(),
8606
- usbmicro: z79.boolean().optional().default(false),
8607
- usbc: z79.boolean().optional().default(false),
8608
- screen: z79.boolean().optional().default(false).describe("add silkscreen outline for screen/display area"),
8609
- screenwidth: length61.optional(),
8610
- screenheight: length61.optional(),
8611
- screencenteroffsetx: length61.optional(),
8612
- screencenteroffsety: length61.optional()
8722
+ holeXDist: length62.optional(),
8723
+ holeYDist: length62.optional(),
8724
+ holeInset: length62.default("1mm"),
8725
+ pinrow: z80.union([z80.string(), z80.number()]).optional(),
8726
+ usbposition: z80.enum(["left", "right", "top", "bottom"]).optional().default("left"),
8727
+ usbleft: z80.boolean().optional().default(false),
8728
+ usbtop: z80.boolean().optional().default(false),
8729
+ usbright: z80.boolean().optional().default(false),
8730
+ usbbottom: z80.boolean().optional().default(false),
8731
+ usbtype: z80.enum(["micro", "c"]).optional(),
8732
+ usbmicro: z80.boolean().optional().default(false),
8733
+ usbc: z80.boolean().optional().default(false),
8734
+ screen: z80.boolean().optional().default(false).describe("add silkscreen outline for screen/display area"),
8735
+ screenwidth: length62.optional(),
8736
+ screenheight: length62.optional(),
8737
+ screencenteroffsetx: length62.optional(),
8738
+ screencenteroffsety: length62.optional()
8613
8739
  }).transform((data) => {
8614
8740
  const pinlabelAnchorSide = determinePinlabelAnchorSide(data);
8615
8741
  let pinRowSide = data.pinRowSide;
@@ -8701,7 +8827,7 @@ var mountedpcbmodule_def = base_def.extend({
8701
8827
  }).superRefine((data, ctx) => {
8702
8828
  if (data.male && data.female) {
8703
8829
  ctx.addIssue({
8704
- code: z79.ZodIssueCode.custom,
8830
+ code: z80.ZodIssueCode.custom,
8705
8831
  message: "'male' and 'female' cannot both be true; it should be male or female.",
8706
8832
  path: ["male", "female"]
8707
8833
  });
@@ -9044,16 +9170,16 @@ var mountedpcbmodule = (raw_params) => {
9044
9170
  };
9045
9171
 
9046
9172
  // src/fn/to92l.ts
9047
- import { z as z80 } from "zod";
9173
+ import { z as z81 } from "zod";
9048
9174
  var to92l_def = base_def.extend({
9049
- fn: z80.string(),
9050
- num_pins: z80.number().default(3),
9051
- inline: z80.boolean().default(false),
9052
- p: z80.string().default("1.27mm"),
9053
- id: z80.string().default("0.75mm"),
9054
- od: z80.string().default("1.3mm"),
9055
- w: z80.string().default("4.8mm"),
9056
- h: z80.string().default("4.0mm")
9175
+ fn: z81.string(),
9176
+ num_pins: z81.number().default(3),
9177
+ inline: z81.boolean().default(false),
9178
+ p: z81.string().default("1.27mm"),
9179
+ id: z81.string().default("0.75mm"),
9180
+ od: z81.string().default("1.3mm"),
9181
+ w: z81.string().default("4.8mm"),
9182
+ h: z81.string().default("4.0mm")
9057
9183
  });
9058
9184
  var to92l = (raw_params) => {
9059
9185
  const parameters = to92l_def.parse(raw_params);
@@ -9109,10 +9235,27 @@ var to92l = (raw_params) => {
9109
9235
  };
9110
9236
  };
9111
9237
 
9112
- // src/helpers/is-not-null.ts
9113
- function isNotNull(value) {
9114
- return value !== null && value !== void 0;
9115
- }
9238
+ // src/helpers/apply-norefdes.ts
9239
+ var applyNoRefDes = (elements, parameters) => {
9240
+ const refs = elements.filter(
9241
+ (el) => el.type === "pcb_silkscreen_text"
9242
+ );
9243
+ if (refs.length === 0) return elements;
9244
+ for (const ref of refs) {
9245
+ if (parameters.norefdes) {
9246
+ ref.text = "";
9247
+ }
9248
+ }
9249
+ return elements;
9250
+ };
9251
+
9252
+ // src/helpers/apply-nosilkscreen.ts
9253
+ var applyNoSilkscreen = (elements, parameters) => {
9254
+ if (!parameters.nosilkscreen) return elements;
9255
+ return elements.filter((element) => {
9256
+ return element.type !== "pcb_silkscreen_path" && element.type !== "pcb_silkscreen_text";
9257
+ });
9258
+ };
9116
9259
 
9117
9260
  // src/helpers/apply-origin.ts
9118
9261
  var applyOrigin = (elements, origin) => {
@@ -9208,32 +9351,19 @@ var applyOrigin = (elements, origin) => {
9208
9351
  return elements;
9209
9352
  };
9210
9353
 
9211
- // src/helpers/apply-norefdes.ts
9212
- var applyNoRefDes = (elements, parameters) => {
9213
- const refs = elements.filter(
9214
- (el) => el.type === "pcb_silkscreen_text"
9215
- );
9216
- if (refs.length === 0) return elements;
9217
- for (const ref of refs) {
9218
- if (parameters.norefdes) {
9219
- ref.text = "";
9220
- }
9221
- }
9222
- return elements;
9223
- };
9224
-
9225
- // src/helpers/apply-nosilkscreen.ts
9226
- var applyNoSilkscreen = (elements, parameters) => {
9227
- if (!parameters.nosilkscreen) return elements;
9228
- return elements.filter((element) => {
9229
- return element.type !== "pcb_silkscreen_path" && element.type !== "pcb_silkscreen_text";
9230
- });
9231
- };
9354
+ // src/helpers/is-not-null.ts
9355
+ function isNotNull(value) {
9356
+ return value !== null && value !== void 0;
9357
+ }
9232
9358
 
9233
9359
  // src/footprinter.ts
9360
+ var normalizeDefinition = (def) => {
9361
+ return def.trim().replace(/^sot-223-(\d+)(?=_|$)/i, "sot223_$1").replace(/^to-220f-(\d+)(?=_|$)/i, "to220f_$1");
9362
+ };
9234
9363
  var string2 = (def) => {
9235
9364
  let fp2 = footprinter();
9236
- const modifiedDef = def.replace(/^((?:\d{4}|\d{5}))(?=$|_|x)/, "res$1");
9365
+ const normalizedDef = normalizeDefinition(def);
9366
+ const modifiedDef = normalizedDef.replace(/^((?:\d{4}|\d{5}))(?=$|_|x)/, "res$1").replace(/^zh(\d+)(?:$|_)/, "jst$1_zh");
9237
9367
  const def_parts = modifiedDef.split(/_(?!metric)/).map((s) => {
9238
9368
  const m = s.match(/([a-zA-Z]+)([\(\d\.\+\?].*)?/);
9239
9369
  if (!m) return null;
@@ -9246,7 +9376,7 @@ var string2 = (def) => {
9246
9376
  for (const { fn, v } of def_parts) {
9247
9377
  fp2 = fp2[fn](v);
9248
9378
  }
9249
- fp2.setString(def);
9379
+ fp2.setString(normalizedDef);
9250
9380
  return fp2;
9251
9381
  };
9252
9382
  var getFootprintNames = () => {