jscad-electronics 0.0.71 → 0.0.73

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/vanilla.js CHANGED
@@ -57,7 +57,8 @@ var ChipBody = ({
57
57
  notchPosition,
58
58
  notchRotation = [0, 0, 0],
59
59
  notchLength = 0.5,
60
- notchWidth = 0.25
60
+ notchWidth = 0.25,
61
+ chamferSize = 0
61
62
  }) => {
62
63
  const straightHeight = height10 * straightHeightRatio;
63
64
  const taperHeight = height10 - straightHeight;
@@ -82,10 +83,32 @@ var ChipBody = ({
82
83
  /* @__PURE__ */ jsx(Translate, { z: straightHeight + taperHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [faceWidth, faceLength, 0.01] }) })
83
84
  ] })
84
85
  ] });
86
+ const chamferCutout = (xPos, yPos) => /* @__PURE__ */ jsx(Translate, { offset: { x: xPos, y: yPos, z: 0 }, children: /* @__PURE__ */ jsx(Rotate, { rotation: [0, 0, Math.PI / 4], children: /* @__PURE__ */ jsx(
87
+ Cuboid,
88
+ {
89
+ size: [
90
+ chamferSize * Math.SQRT2,
91
+ chamferSize * Math.SQRT2,
92
+ height10 * 3
93
+ ]
94
+ }
95
+ ) }) });
96
+ let finalBody = body;
97
+ if (chamferSize > 0) {
98
+ const xOffset = width10 / 2;
99
+ const yOffset = length / 2;
100
+ finalBody = /* @__PURE__ */ jsxs(Subtract, { children: [
101
+ body,
102
+ chamferCutout(xOffset, yOffset),
103
+ chamferCutout(-xOffset, yOffset),
104
+ chamferCutout(xOffset, -yOffset),
105
+ chamferCutout(-xOffset, -yOffset)
106
+ ] });
107
+ }
85
108
  return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Translate, { offset: center, children: /* @__PURE__ */ jsx(Translate, { offset: { x: 0, y: 0, z: heightAboveSurface2 }, children: includeNotch ? /* @__PURE__ */ jsxs(Subtract, { children: [
86
- body,
109
+ finalBody,
87
110
  /* @__PURE__ */ jsx(Translate, { offset: actualNotchPosition, children: /* @__PURE__ */ jsx(Rotate, { rotation: notchRotation, children: /* @__PURE__ */ jsx(Cylinder, { radius: notchLength, height: notchWidth }) }) })
88
- ] }) : body }) }) });
111
+ ] }) : finalBody }) }) });
89
112
  };
90
113
 
91
114
  // lib/utils/range.ts
@@ -2051,6 +2074,105 @@ var SOT223 = () => {
2051
2074
  ] });
2052
2075
  };
2053
2076
 
2077
+ // lib/tqfp.tsx
2078
+ var TQFP = () => {
2079
+ const pinCount = 64;
2080
+ const pitch = 0.5;
2081
+ const leadWidth = 0.2;
2082
+ const padContactLength = 0.45;
2083
+ const bodyWidth = 9;
2084
+ const sidePinCount = pinCount / 4;
2085
+ const bodyLength10 = bodyWidth;
2086
+ const pinOffsetToCenter = (sidePinCount - 1) * pitch / 2;
2087
+ const fullLength10 = bodyLength10 + 2 * padContactLength + 0.6;
2088
+ const fullWidth = fullLength10;
2089
+ const leadHeight = 0.8;
2090
+ const leadThickness = 0.25;
2091
+ const bodyDistance = (fullWidth - bodyWidth) / 2 + 0.2;
2092
+ return /* @__PURE__ */ jsxs(Fragment2, { children: [
2093
+ Array.from({ length: sidePinCount }).map((_, i) => /* @__PURE__ */ jsx(
2094
+ SmdChipLead,
2095
+ {
2096
+ position: {
2097
+ x: -fullWidth / 2,
2098
+ y: i * pitch - pinOffsetToCenter,
2099
+ z: leadThickness / 2
2100
+ },
2101
+ width: leadWidth,
2102
+ thickness: leadThickness,
2103
+ padContactLength,
2104
+ bodyDistance,
2105
+ height: leadHeight
2106
+ },
2107
+ `left-${i}`
2108
+ )),
2109
+ Array.from({ length: sidePinCount }).map((_, i) => /* @__PURE__ */ jsx(
2110
+ SmdChipLead,
2111
+ {
2112
+ rotation: Math.PI,
2113
+ position: {
2114
+ x: fullWidth / 2,
2115
+ y: i * pitch - pinOffsetToCenter,
2116
+ z: leadThickness / 2
2117
+ },
2118
+ width: leadWidth,
2119
+ thickness: leadThickness,
2120
+ padContactLength,
2121
+ bodyDistance,
2122
+ height: leadHeight
2123
+ },
2124
+ `right-${i}`
2125
+ )),
2126
+ Array.from({ length: sidePinCount }).map((_, i) => /* @__PURE__ */ jsx(
2127
+ SmdChipLead,
2128
+ {
2129
+ rotation: Math.PI / 2,
2130
+ position: {
2131
+ x: i * pitch - pinOffsetToCenter,
2132
+ y: -fullLength10 / 2,
2133
+ z: leadThickness / 2
2134
+ },
2135
+ width: leadWidth,
2136
+ thickness: leadThickness,
2137
+ padContactLength,
2138
+ bodyDistance,
2139
+ height: leadHeight
2140
+ },
2141
+ `bottom-${i}`
2142
+ )),
2143
+ Array.from({ length: sidePinCount }).map((_, i) => /* @__PURE__ */ jsx(
2144
+ SmdChipLead,
2145
+ {
2146
+ rotation: -Math.PI / 2,
2147
+ position: {
2148
+ x: i * pitch - pinOffsetToCenter,
2149
+ y: fullLength10 / 2,
2150
+ z: leadThickness / 2
2151
+ },
2152
+ width: leadWidth,
2153
+ thickness: leadThickness,
2154
+ padContactLength,
2155
+ bodyDistance,
2156
+ height: leadHeight
2157
+ },
2158
+ `top-${i}`
2159
+ )),
2160
+ /* @__PURE__ */ jsx(
2161
+ ChipBody,
2162
+ {
2163
+ center: { x: 0, y: 0, z: leadThickness / 2 },
2164
+ width: bodyWidth,
2165
+ length: bodyLength10,
2166
+ height: 1.2,
2167
+ chamferSize: 0.6,
2168
+ taperRatio: 0.05,
2169
+ notchPosition: { x: 3.5, y: 3.5, z: 1.2 }
2170
+ }
2171
+ )
2172
+ ] });
2173
+ };
2174
+ var tqfp_default = TQFP;
2175
+
2054
2176
  // lib/SOT-323.tsx
2055
2177
  var SOT323 = () => {
2056
2178
  const fullWidth = 2.05;
@@ -2169,6 +2291,8 @@ var Footprinter3d = ({ footprint }) => {
2169
2291
  bodyWidth: fpJson.w
2170
2292
  }
2171
2293
  );
2294
+ case "tqfp":
2295
+ return /* @__PURE__ */ jsx(tqfp_default, {});
2172
2296
  case "qfn":
2173
2297
  const hasThermalPad = typeof fpJson.thermalpad?.x === "number" && typeof fpJson.thermalpad?.y === "number";
2174
2298
  return /* @__PURE__ */ jsx(