jscad-electronics 0.0.70 → 0.0.72
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 +7 -2
- package/dist/index.js +271 -63
- package/dist/index.js.map +1 -1
- package/dist/vanilla.js +207 -3
- package/dist/vanilla.js.map +1 -1
- package/package.json +2 -2
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
|
-
|
|
109
|
+
finalBody,
|
|
87
110
|
/* @__PURE__ */ jsx(Translate, { offset: actualNotchPosition, children: /* @__PURE__ */ jsx(Rotate, { rotation: notchRotation, children: /* @__PURE__ */ jsx(Cylinder, { radius: notchLength, height: notchWidth }) }) })
|
|
88
|
-
] }) :
|
|
111
|
+
] }) : finalBody }) }) });
|
|
89
112
|
};
|
|
90
113
|
|
|
91
114
|
// lib/utils/range.ts
|
|
@@ -2051,6 +2074,183 @@ 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
|
+
|
|
2176
|
+
// lib/SOT-323.tsx
|
|
2177
|
+
var SOT323 = () => {
|
|
2178
|
+
const fullWidth = 2.05;
|
|
2179
|
+
const bodyWidth = 1.25;
|
|
2180
|
+
const bodyLength10 = 2;
|
|
2181
|
+
const bodyHeight = 0.9;
|
|
2182
|
+
const leadWidth = 0.3;
|
|
2183
|
+
const leadThickness = 0.18;
|
|
2184
|
+
const leadHeight = 0.65;
|
|
2185
|
+
const padContactLength = 0.2;
|
|
2186
|
+
const padPitch = 0.65;
|
|
2187
|
+
const extendedBodyDistance = fullWidth - bodyWidth;
|
|
2188
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
2189
|
+
/* @__PURE__ */ jsx(
|
|
2190
|
+
SmdChipLead,
|
|
2191
|
+
{
|
|
2192
|
+
rotation: Math.PI,
|
|
2193
|
+
position: {
|
|
2194
|
+
x: fullWidth / 2 + extendedBodyDistance / 4,
|
|
2195
|
+
y: 0,
|
|
2196
|
+
z: leadThickness / 2
|
|
2197
|
+
},
|
|
2198
|
+
width: leadWidth,
|
|
2199
|
+
thickness: leadThickness,
|
|
2200
|
+
padContactLength,
|
|
2201
|
+
bodyDistance: extendedBodyDistance,
|
|
2202
|
+
height: leadHeight
|
|
2203
|
+
},
|
|
2204
|
+
4
|
|
2205
|
+
),
|
|
2206
|
+
/* @__PURE__ */ jsx(
|
|
2207
|
+
SmdChipLead,
|
|
2208
|
+
{
|
|
2209
|
+
position: {
|
|
2210
|
+
x: -fullWidth / 2 - extendedBodyDistance / 4,
|
|
2211
|
+
y: -padPitch,
|
|
2212
|
+
z: leadThickness / 2
|
|
2213
|
+
},
|
|
2214
|
+
width: leadWidth,
|
|
2215
|
+
thickness: leadThickness,
|
|
2216
|
+
padContactLength,
|
|
2217
|
+
bodyDistance: extendedBodyDistance,
|
|
2218
|
+
height: leadHeight
|
|
2219
|
+
},
|
|
2220
|
+
1
|
|
2221
|
+
),
|
|
2222
|
+
/* @__PURE__ */ jsx(
|
|
2223
|
+
SmdChipLead,
|
|
2224
|
+
{
|
|
2225
|
+
position: {
|
|
2226
|
+
x: -fullWidth / 2 - extendedBodyDistance / 4,
|
|
2227
|
+
y: padPitch,
|
|
2228
|
+
z: leadThickness / 2
|
|
2229
|
+
},
|
|
2230
|
+
width: leadWidth,
|
|
2231
|
+
thickness: leadThickness,
|
|
2232
|
+
padContactLength,
|
|
2233
|
+
bodyDistance: extendedBodyDistance,
|
|
2234
|
+
height: leadHeight
|
|
2235
|
+
},
|
|
2236
|
+
2
|
|
2237
|
+
),
|
|
2238
|
+
/* @__PURE__ */ jsx(
|
|
2239
|
+
ChipBody,
|
|
2240
|
+
{
|
|
2241
|
+
center: { x: 0, y: 0, z: 0 },
|
|
2242
|
+
width: bodyWidth,
|
|
2243
|
+
length: bodyLength10,
|
|
2244
|
+
height: bodyHeight,
|
|
2245
|
+
includeNotch: false,
|
|
2246
|
+
taperRatio: 0.06,
|
|
2247
|
+
straightHeightRatio: 0.7,
|
|
2248
|
+
heightAboveSurface: 0.05
|
|
2249
|
+
}
|
|
2250
|
+
)
|
|
2251
|
+
] });
|
|
2252
|
+
};
|
|
2253
|
+
|
|
2054
2254
|
// lib/Footprinter3d.tsx
|
|
2055
2255
|
var Footprinter3d = ({ footprint }) => {
|
|
2056
2256
|
const fpJson = fp.string(footprint).json();
|
|
@@ -2091,6 +2291,8 @@ var Footprinter3d = ({ footprint }) => {
|
|
|
2091
2291
|
bodyWidth: fpJson.w
|
|
2092
2292
|
}
|
|
2093
2293
|
);
|
|
2294
|
+
case "tqfp":
|
|
2295
|
+
return /* @__PURE__ */ jsx(tqfp_default, {});
|
|
2094
2296
|
case "qfn":
|
|
2095
2297
|
const hasThermalPad = typeof fpJson.thermalpad?.x === "number" && typeof fpJson.thermalpad?.y === "number";
|
|
2096
2298
|
return /* @__PURE__ */ jsx(
|
|
@@ -2139,6 +2341,8 @@ var Footprinter3d = ({ footprint }) => {
|
|
|
2139
2341
|
return /* @__PURE__ */ jsx(SOT_235_default, {});
|
|
2140
2342
|
case "sot223":
|
|
2141
2343
|
return /* @__PURE__ */ jsx(SOT223, {});
|
|
2344
|
+
case "sot323":
|
|
2345
|
+
return /* @__PURE__ */ jsx(SOT323, {});
|
|
2142
2346
|
case "pushbutton":
|
|
2143
2347
|
return /* @__PURE__ */ jsx(
|
|
2144
2348
|
PushButton,
|