jscad-electronics 0.0.24 → 0.0.25

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
@@ -64,8 +64,8 @@ interface ChipBodyProps {
64
64
  }
65
65
  declare const ChipBody: ({ center, width, length, height, heightAboveSurface, }: ChipBodyProps) => react_jsx_runtime.JSX.Element;
66
66
 
67
- declare const ExtrudedPads: ({ soup, footprint, }: {
68
- soup?: AnyCircuitElement[];
67
+ declare const ExtrudedPads: ({ circuitJson, footprint, }: {
68
+ circuitJson?: AnyCircuitElement[];
69
69
  footprint?: string;
70
70
  }) => react_jsx_runtime.JSX.Element;
71
71
 
package/dist/index.js CHANGED
@@ -78734,9 +78734,9 @@ var ChipBody = ({
78734
78734
  width: width10,
78735
78735
  length,
78736
78736
  height: height10,
78737
- heightAboveSurface = 0.15
78737
+ heightAboveSurface: heightAboveSurface2 = 0.15
78738
78738
  }) => {
78739
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jscad_fiber11.Colorize, { color: "#555", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jscad_fiber11.Translate, { offset: center, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jscad_fiber11.Translate, { offset: { x: 0, y: 0, z: height10 / 2 + heightAboveSurface }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jscad_fiber11.RoundedCuboid, { roundRadius: 0.2, size: [width10, length, height10] }) }) }) });
78739
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jscad_fiber11.Colorize, { color: "#555", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jscad_fiber11.Translate, { offset: center, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jscad_fiber11.Translate, { offset: { x: 0, y: 0, z: height10 / 2 + heightAboveSurface2 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jscad_fiber11.RoundedCuboid, { roundRadius: 0.2, size: [width10, length, height10] }) }) }) });
78740
78740
  };
78741
78741
 
78742
78742
  // lib/ExtrudedPads.tsx
@@ -78769,22 +78769,25 @@ var FootprintPlatedHole = ({ hole }) => {
78769
78769
  // lib/ExtrudedPads.tsx
78770
78770
  var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
78771
78771
  var ExtrudedPads = ({
78772
- soup,
78772
+ circuitJson,
78773
78773
  footprint
78774
78774
  }) => {
78775
- if (!soup && footprint) {
78776
- soup = fp2.string(footprint).circuitJson();
78775
+ if (!circuitJson && footprint) {
78776
+ circuitJson = fp2.string(footprint).circuitJson();
78777
78777
  }
78778
- if (!soup) throw new Error("No soup or footprint provided to ExtrudedPads");
78778
+ if (!circuitJson)
78779
+ throw new Error("No circuit json or footprint provided to ExtrudedPads");
78779
78780
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
78780
- soup.filter((s) => s.type === "pcb_smtpad").map((pad, i) => (
78781
+ circuitJson.filter((s) => s.type === "pcb_smtpad").map((pad, i) => (
78781
78782
  // biome-ignore lint/suspicious/noArrayIndexKey:
78782
78783
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FootprintPad, { pad }, i)
78783
78784
  )),
78784
- soup.filter((s) => s.type === "pcb_plated_hole").map((hole, i) => (
78785
- // biome-ignore lint/suspicious/noArrayIndexKey:
78786
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FootprintPlatedHole, { hole }, i)
78787
- ))
78785
+ circuitJson.filter((s) => s.type === "pcb_plated_hole").map((hole, i) => {
78786
+ return (
78787
+ // biome-ignore lint/suspicious/noArrayIndexKey:
78788
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FootprintPlatedHole, { hole }, i)
78789
+ );
78790
+ })
78788
78791
  ] });
78789
78792
  };
78790
78793
 
@@ -78882,6 +78885,8 @@ var svgPathPoints = normalizeOnY([
78882
78885
  { x: 22, y: 111 },
78883
78886
  { x: 20, y: 109 }
78884
78887
  ]);
78888
+ var DIP_PIN_HEIGHT = 5.47;
78889
+ var heightAboveSurface = 0.5;
78885
78890
  var DipPinLeg = ({ x, y, z }) => {
78886
78891
  const isRotated = x > 0;
78887
78892
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
@@ -78927,7 +78932,7 @@ var Dip = ({
78927
78932
  {
78928
78933
  x: xRow * crossBodyPinWidth / 2,
78929
78934
  y: yRow * pitch - (numPinsOnEachSide - 1) / 2 * pitch,
78930
- z: 5.47 / 2
78935
+ z: DIP_PIN_HEIGHT / 2 + heightAboveSurface
78931
78936
  },
78932
78937
  i
78933
78938
  );
@@ -78937,9 +78942,9 @@ var Dip = ({
78937
78942
  {
78938
78943
  width: bodyWidth,
78939
78944
  length: numPinsOnEachSide * pitch + 0.5,
78940
- height: 5.1 - 0.5,
78941
- heightAboveSurface: 0.5,
78942
- center: { x: 0, y: 0, z: 0 }
78945
+ height: DIP_PIN_HEIGHT - heightAboveSurface,
78946
+ heightAboveSurface,
78947
+ center: { x: 0, y: 0, z: heightAboveSurface }
78943
78948
  }
78944
78949
  )
78945
78950
  ] });
