@tscircuit/footprinter 0.0.282 → 0.0.283

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
@@ -517,83 +517,108 @@ var led = (parameters) => {
517
517
  return { circuitJson: passive(parameters), parameters };
518
518
  };
519
519
 
520
- // src/helpers/res0402-array2.ts
521
- var padSpacing = 1.02;
522
- var padWidth = 0.54;
523
- var padHeight = 0.64;
524
- var padPitch = 0.9;
525
- var res0402Array2 = (params) => {
526
- const yPositions = [padPitch / 2, -padPitch / 2];
520
+ // src/helpers/chipArray.ts
521
+ var chipArray = (params) => {
522
+ const { padSpacing: padSpacing3, padWidth: padWidth3, padHeight: padHeight3, padPitch: padPitch3, numRows, textbottom } = params;
523
+ const yPositions = [];
524
+ const halfRange = (numRows - 1) * (padPitch3 / 2);
525
+ for (let i = 0; i < numRows; i++) {
526
+ yPositions.push(halfRange - i * padPitch3);
527
+ }
527
528
  const pads = [];
528
529
  yPositions.forEach((y, index) => {
529
- pads.push(rectpad(index + 1, -padSpacing / 2, y, padWidth, padHeight));
530
+ pads.push(rectpad(index + 1, -padSpacing3 / 2, y, padWidth3, padHeight3));
530
531
  });
531
532
  yPositions.slice().reverse().forEach((y, index) => {
532
- pads.push(rectpad(index + 3, padSpacing / 2, y, padWidth, padHeight));
533
+ pads.push(
534
+ rectpad(index + numRows + 1, padSpacing3 / 2, y, padWidth3, padHeight3)
535
+ );
533
536
  });
534
- const top = Math.max(...yPositions) + padHeight / 2 + 0.4;
535
- const bottom = Math.min(...yPositions) - padHeight / 2 - 0.4;
536
- const left = -padSpacing / 2 - padWidth / 2 - 0.4;
537
- const right = padSpacing / 2 + padWidth / 2 + 0.4;
538
- const silkscreenLine = {
537
+ const top = Math.max(...yPositions) + padHeight3 / 2 + 0.4;
538
+ const bottom = Math.min(...yPositions) - padHeight3 / 2 - 0.4;
539
+ const left = -padSpacing3 / 2 - padWidth3 / 2 - 0.4;
540
+ const right = padSpacing3 / 2 + padWidth3 / 2 + 0.4;
541
+ const silkscreenTop = {
539
542
  type: "pcb_silkscreen_path",
540
543
  layer: "top",
541
544
  pcb_component_id: "",
542
545
  route: [
543
- { x: right, y: top },
544
- { x: left, y: top },
545
- { x: left, y: bottom },
546
- { x: right, y: bottom },
547
- { x: right, y: top }
546
+ { x: right * 0.5, y: top },
547
+ { x: left * 0.5, y: top }
548
548
  ],
549
- stroke_width: 0.1,
550
- pcb_silkscreen_path_id: ""
549
+ stroke_width: 0.12,
550
+ pcb_silkscreen_path_id: "silkscreen_top"
551
551
  };
552
- const textY = params.textbottom ? bottom - 0.9 : top + 0.9;
553
- const silkscreenRefText = silkscreenRef(0, textY, 0.2);
554
- return [...pads, silkscreenLine, silkscreenRefText];
555
- };
556
-
557
- // src/helpers/res0402-array4.ts
558
- var padSpacing2 = 1.02;
559
- var padWidth2 = 0.54;
560
- var padHeight2 = 0.64;
561
- var padPitch2 = 0.9;
562
- var res0402Array4 = (params) => {
563
- const yPositions = [
564
- padPitch2 * 1.5,
565
- padPitch2 * 0.5,
566
- -padPitch2 * 0.5,
567
- -padPitch2 * 1.5
568
- ];
569
- const pads = [];
570
- yPositions.forEach((y, index) => {
571
- pads.push(rectpad(index + 1, -padSpacing2 / 2, y, padWidth2, padHeight2));
572
- });
573
- yPositions.slice().reverse().forEach((y, index) => {
574
- pads.push(rectpad(index + 5, padSpacing2 / 2, y, padWidth2, padHeight2));
575
- });
576
- const top = Math.max(...yPositions) + padHeight2 / 2 + 0.4;
577
- const bottom = Math.min(...yPositions) - padHeight2 / 2 - 0.4;
578
- const left = -padSpacing2 / 2 - padWidth2 / 2 - 0.4;
579
- const right = padSpacing2 / 2 + padWidth2 / 2 + 0.4;
580
- const silkscreenLine = {
552
+ const silkscreenBottom = {
581
553
  type: "pcb_silkscreen_path",
582
554
  layer: "top",
583
555
  pcb_component_id: "",
584
556
  route: [
585
- { x: right, y: top },
586
- { x: left, y: top },
587
- { x: left, y: bottom },
588
- { x: right, y: bottom },
589
- { x: right, y: top }
557
+ { x: right * 0.5, y: bottom },
558
+ { x: left * 0.5, y: bottom }
590
559
  ],
591
- stroke_width: 0.1,
592
- pcb_silkscreen_path_id: ""
560
+ stroke_width: 0.12,
561
+ pcb_silkscreen_path_id: "silkscreen_bottom"
593
562
  };
594
- const textY = params.textbottom ? bottom - 0.9 : top + 0.9;
563
+ const pin1X = -padSpacing3 / 2;
564
+ const pin1Y = Math.max(...yPositions);
565
+ const pin1MarkerSize = 0.2;
566
+ const pin1Left = pin1X - padWidth3 / 2 - 0.1;
567
+ const pin1Top = pin1Y + padHeight3 / 2 + 0.1;
568
+ const pin1Marker = {
569
+ type: "pcb_silkscreen_path",
570
+ layer: "top",
571
+ pcb_component_id: "",
572
+ pcb_silkscreen_path_id: "pin1_marker",
573
+ route: [
574
+ { x: pin1Left, y: pin1Top },
575
+ { x: pin1Left - pin1MarkerSize, y: pin1Top },
576
+ { x: pin1Left, y: pin1Top + pin1MarkerSize },
577
+ { x: pin1Left, y: pin1Top }
578
+ ],
579
+ stroke_width: 0.1
580
+ };
581
+ const textY = textbottom ? bottom - 0.9 : top + 0.9;
595
582
  const silkscreenRefText = silkscreenRef(0, textY, 0.2);
596
- return [...pads, silkscreenLine, silkscreenRefText];
583
+ return [
584
+ ...pads,
585
+ silkscreenTop,
586
+ silkscreenBottom,
587
+ pin1Marker,
588
+ silkscreenRefText
589
+ ];
590
+ };
591
+
592
+ // src/helpers/res0402-array2.ts
593
+ var padSpacing = 1;
594
+ var padWidth = 0.5;
595
+ var padHeight = 0.4;
596
+ var padPitch = 0.7;
597
+ var res0402Array2 = (params) => {
598
+ return chipArray({
599
+ padSpacing,
600
+ padWidth,
601
+ padHeight,
602
+ padPitch,
603
+ numRows: 2,
604
+ textbottom: params.textbottom
605
+ });
606
+ };
607
+
608
+ // src/helpers/res0402-array4.ts
609
+ var padSpacing2 = 1;
610
+ var padWidth2 = 0.5;
611
+ var padHeight2 = 0.32;
612
+ var padPitch2 = 0.5;
613
+ var res0402Array4 = (params) => {
614
+ return chipArray({
615
+ padSpacing: padSpacing2,
616
+ padWidth: padWidth2,
617
+ padHeight: padHeight2,
618
+ padPitch: padPitch2,
619
+ numRows: 4,
620
+ textbottom: params.textbottom
621
+ });
597
622
  };
598
623
 
599
624
  // src/fn/res.ts