jscad-electronics 0.0.106 → 0.0.108
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 +12 -8
- package/dist/index.js.map +1 -1
- package/dist/vanilla.js +12 -8
- package/dist/vanilla.js.map +1 -1
- package/package.json +2 -2
package/dist/vanilla.js
CHANGED
|
@@ -238,10 +238,12 @@ var DipPinLeg = ({ x, y, z }) => {
|
|
|
238
238
|
var Dip = ({
|
|
239
239
|
numPins = 8,
|
|
240
240
|
pitch = 2.54,
|
|
241
|
-
bodyWidth = 6.4
|
|
241
|
+
bodyWidth = 6.4,
|
|
242
|
+
rowSpacing
|
|
242
243
|
}) => {
|
|
243
244
|
const numPinsOnEachSide = Math.floor(numPins / 2);
|
|
244
|
-
const
|
|
245
|
+
const pinRowSpacing = rowSpacing ?? (bodyWidth >= 7 ? bodyWidth : bodyWidth + 1.22);
|
|
246
|
+
const chipBodyWidth = bodyWidth >= 7 ? pinRowSpacing - 1.22 : bodyWidth;
|
|
245
247
|
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
246
248
|
range(numPins).map((i) => {
|
|
247
249
|
const yRow = i % numPinsOnEachSide;
|
|
@@ -249,7 +251,7 @@ var Dip = ({
|
|
|
249
251
|
return /* @__PURE__ */ jsx(
|
|
250
252
|
DipPinLeg,
|
|
251
253
|
{
|
|
252
|
-
x: xRow *
|
|
254
|
+
x: xRow * pinRowSpacing / 2,
|
|
253
255
|
y: yRow * pitch - (numPinsOnEachSide - 1) / 2 * pitch,
|
|
254
256
|
z: DIP_PIN_HEIGHT / 2 + heightAboveSurface
|
|
255
257
|
},
|
|
@@ -259,7 +261,7 @@ var Dip = ({
|
|
|
259
261
|
/* @__PURE__ */ jsx(
|
|
260
262
|
ChipBody,
|
|
261
263
|
{
|
|
262
|
-
width:
|
|
264
|
+
width: chipBodyWidth,
|
|
263
265
|
length: numPinsOnEachSide * pitch + 0.5,
|
|
264
266
|
height: DIP_PIN_HEIGHT - heightAboveSurface,
|
|
265
267
|
heightAboveSurface,
|
|
@@ -675,14 +677,15 @@ var PinRow = ({
|
|
|
675
677
|
numberOfPins,
|
|
676
678
|
pitch = 2.54,
|
|
677
679
|
longSidePinLength = 6,
|
|
678
|
-
invert
|
|
680
|
+
invert,
|
|
681
|
+
faceup
|
|
679
682
|
}) => {
|
|
680
683
|
const pinThickness = 0.63;
|
|
681
684
|
const bodyHeight = 2;
|
|
682
685
|
const bodyWidth = numberOfPins * pitch;
|
|
683
686
|
const shortSidePinLength = 3;
|
|
684
687
|
const xoff = -((numberOfPins - 1) / 2) * pitch;
|
|
685
|
-
const flipZ = (z) => invert ? -z + bodyHeight : z;
|
|
688
|
+
const flipZ = (z) => invert || faceup ? -z + bodyHeight : z;
|
|
686
689
|
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
687
690
|
/* @__PURE__ */ jsx(
|
|
688
691
|
Cuboid,
|
|
@@ -693,7 +696,7 @@ var PinRow = ({
|
|
|
693
696
|
}
|
|
694
697
|
),
|
|
695
698
|
Array.from({ length: numberOfPins }, (_, i) => /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
696
|
-
/* @__PURE__ */ jsx(Colorize, { color: "gold", children: /* @__PURE__ */ jsxs(Hull, { children: [
|
|
699
|
+
!faceup && /* @__PURE__ */ jsx(Colorize, { color: "gold", children: /* @__PURE__ */ jsxs(Hull, { children: [
|
|
697
700
|
/* @__PURE__ */ jsx(
|
|
698
701
|
Cuboid,
|
|
699
702
|
{
|
|
@@ -3982,7 +3985,8 @@ var Footprinter3d = ({ footprint }) => {
|
|
|
3982
3985
|
{
|
|
3983
3986
|
numberOfPins: fpJson.num_pins,
|
|
3984
3987
|
pitch: fpJson.p,
|
|
3985
|
-
invert: fpJson.invert
|
|
3988
|
+
invert: fpJson.invert,
|
|
3989
|
+
faceup: fpJson.faceup
|
|
3986
3990
|
}
|
|
3987
3991
|
);
|
|
3988
3992
|
if (fpJson.female)
|