@tscircuit/footprinter 0.0.282 → 0.0.284
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 +170 -123
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -517,83 +517,124 @@ var led = (parameters) => {
|
|
|
517
517
|
return { circuitJson: passive(parameters), parameters };
|
|
518
518
|
};
|
|
519
519
|
|
|
520
|
-
// src/helpers/
|
|
521
|
-
var
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
520
|
+
// src/helpers/chipArray.ts
|
|
521
|
+
var chipArray = (params) => {
|
|
522
|
+
const { padSpacing: padSpacing4, padWidth: padWidth4, padHeight: padHeight4, padPitch: padPitch4, numRows, textbottom } = params;
|
|
523
|
+
const yPositions = [];
|
|
524
|
+
const halfRange = (numRows - 1) * (padPitch4 / 2);
|
|
525
|
+
for (let i = 0; i < numRows; i++) {
|
|
526
|
+
yPositions.push(halfRange - i * padPitch4);
|
|
527
|
+
}
|
|
527
528
|
const pads = [];
|
|
528
529
|
yPositions.forEach((y, index) => {
|
|
529
|
-
pads.push(rectpad(index + 1, -
|
|
530
|
+
pads.push(rectpad(index + 1, -padSpacing4 / 2, y, padWidth4, padHeight4));
|
|
530
531
|
});
|
|
531
532
|
yPositions.slice().reverse().forEach((y, index) => {
|
|
532
|
-
pads.push(
|
|
533
|
+
pads.push(
|
|
534
|
+
rectpad(index + numRows + 1, padSpacing4 / 2, y, padWidth4, padHeight4)
|
|
535
|
+
);
|
|
533
536
|
});
|
|
534
|
-
const top = Math.max(...yPositions) +
|
|
535
|
-
const bottom = Math.min(...yPositions) -
|
|
536
|
-
const left = -
|
|
537
|
-
const right =
|
|
538
|
-
const
|
|
537
|
+
const top = Math.max(...yPositions) + padHeight4 / 2 + 0.4;
|
|
538
|
+
const bottom = Math.min(...yPositions) - padHeight4 / 2 - 0.4;
|
|
539
|
+
const left = -padSpacing4 / 2 - padWidth4 / 2 - 0.4;
|
|
540
|
+
const right = padSpacing4 / 2 + padWidth4 / 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.
|
|
550
|
-
pcb_silkscreen_path_id: ""
|
|
549
|
+
stroke_width: 0.12,
|
|
550
|
+
pcb_silkscreen_path_id: "silkscreen_top"
|
|
551
551
|
};
|
|
552
|
-
const
|
|
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:
|
|
586
|
-
{ x: left, y:
|
|
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.
|
|
592
|
-
pcb_silkscreen_path_id: ""
|
|
560
|
+
stroke_width: 0.12,
|
|
561
|
+
pcb_silkscreen_path_id: "silkscreen_bottom"
|
|
562
|
+
};
|
|
563
|
+
const pin1X = -padSpacing4 / 2;
|
|
564
|
+
const pin1Y = Math.max(...yPositions);
|
|
565
|
+
const pin1MarkerSize = 0.2;
|
|
566
|
+
const pin1Left = pin1X - padWidth4 / 2 - 0.1;
|
|
567
|
+
const pin1Top = pin1Y + padHeight4 / 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
|
|
593
580
|
};
|
|
594
|
-
const textY =
|
|
581
|
+
const textY = textbottom ? bottom - 0.9 : top + 0.9;
|
|
595
582
|
const silkscreenRefText = silkscreenRef(0, textY, 0.2);
|
|
596
|
-
return [
|
|
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
|
+
});
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
// src/helpers/res0603-array2.ts
|
|
625
|
+
var padSpacing3 = 1.7;
|
|
626
|
+
var padWidth3 = 0.9;
|
|
627
|
+
var padHeight3 = 0.4;
|
|
628
|
+
var padPitch3 = 0.8;
|
|
629
|
+
var res0603Array2 = (params) => {
|
|
630
|
+
return chipArray({
|
|
631
|
+
padSpacing: padSpacing3,
|
|
632
|
+
padWidth: padWidth3,
|
|
633
|
+
padHeight: padHeight3,
|
|
634
|
+
padPitch: padPitch3,
|
|
635
|
+
numRows: 2,
|
|
636
|
+
textbottom: params.textbottom
|
|
637
|
+
});
|
|
597
638
|
};
|
|
598
639
|
|
|
599
640
|
// src/fn/res.ts
|
|
@@ -635,6 +676,12 @@ var res = (rawParameters) => {
|
|
|
635
676
|
parameters: rawParameters
|
|
636
677
|
};
|
|
637
678
|
}
|
|
679
|
+
if (arrayCount === 2 && imperialBase === "0603") {
|
|
680
|
+
return {
|
|
681
|
+
circuitJson: res0603Array2(rawParameters),
|
|
682
|
+
parameters: rawParameters
|
|
683
|
+
};
|
|
684
|
+
}
|
|
638
685
|
return { circuitJson: passive(rawParameters), parameters: rawParameters };
|
|
639
686
|
};
|
|
640
687
|
|
|
@@ -3781,41 +3828,41 @@ var to92 = (raw_params) => {
|
|
|
3781
3828
|
});
|
|
3782
3829
|
const { p, id, od, w, h, inline } = parameters;
|
|
3783
3830
|
const holeY = Number.parseFloat(h) / 2;
|
|
3784
|
-
const
|
|
3831
|
+
const padSpacing4 = Number.parseFloat(p);
|
|
3785
3832
|
const holeDia = Number.parseFloat(id);
|
|
3786
3833
|
const padDia = Number.parseFloat(od);
|
|
3787
|
-
const
|
|
3788
|
-
const
|
|
3834
|
+
const padWidth4 = padDia;
|
|
3835
|
+
const padHeight4 = padDia * (1.5 / 1.05);
|
|
3789
3836
|
let platedHoles = [];
|
|
3790
3837
|
if (parameters.num_pins === 3) {
|
|
3791
3838
|
if (inline) {
|
|
3792
3839
|
platedHoles = [
|
|
3793
3840
|
platedHoleWithRectPad(
|
|
3794
3841
|
1,
|
|
3795
|
-
-
|
|
3796
|
-
holeY -
|
|
3842
|
+
-padSpacing4,
|
|
3843
|
+
holeY - padSpacing4,
|
|
3797
3844
|
holeDia,
|
|
3798
3845
|
padDia,
|
|
3799
|
-
|
|
3846
|
+
padHeight4,
|
|
3800
3847
|
0,
|
|
3801
3848
|
0
|
|
3802
3849
|
),
|
|
3803
|
-
platedHolePill(2, 0, holeY -
|
|
3850
|
+
platedHolePill(2, 0, holeY - padSpacing4, holeDia, padWidth4, padHeight4),
|
|
3804
3851
|
platedHolePill(
|
|
3805
3852
|
3,
|
|
3806
|
-
|
|
3807
|
-
holeY -
|
|
3853
|
+
padSpacing4,
|
|
3854
|
+
holeY - padSpacing4,
|
|
3808
3855
|
holeDia,
|
|
3809
|
-
|
|
3810
|
-
|
|
3856
|
+
padWidth4,
|
|
3857
|
+
padHeight4
|
|
3811
3858
|
)
|
|
3812
3859
|
];
|
|
3813
3860
|
} else {
|
|
3814
3861
|
platedHoles = [
|
|
3815
3862
|
platedHoleWithRectPad(
|
|
3816
3863
|
1,
|
|
3817
|
-
-
|
|
3818
|
-
holeY -
|
|
3864
|
+
-padSpacing4,
|
|
3865
|
+
holeY - padSpacing4,
|
|
3819
3866
|
holeDia,
|
|
3820
3867
|
padDia,
|
|
3821
3868
|
padDia,
|
|
@@ -3823,28 +3870,28 @@ var to92 = (raw_params) => {
|
|
|
3823
3870
|
0
|
|
3824
3871
|
),
|
|
3825
3872
|
platedhole(2, 0, holeY, holeDia, padDia),
|
|
3826
|
-
platedhole(3,
|
|
3873
|
+
platedhole(3, padSpacing4, holeY - padSpacing4, holeDia, padDia)
|
|
3827
3874
|
];
|
|
3828
3875
|
}
|
|
3829
3876
|
} else if (parameters.num_pins === 2) {
|
|
3830
3877
|
platedHoles = [
|
|
3831
3878
|
platedHoleWithRectPad(
|
|
3832
3879
|
1,
|
|
3833
|
-
-
|
|
3834
|
-
holeY -
|
|
3880
|
+
-padSpacing4,
|
|
3881
|
+
holeY - padSpacing4,
|
|
3835
3882
|
holeDia,
|
|
3836
|
-
|
|
3837
|
-
|
|
3883
|
+
padWidth4,
|
|
3884
|
+
padHeight4,
|
|
3838
3885
|
0,
|
|
3839
3886
|
0
|
|
3840
3887
|
),
|
|
3841
3888
|
platedHolePill(
|
|
3842
3889
|
2,
|
|
3843
|
-
|
|
3844
|
-
holeY -
|
|
3890
|
+
padSpacing4,
|
|
3891
|
+
holeY - padSpacing4,
|
|
3845
3892
|
holeDia,
|
|
3846
|
-
|
|
3847
|
-
|
|
3893
|
+
padWidth4,
|
|
3894
|
+
padHeight4
|
|
3848
3895
|
)
|
|
3849
3896
|
];
|
|
3850
3897
|
} else {
|
|
@@ -4810,15 +4857,15 @@ var sot89_def = base_def.extend({
|
|
|
4810
4857
|
var sot89_3 = (parameters) => {
|
|
4811
4858
|
const pads = [];
|
|
4812
4859
|
const padGap = Number.parseFloat(parameters.p);
|
|
4813
|
-
const
|
|
4860
|
+
const padWidth4 = Number.parseFloat(parameters.pw);
|
|
4814
4861
|
const length51 = Number.parseFloat(parameters.w);
|
|
4815
|
-
const
|
|
4862
|
+
const padHeight4 = Number.parseFloat(parameters.pl);
|
|
4816
4863
|
const centerExtra = 0.175;
|
|
4817
|
-
const outerPadXShift = (
|
|
4864
|
+
const outerPadXShift = (padHeight4 - (padHeight4 + centerExtra)) / 2;
|
|
4818
4865
|
pads.push(
|
|
4819
|
-
rectpad(1, -length51 / 2 + outerPadXShift, padGap,
|
|
4820
|
-
rectpad(2, -length51 / 2, 0,
|
|
4821
|
-
rectpad(3, -length51 / 2 + outerPadXShift, -padGap,
|
|
4866
|
+
rectpad(1, -length51 / 2 + outerPadXShift, padGap, padHeight4, padWidth4),
|
|
4867
|
+
rectpad(2, -length51 / 2, 0, padHeight4 + centerExtra, padWidth4),
|
|
4868
|
+
rectpad(3, -length51 / 2 + outerPadXShift, -padGap, padHeight4, padWidth4)
|
|
4822
4869
|
);
|
|
4823
4870
|
const silkscreenRefText = silkscreenRef(0, 0, 0.3);
|
|
4824
4871
|
const width = Number.parseFloat(parameters.w) / 2 - 1;
|
|
@@ -4857,7 +4904,7 @@ var sot89_3 = (parameters) => {
|
|
|
4857
4904
|
var sot89_5 = (parameters) => {
|
|
4858
4905
|
const pads = [];
|
|
4859
4906
|
const padGap = Number.parseFloat(parameters.p);
|
|
4860
|
-
const
|
|
4907
|
+
const padWidth4 = Number.parseFloat(parameters.pw);
|
|
4861
4908
|
const length51 = Number.parseFloat(parameters.w);
|
|
4862
4909
|
pads.push(
|
|
4863
4910
|
rectpad(1, -1.85, -1.5, 1.5, 0.7),
|
|
@@ -6013,20 +6060,20 @@ var to92s_def = base_def.extend({
|
|
|
6013
6060
|
var to92s_3 = (parameters) => {
|
|
6014
6061
|
const { p, id, od, w, h } = parameters;
|
|
6015
6062
|
const holeY = Number.parseFloat(h) / 2;
|
|
6016
|
-
const
|
|
6063
|
+
const padSpacing4 = Number.parseFloat(p);
|
|
6017
6064
|
return [
|
|
6018
|
-
platedhole(1, -
|
|
6019
|
-
platedhole(2, 0, holeY -
|
|
6020
|
-
platedhole(3,
|
|
6065
|
+
platedhole(1, -padSpacing4, holeY - padSpacing4, id, od),
|
|
6066
|
+
platedhole(2, 0, holeY - padSpacing4, id, od),
|
|
6067
|
+
platedhole(3, padSpacing4, holeY - padSpacing4, id, od)
|
|
6021
6068
|
];
|
|
6022
6069
|
};
|
|
6023
6070
|
var to92s_2 = (parameters) => {
|
|
6024
6071
|
const { p, id, od, h } = parameters;
|
|
6025
6072
|
const holeY = Number.parseFloat(h) / 2;
|
|
6026
|
-
const
|
|
6073
|
+
const padSpacing4 = Number.parseFloat(p);
|
|
6027
6074
|
return [
|
|
6028
|
-
platedhole(1, -
|
|
6029
|
-
platedhole(2,
|
|
6075
|
+
platedhole(1, -padSpacing4, holeY - padSpacing4, id, od),
|
|
6076
|
+
platedhole(2, padSpacing4, holeY - padSpacing4, id, od)
|
|
6030
6077
|
];
|
|
6031
6078
|
};
|
|
6032
6079
|
var to92s = (raw_params) => {
|
|
@@ -6045,19 +6092,19 @@ var to92s = (raw_params) => {
|
|
|
6045
6092
|
throw new Error("Invalid number of pins for TO-92");
|
|
6046
6093
|
}
|
|
6047
6094
|
const holeY = Number.parseFloat(parameters.h) / 2;
|
|
6048
|
-
const
|
|
6095
|
+
const padSpacing4 = Number.parseFloat(parameters.p);
|
|
6049
6096
|
const silkscreenBody = {
|
|
6050
6097
|
type: "pcb_silkscreen_path",
|
|
6051
6098
|
layer: "top",
|
|
6052
6099
|
pcb_component_id: "",
|
|
6053
6100
|
route: [
|
|
6054
|
-
{ x: -holeY, y: holeY -
|
|
6101
|
+
{ x: -holeY, y: holeY - padSpacing4 },
|
|
6055
6102
|
{ x: -1.9, y: 0 },
|
|
6056
6103
|
{ x: 1.9, y: 0 },
|
|
6057
|
-
{ x: holeY, y: holeY -
|
|
6104
|
+
{ x: holeY, y: holeY - padSpacing4 },
|
|
6058
6105
|
{ x: 1.5, y: Number.parseFloat(parameters.h) / 2 + 0.5 },
|
|
6059
6106
|
{ x: -1.5, y: Number.parseFloat(parameters.h) / 2 + 0.5 },
|
|
6060
|
-
{ x: -holeY, y: holeY -
|
|
6107
|
+
{ x: -holeY, y: holeY - padSpacing4 }
|
|
6061
6108
|
],
|
|
6062
6109
|
stroke_width: 0.1,
|
|
6063
6110
|
pcb_silkscreen_path_id: ""
|
|
@@ -6836,13 +6883,13 @@ var getSonPadCoord = (num_pins, pn, w, p) => {
|
|
|
6836
6883
|
import { length as length45 } from "circuit-json";
|
|
6837
6884
|
var solderjumper = (params) => {
|
|
6838
6885
|
const { num_pins, bridged, p = 2.54, pw = 1.5, ph = 1.5 } = params;
|
|
6839
|
-
const
|
|
6840
|
-
const
|
|
6841
|
-
const
|
|
6842
|
-
const traceWidth = Math.min(
|
|
6886
|
+
const padSpacing4 = length45.parse(p);
|
|
6887
|
+
const padWidth4 = length45.parse(pw);
|
|
6888
|
+
const padHeight4 = length45.parse(ph);
|
|
6889
|
+
const traceWidth = Math.min(padHeight4 / 4, 0.5);
|
|
6843
6890
|
const pads = [];
|
|
6844
6891
|
for (let i = 0; i < num_pins; i++) {
|
|
6845
|
-
pads.push(rectpad(i + 1, i *
|
|
6892
|
+
pads.push(rectpad(i + 1, i * padSpacing4, 0, padWidth4, padHeight4));
|
|
6846
6893
|
}
|
|
6847
6894
|
let traces = [];
|
|
6848
6895
|
if (bridged) {
|
|
@@ -6852,11 +6899,11 @@ var solderjumper = (params) => {
|
|
|
6852
6899
|
const from = pins[i];
|
|
6853
6900
|
const to = pins[i + 1];
|
|
6854
6901
|
if (typeof from === "number" && typeof to === "number" && !isNaN(from) && !isNaN(to)) {
|
|
6855
|
-
const xCenterFrom = (from - 1) *
|
|
6856
|
-
const xCenterTo = (to - 1) *
|
|
6902
|
+
const xCenterFrom = (from - 1) * padSpacing4;
|
|
6903
|
+
const xCenterTo = (to - 1) * padSpacing4;
|
|
6857
6904
|
const directionMult = Math.sign(xCenterTo - xCenterFrom);
|
|
6858
|
-
const x1 = xCenterFrom + directionMult * (
|
|
6859
|
-
const x2 = xCenterTo - directionMult * (
|
|
6905
|
+
const x1 = xCenterFrom + directionMult * (padWidth4 / 2);
|
|
6906
|
+
const x2 = xCenterTo - directionMult * (padWidth4 / 2);
|
|
6860
6907
|
traces.push({
|
|
6861
6908
|
type: "pcb_trace",
|
|
6862
6909
|
pcb_trace_id: "",
|
|
@@ -6883,9 +6930,9 @@ var solderjumper = (params) => {
|
|
|
6883
6930
|
}
|
|
6884
6931
|
}
|
|
6885
6932
|
}
|
|
6886
|
-
const outlineWidth = (num_pins - 1) *
|
|
6887
|
-
const outlineHeight =
|
|
6888
|
-
const outlineCenterX = (num_pins - 1) *
|
|
6933
|
+
const outlineWidth = (num_pins - 1) * padSpacing4 + padWidth4 + 0.7;
|
|
6934
|
+
const outlineHeight = padHeight4 + 1;
|
|
6935
|
+
const outlineCenterX = (num_pins - 1) * padSpacing4 / 2;
|
|
6889
6936
|
const outlineCenterY = 0;
|
|
6890
6937
|
const silkscreenRect = {
|
|
6891
6938
|
type: "pcb_silkscreen_path",
|
|
@@ -6986,40 +7033,40 @@ var generateSot457Elements = (params) => {
|
|
|
6986
7033
|
const pads = [];
|
|
6987
7034
|
const pitch = parseDimension(params.p);
|
|
6988
7035
|
const padLength = parseDimension(params.pl);
|
|
6989
|
-
const
|
|
7036
|
+
const padWidth4 = parseDimension(params.pw);
|
|
6990
7037
|
const width = parseDimension(params.w);
|
|
6991
7038
|
const height = parseDimension(params.h);
|
|
6992
7039
|
if (params.wave) {
|
|
6993
7040
|
const pinConfigs = {
|
|
6994
|
-
1: ({ padWidth:
|
|
6995
|
-
2: ({ padWidth:
|
|
6996
|
-
3: ({ padWidth:
|
|
7041
|
+
1: ({ padWidth: padWidth5, padHeight: padHeight4 }) => rectpad(1, -pitch, pitch, padHeight4, padWidth5),
|
|
7042
|
+
2: ({ padWidth: padWidth5, padHeight: padHeight4 }) => rectpad(2, -pitch, -pitch, padHeight4, padWidth5),
|
|
7043
|
+
3: ({ padWidth: padWidth5, padHeight: padHeight4 }) => pillpad(
|
|
6997
7044
|
3,
|
|
6998
7045
|
-pitch,
|
|
6999
7046
|
0,
|
|
7000
7047
|
parseDimension(params.pillw),
|
|
7001
7048
|
parseDimension(params.pillh)
|
|
7002
7049
|
),
|
|
7003
|
-
4: ({ padWidth:
|
|
7050
|
+
4: ({ padWidth: padWidth5, padHeight: padHeight4 }) => pillpad(
|
|
7004
7051
|
4,
|
|
7005
7052
|
pitch,
|
|
7006
7053
|
0,
|
|
7007
7054
|
parseDimension(params.pillw),
|
|
7008
7055
|
parseDimension(params.pillh)
|
|
7009
7056
|
),
|
|
7010
|
-
5: ({ padWidth:
|
|
7011
|
-
6: ({ padWidth:
|
|
7057
|
+
5: ({ padWidth: padWidth5, padHeight: padHeight4 }) => rectpad(5, pitch, pitch, padHeight4, padWidth5),
|
|
7058
|
+
6: ({ padWidth: padWidth5, padHeight: padHeight4 }) => rectpad(6, pitch, -pitch, padHeight4, padWidth5)
|
|
7012
7059
|
};
|
|
7013
7060
|
for (let i = 1; i <= params.num_pins; i++) {
|
|
7014
7061
|
const config = pinConfigs[i];
|
|
7015
7062
|
if (config) {
|
|
7016
|
-
pads.push(config({ padWidth: padLength, padHeight:
|
|
7063
|
+
pads.push(config({ padWidth: padLength, padHeight: padWidth4 }));
|
|
7017
7064
|
}
|
|
7018
7065
|
}
|
|
7019
7066
|
} else {
|
|
7020
7067
|
for (let i = 1; i <= params.num_pins; i++) {
|
|
7021
7068
|
const { x, y } = getCcwSot457Coords({ pitch, width, pinNumber: i });
|
|
7022
|
-
pads.push(rectpad(i, x, y, padLength,
|
|
7069
|
+
pads.push(rectpad(i, x, y, padLength, padWidth4));
|
|
7023
7070
|
}
|
|
7024
7071
|
}
|
|
7025
7072
|
const silkscreenPath1 = {
|
|
@@ -7048,7 +7095,7 @@ var generateSot457Elements = (params) => {
|
|
|
7048
7095
|
const pin1Position = getCcwSot457Coords({ pitch, width, pinNumber: 1 });
|
|
7049
7096
|
const triangleHeight = params.wave ? 1 : 0.5;
|
|
7050
7097
|
const triangleWidth = params.wave ? 0.7 : 0.3;
|
|
7051
|
-
pin1Position.x -= params.wave ?
|
|
7098
|
+
pin1Position.x -= params.wave ? padWidth4 : padWidth4 * 1.7;
|
|
7052
7099
|
const pin1Indicator = {
|
|
7053
7100
|
type: "pcb_silkscreen_path",
|
|
7054
7101
|
layer: "top",
|
|
@@ -7910,7 +7957,7 @@ var m2host_def = base_def.extend({
|
|
|
7910
7957
|
var m2host = (raw_params) => {
|
|
7911
7958
|
const parameters = m2host_def.parse(raw_params);
|
|
7912
7959
|
const pads = [];
|
|
7913
|
-
const
|
|
7960
|
+
const padWidth4 = 0.5 - 0.15;
|
|
7914
7961
|
const padLength = 1.5;
|
|
7915
7962
|
const pitch = 0.5;
|
|
7916
7963
|
const halfPitch = pitch / 2;
|
|
@@ -7925,7 +7972,7 @@ var m2host = (raw_params) => {
|
|
|
7925
7972
|
const padLengthWithOffset = padLength + (isBottomLayer ? 0.25 : 0);
|
|
7926
7973
|
const rightEdgeOffset = 0.5;
|
|
7927
7974
|
const x = rightEdgeOffset - padLengthWithOffset / 2;
|
|
7928
|
-
const pad2 = rectpad(pn, x, y, padLengthWithOffset,
|
|
7975
|
+
const pad2 = rectpad(pn, x, y, padLengthWithOffset, padWidth4);
|
|
7929
7976
|
pad2.layer = isBottomLayer ? "bottom" : "top";
|
|
7930
7977
|
pads.push(pad2);
|
|
7931
7978
|
}
|