jscad-electronics 0.0.153 → 0.0.155

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 CHANGED
@@ -262,12 +262,11 @@ interface SOD123Props {
262
262
  */
263
263
  declare const SOD123: ({ fullWidth, fullLength, }?: SOD123Props) => react_jsx_runtime.JSX.Element;
264
264
 
265
- declare const PinRow: ({ numberOfPins, pitch, longSidePinLength, invert, faceup, rows, smd, rightangle, }: {
265
+ declare const PinRow: ({ numberOfPins, pitch, longSidePinLength, invert, rows, smd, rightangle, }: {
266
266
  numberOfPins: number;
267
267
  pitch?: number;
268
268
  longSidePinLength?: number;
269
269
  invert?: boolean;
270
- faceup?: boolean;
271
270
  rows?: number;
272
271
  smd?: boolean;
273
272
  rightangle?: boolean;
@@ -278,7 +277,7 @@ interface AxialCapacitorProps {
278
277
  }
279
278
  declare const AxialCapacitor: ({ pitch }: AxialCapacitorProps) => react_jsx_runtime.JSX.Element;
280
279
 
281
- declare const PinHeader: ({ x, y, pinThickness, shortSidePinLength, longSidePinLength, bodyHeight, bodyLength, bodyWidth, flipZ, faceup, smd, rightangle, }: {
280
+ declare const PinHeader: ({ x, y, pinThickness, shortSidePinLength, longSidePinLength, bodyHeight, bodyLength, bodyWidth, flipZ, smd, rightangle, }: {
282
281
  x: number;
283
282
  y: number;
284
283
  pinThickness: number;
@@ -288,7 +287,6 @@ declare const PinHeader: ({ x, y, pinThickness, shortSidePinLength, longSidePinL
288
287
  bodyLength?: number;
289
288
  bodyWidth?: number;
290
289
  flipZ: (z: number) => number;
291
- faceup?: boolean;
292
290
  smd?: boolean;
293
291
  rightangle?: boolean;
294
292
  }) => react_jsx_runtime.JSX.Element;
package/dist/index.js CHANGED
@@ -1263,6 +1263,7 @@ var getLeadWidth = (pinCount, width10) => {
1263
1263
  // lib/PinHeader.tsx
1264
1264
  import { Colorize as Colorize7, Cuboid as Cuboid14, Hull as Hull4, Rotate as Rotate5, Translate as Translate8 } from "jscad-fiber";
1265
1265
  import { Fragment as Fragment17, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
1266
+ var PIN_METAL_COLOR = "#c0c0c0";
1266
1267
  var PinHeader = ({
1267
1268
  x,
1268
1269
  y,
@@ -1273,7 +1274,6 @@ var PinHeader = ({
1273
1274
  bodyLength: bodyLength10 = 2.54,
1274
1275
  bodyWidth = 2.54,
1275
1276
  flipZ,
1276
- faceup,
1277
1277
  smd,
1278
1278
  rightangle
1279
1279
  }) => {
@@ -1286,7 +1286,7 @@ var PinHeader = ({
1286
1286
  center: [x, y, flipZ(bodyHeight / 2)]
1287
1287
  }
1288
1288
  ) }),
1289
- !faceup && /* @__PURE__ */ jsx21(Colorize7, { color: "gold", children: smd ? /* @__PURE__ */ jsx21(
1289
+ /* @__PURE__ */ jsx21(Colorize7, { color: PIN_METAL_COLOR, children: smd ? /* @__PURE__ */ jsx21(
1290
1290
  SmdChipLead,
1291
1291
  {
1292
1292
  rotation: -Math.PI / 2,
@@ -1305,7 +1305,7 @@ var PinHeader = ({
1305
1305
  /* @__PURE__ */ jsx21(
1306
1306
  Cuboid14,
1307
1307
  {
1308
- color: "gold",
1308
+ color: PIN_METAL_COLOR,
1309
1309
  size: [pinThickness, pinThickness, shortSidePinLength * 0.9],
1310
1310
  center: [x, y, flipZ(bodyHeight * 0.9 + bodyHeight / 2)]
1311
1311
  }
@@ -1313,7 +1313,7 @@ var PinHeader = ({
1313
1313
  /* @__PURE__ */ jsx21(
1314
1314
  Cuboid14,
1315
1315
  {
1316
- color: "gold",
1316
+ color: PIN_METAL_COLOR,
1317
1317
  size: [
1318
1318
  pinThickness / 1.8,
1319
1319
  pinThickness / 1.8,
@@ -1323,11 +1323,11 @@ var PinHeader = ({
1323
1323
  }
1324
1324
  )
1325
1325
  ] }) }),
1326
- /* @__PURE__ */ jsx21(Colorize7, { color: "gold", children: /* @__PURE__ */ jsx21(Translate8, { y: rightangle ? -3.9 : 0, z: rightangle ? 1 : 0, children: /* @__PURE__ */ jsx21(Rotate5, { rotation: rightangle ? [-Math.PI / 2, 0, 0] : [0, 0, 0], children: /* @__PURE__ */ jsxs19(Hull4, { children: [
1326
+ /* @__PURE__ */ jsx21(Colorize7, { color: PIN_METAL_COLOR, children: /* @__PURE__ */ jsx21(Translate8, { y: rightangle ? -3.9 : 0, z: rightangle ? 1 : 0, children: /* @__PURE__ */ jsx21(Rotate5, { rotation: rightangle ? [-Math.PI / 2, 0, 0] : [0, 0, 0], children: /* @__PURE__ */ jsxs19(Hull4, { children: [
1327
1327
  /* @__PURE__ */ jsx21(
1328
1328
  Cuboid14,
1329
1329
  {
1330
- color: "gold",
1330
+ color: PIN_METAL_COLOR,
1331
1331
  size: [pinThickness, pinThickness, longSidePinLength * 0.9],
1332
1332
  center: [x, y, flipZ(-longSidePinLength / 2 * 0.9)]
1333
1333
  }
@@ -1335,7 +1335,7 @@ var PinHeader = ({
1335
1335
  /* @__PURE__ */ jsx21(
1336
1336
  Cuboid14,
1337
1337
  {
1338
- color: "gold",
1338
+ color: PIN_METAL_COLOR,
1339
1339
  size: [
1340
1340
  pinThickness / 1.8,
1341
1341
  pinThickness / 1.8,
@@ -1355,7 +1355,6 @@ var PinRow = ({
1355
1355
  pitch = 2.54,
1356
1356
  longSidePinLength = 6,
1357
1357
  invert,
1358
- faceup,
1359
1358
  rows = 1,
1360
1359
  smd,
1361
1360
  rightangle
@@ -1366,8 +1365,9 @@ var PinRow = ({
1366
1365
  const rowSpacing = 2.54;
1367
1366
  const shortSidePinLength = 3;
1368
1367
  const xoff = -((pinsPerRow - 1) / 2) * pitch;
1369
- const zOffset = !smd && !rightangle ? -bodyHeight - 1.6 : 0;
1370
- const flipZ = (z) => (invert || faceup ? -z + bodyHeight : z) + zOffset;
1368
+ const throughHole = !smd && !rightangle;
1369
+ const flipped = throughHole ? !invert : Boolean(invert);
1370
+ const flipZ = (z) => flipped ? -z + bodyHeight : z;
1371
1371
  return /* @__PURE__ */ jsx22(Fragment18, { children: Array.from({ length: numberOfPins }, (_, i) => {
1372
1372
  const row = Math.floor(i / pinsPerRow);
1373
1373
  const col = i % pinsPerRow;
@@ -1383,7 +1383,6 @@ var PinRow = ({
1383
1383
  longSidePinLength,
1384
1384
  bodyHeight,
1385
1385
  flipZ,
1386
- faceup,
1387
1386
  smd,
1388
1387
  rightangle
1389
1388
  },
@@ -6801,7 +6800,6 @@ var Footprinter3d = ({ footprint }) => {
6801
6800
  numberOfPins: fpJson.num_pins,
6802
6801
  pitch: fpJson.p,
6803
6802
  invert: fpJson.invert,
6804
- faceup: fpJson.faceup,
6805
6803
  rows,
6806
6804
  smd: fpJson.smd || fpJson.surface_mount,
6807
6805
  rightangle: fpJson.rightangle