@@ -78985,37 +78990,38 @@ var Tssop = ({
78985
78990
  pitch,
78986
78991
  bodyWidth
78987
78992
  }) => {
78988
- const sidePinLength = Math.ceil(pinCount / 2);
78993
+ const sidePinCount = Math.ceil(pinCount / 2);
78989
78994
  const fullLength10 = pitch * pinCount / 2 + leadWidth / 2;
78990
- const pinOffsetToCenter = (sidePinLength - 1) * pitch / 2;
78995
+ const pinOffsetToCenter = (sidePinCount - 1) * pitch / 2;
78996
+ const leadThickness = 0.25;
78991
78997
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
78992
- Array.from({ length: sidePinLength }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
78998
+ Array.from({ length: sidePinCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
78993
78999
  SmdChipLead,
78994
79000
  {
78995
79001
  position: {
78996
- x: -bodyWidth / 2 - 0.9,
79002
+ x: -bodyWidth / 2 - leadLength,
78997
79003
  y: i * pitch - pinOffsetToCenter,
78998
- z: 0
79004
+ z: leadThickness / 2
78999
79005
  },
79000
79006
  width: leadWidth,
79001
- thickness: 0.25,
79007
+ thickness: leadThickness,
79002
79008
  padContactLength: leadLength,
79003
- bodyDistance: leadLength + 0.4,
79009
+ bodyDistance: leadLength,
79004
79010
  height: 0.8
79005
79011
  },
79006
79012
  i
79007
79013
  )),
79008
- Array.from({ length: sidePinLength }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
79014
+ Array.from({ length: sidePinCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
79009
79015
  SmdChipLead,
79010
79016
  {
79011
79017
  rotation: Math.PI,
79012
79018
  position: {
79013
- x: bodyWidth / 2 + 0.9,
79019
+ x: bodyWidth / 2 + leadLength,
79014
79020
  y: i * pitch - pinOffsetToCenter,
79015
- z: 0
79021
+ z: leadThickness / 2
79016
79022
  },
79017
79023
  width: leadWidth,
79018
- thickness: 0.25,
79024
+ thickness: leadThickness,
79019
79025
  padContactLength: leadLength,
79020
79026
  bodyDistance: leadLength + 0.4,
79021
79027
  height: 0.8
@@ -79025,7 +79031,7 @@ var Tssop = ({
79025
79031
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
79026
79032
  ChipBody,
79027
79033
  {
79028
- center: { x: 0, y: 0, z: 0 },
79034
+ center: { x: 0, y: 0, z: leadThickness / 2 },
79029
79035
  width: bodyWidth,
79030
79036
  length: fullLength10,
79031
79037
  height: 1.5
@@ -79062,7 +79068,7 @@ var QFP = ({
79062
79068
  position: {
79063
79069
  x: -fullWidth / 2,
79064
79070
  y: i * pitch - pinOffsetToCenter,
79065
- z: 0
79071
+ z: leadThickness / 2
79066
79072
  },
79067
79073
  width: leadWidth,
79068
79074
  thickness: leadThickness,
@@ -79079,7 +79085,7 @@ var QFP = ({
79079
79085
  position: {
79080
79086
  x: fullWidth / 2,
79081
79087
  y: i * pitch - pinOffsetToCenter,
79082
- z: 0
79088
+ z: leadThickness / 2
79083
79089
  },
79084
79090
  width: leadWidth,
79085
79091
  thickness: leadThickness,
@@ -79096,7 +79102,7 @@ var QFP = ({
79096
79102
  position: {
79097
79103
  x: i * pitch - pinOffsetToCenter,
79098
79104
  y: -fullLength10 / 2,
79099
- z: 0
79105
+ z: leadThickness / 2
79100
79106
  },
79101
79107
  width: leadWidth,
79102
79108
  thickness: leadThickness,
@@ -79113,7 +79119,7 @@ var QFP = ({
79113
79119
  position: {
79114
79120
  x: i * pitch - pinOffsetToCenter,
79115
79121
  y: fullLength10 / 2,
79116
- z: 0
79122
+ z: leadThickness / 2
79117
79123
  },
79118
79124
  width: leadWidth,
79119
79125
  thickness: leadThickness,
@@ -79126,7 +79132,7 @@ var QFP = ({
79126
79132
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
79127
79133
  ChipBody,
79128
79134
  {
79129
- center: { x: 0, y: 0, z: leadHeight / 2 },
79135
+ center: { x: 0, y: 0, z: leadThickness / 2 },
79130
79136
  width: bodyWidth,
79131
79137
  length: bodyLength10,
79132
79138
  height: 1.5
@@ -79392,7 +79398,7 @@ var QFN = ({
79392
79398
  pinPositions.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
79393
79399
  import_jscad_fiber17.Cuboid,
79394
79400
  {
79395
- center: { x: p.x, y: p.y, z: 0 },
79401
+ center: { x: p.x, y: p.y, z: thermalPadThickness / 2 },
79396
79402
  size: [p.pw, p.pl, thermalPadThickness]
79397
79403
  },
79398
79404
  i
@@ -79400,7 +79406,7 @@ var QFN = ({
79400
79406
  thermalPadSize?.length !== void 0 && thermalPadSize?.width !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
79401
79407
  import_jscad_fiber17.Cuboid,
79402
79408
  {
79403
- center: { x: 0, y: 0, z: 0 },
79409
+ center: { x: 0, y: 0, z: thermalPadThickness / 2 },
79404
79410
  size: [
79405
79411
  thermalPadSize.width,
79406
79412
  thermalPadSize.length,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jscad-electronics",
3
3
  "type": "module",
4
- "version": "0.0.24",
4
+ "version": "0.0.25",
5
5
  "main": "./dist/index.js",
6
6
  "repository": {
7
7
  "type": "git",
@@ -32,7 +32,7 @@
32
32
  "vite-tsconfig-paths": "^5.0.1"
33
33
  },
34
34
  "dependencies": {
35
- "@tscircuit/footprinter": "^0.0.87",
35
+ "@tscircuit/footprinter": "^0.0.124",
36
36
  "circuit-json": "^0.0.92"
37
37
  }
38
38
  }