jscad-electronics 0.0.105 → 0.0.106
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.d.ts +2 -1
- package/dist/index.js +68 -51
- package/dist/index.js.map +1 -1
- package/dist/vanilla.js +24 -7
- package/dist/vanilla.js.map +1 -1
- package/package.json +2 -2
package/dist/vanilla.js
CHANGED
|
@@ -674,20 +674,22 @@ var getLeadWidth = (pinCount, width10) => {
|
|
|
674
674
|
var PinRow = ({
|
|
675
675
|
numberOfPins,
|
|
676
676
|
pitch = 2.54,
|
|
677
|
-
longSidePinLength = 6
|
|
677
|
+
longSidePinLength = 6,
|
|
678
|
+
invert
|
|
678
679
|
}) => {
|
|
679
680
|
const pinThickness = 0.63;
|
|
680
681
|
const bodyHeight = 2;
|
|
681
682
|
const bodyWidth = numberOfPins * pitch;
|
|
682
683
|
const shortSidePinLength = 3;
|
|
683
684
|
const xoff = -((numberOfPins - 1) / 2) * pitch;
|
|
685
|
+
const flipZ = (z) => invert ? -z + bodyHeight : z;
|
|
684
686
|
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
685
687
|
/* @__PURE__ */ jsx(
|
|
686
688
|
Cuboid,
|
|
687
689
|
{
|
|
688
690
|
color: "#222",
|
|
689
691
|
size: [bodyWidth, pinThickness * 3, bodyHeight],
|
|
690
|
-
center: [0, 0, bodyHeight / 2
|
|
692
|
+
center: [0, 0, flipZ(bodyHeight / 2)]
|
|
691
693
|
}
|
|
692
694
|
),
|
|
693
695
|
Array.from({ length: numberOfPins }, (_, i) => /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
@@ -700,7 +702,7 @@ var PinRow = ({
|
|
|
700
702
|
center: [
|
|
701
703
|
xoff + i * pitch,
|
|
702
704
|
0,
|
|
703
|
-
bodyHeight * 0.9 + bodyHeight / 2
|
|
705
|
+
flipZ(bodyHeight * 0.9 + bodyHeight / 2)
|
|
704
706
|
]
|
|
705
707
|
}
|
|
706
708
|
),
|
|
@@ -713,7 +715,11 @@ var PinRow = ({
|
|
|
713
715
|
pinThickness / 1.8,
|
|
714
716
|
shortSidePinLength
|
|
715
717
|
],
|
|
716
|
-
center: [
|
|
718
|
+
center: [
|
|
719
|
+
xoff + i * pitch,
|
|
720
|
+
0,
|
|
721
|
+
flipZ(bodyHeight + bodyHeight / 2)
|
|
722
|
+
]
|
|
717
723
|
}
|
|
718
724
|
)
|
|
719
725
|
] }) }),
|
|
@@ -723,7 +729,11 @@ var PinRow = ({
|
|
|
723
729
|
{
|
|
724
730
|
color: "gold",
|
|
725
731
|
size: [pinThickness, pinThickness, longSidePinLength * 0.9],
|
|
726
|
-
center: [
|
|
732
|
+
center: [
|
|
733
|
+
xoff + i * pitch,
|
|
734
|
+
0,
|
|
735
|
+
flipZ(-longSidePinLength / 2 * 0.9)
|
|
736
|
+
]
|
|
727
737
|
}
|
|
728
738
|
),
|
|
729
739
|
/* @__PURE__ */ jsx(
|
|
@@ -735,7 +745,7 @@ var PinRow = ({
|
|
|
735
745
|
pinThickness / 1.8,
|
|
736
746
|
longSidePinLength
|
|
737
747
|
],
|
|
738
|
-
center: [xoff + i * pitch, 0, -longSidePinLength / 2]
|
|
748
|
+
center: [xoff + i * pitch, 0, flipZ(-longSidePinLength / 2)]
|
|
739
749
|
}
|
|
740
750
|
)
|
|
741
751
|
] }) })
|
|
@@ -3967,7 +3977,14 @@ var Footprinter3d = ({ footprint }) => {
|
|
|
3967
3977
|
}
|
|
3968
3978
|
case "pinrow":
|
|
3969
3979
|
if (fpJson.male)
|
|
3970
|
-
return /* @__PURE__ */ jsx(
|
|
3980
|
+
return /* @__PURE__ */ jsx(
|
|
3981
|
+
PinRow,
|
|
3982
|
+
{
|
|
3983
|
+
numberOfPins: fpJson.num_pins,
|
|
3984
|
+
pitch: fpJson.p,
|
|
3985
|
+
invert: fpJson.invert
|
|
3986
|
+
}
|
|
3987
|
+
);
|
|
3971
3988
|
if (fpJson.female)
|
|
3972
3989
|
return /* @__PURE__ */ jsx(FemaleHeader, { numberOfPins: fpJson.num_pins, pitch: fpJson.p });
|
|
3973
3990
|
case "cap": {
|