jscad-electronics 0.0.69 → 0.0.70
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 +18 -2
- package/dist/index.js +193 -81
- package/dist/index.js.map +1 -1
- package/dist/vanilla.js +132 -22
- package/dist/vanilla.js.map +1 -1
- package/package.json +1 -1
package/dist/vanilla.js
CHANGED
|
@@ -47,31 +47,45 @@ var ChipBody = ({
|
|
|
47
47
|
width: width10,
|
|
48
48
|
length,
|
|
49
49
|
height: height10,
|
|
50
|
-
heightAboveSurface: heightAboveSurface2 = 0.15
|
|
50
|
+
heightAboveSurface: heightAboveSurface2 = 0.15,
|
|
51
|
+
color = "#555",
|
|
52
|
+
taperRatio = 0.12,
|
|
53
|
+
faceRatio = 0.75,
|
|
54
|
+
straightHeightRatio = 0.5,
|
|
55
|
+
includeNotch = true,
|
|
56
|
+
notchRadius,
|
|
57
|
+
notchPosition,
|
|
58
|
+
notchRotation = [0, 0, 0],
|
|
59
|
+
notchLength = 0.5,
|
|
60
|
+
notchWidth = 0.25
|
|
51
61
|
}) => {
|
|
52
|
-
const straightHeight = height10 *
|
|
62
|
+
const straightHeight = height10 * straightHeightRatio;
|
|
53
63
|
const taperHeight = height10 - straightHeight;
|
|
54
|
-
const taperInset = Math.min(width10, length) *
|
|
55
|
-
const faceWidth = Math.max(width10 - taperInset, width10 *
|
|
56
|
-
const faceLength = Math.max(length - taperInset, length *
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
] }),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10, length, 0.01] }) }),
|
|
70
|
-
/* @__PURE__ */ jsx(Translate, { z: straightHeight + taperHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [faceWidth, faceLength, 0.01] }) })
|
|
71
|
-
] })
|
|
64
|
+
const taperInset = Math.min(width10, length) * taperRatio;
|
|
65
|
+
const faceWidth = Math.max(width10 - taperInset, width10 * faceRatio);
|
|
66
|
+
const faceLength = Math.max(length - taperInset, length * faceRatio);
|
|
67
|
+
const defaultNotchRadius = Math.min(width10, length) * 0.12;
|
|
68
|
+
const actualNotchRadius = notchRadius ?? defaultNotchRadius;
|
|
69
|
+
const defaultNotchPosition = {
|
|
70
|
+
x: 0,
|
|
71
|
+
y: length / 2 - actualNotchRadius * 0.25,
|
|
72
|
+
z: height10
|
|
73
|
+
};
|
|
74
|
+
const actualNotchPosition = notchPosition ?? defaultNotchPosition;
|
|
75
|
+
const body = /* @__PURE__ */ jsxs(Union, { children: [
|
|
76
|
+
/* @__PURE__ */ jsxs(Hull, { children: [
|
|
77
|
+
/* @__PURE__ */ jsx(Translate, { z: 5e-3, children: /* @__PURE__ */ jsx(Cuboid, { size: [faceWidth, faceLength, 0.01] }) }),
|
|
78
|
+
/* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10, length, 0.01] }) })
|
|
72
79
|
] }),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
80
|
+
/* @__PURE__ */ jsxs(Hull, { children: [
|
|
81
|
+
/* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10, length, 0.01] }) }),
|
|
82
|
+
/* @__PURE__ */ jsx(Translate, { z: straightHeight + taperHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [faceWidth, faceLength, 0.01] }) })
|
|
83
|
+
] })
|
|
84
|
+
] });
|
|
85
|
+
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,
|
|
87
|
+
/* @__PURE__ */ jsx(Translate, { offset: actualNotchPosition, children: /* @__PURE__ */ jsx(Rotate, { rotation: notchRotation, children: /* @__PURE__ */ jsx(Cylinder, { radius: notchLength, height: notchWidth }) }) })
|
|
88
|
+
] }) : body }) }) });
|
|
75
89
|
};
|
|
76
90
|
|
|
77
91
|
// lib/utils/range.ts
|
|
@@ -1943,6 +1957,100 @@ var SOD923 = () => {
|
|
|
1943
1957
|
] });
|
|
1944
1958
|
};
|
|
1945
1959
|
|
|
1960
|
+
// lib/SOT-223.tsx
|
|
1961
|
+
var SOT223 = () => {
|
|
1962
|
+
const fullWidth = 6.6;
|
|
1963
|
+
const bodyWidth = 3.5;
|
|
1964
|
+
const bodyLength10 = 6.5;
|
|
1965
|
+
const bodyHeight = 1.7;
|
|
1966
|
+
const leadWidth = 0.7;
|
|
1967
|
+
const leftLeadWidth = 3;
|
|
1968
|
+
const leadThickness = 0.25;
|
|
1969
|
+
const leadHeight = 0.75;
|
|
1970
|
+
const padContactLength = 0.5;
|
|
1971
|
+
const padPitch = 2.3;
|
|
1972
|
+
const extendedBodyDistance = fullWidth - bodyWidth;
|
|
1973
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
1974
|
+
/* @__PURE__ */ jsx(
|
|
1975
|
+
SmdChipLead,
|
|
1976
|
+
{
|
|
1977
|
+
rotation: Math.PI,
|
|
1978
|
+
position: {
|
|
1979
|
+
x: fullWidth / 2 + extendedBodyDistance / 4,
|
|
1980
|
+
y: 0,
|
|
1981
|
+
z: leadThickness / 2
|
|
1982
|
+
},
|
|
1983
|
+
width: leftLeadWidth,
|
|
1984
|
+
thickness: leadThickness,
|
|
1985
|
+
padContactLength,
|
|
1986
|
+
bodyDistance: extendedBodyDistance,
|
|
1987
|
+
height: leadHeight
|
|
1988
|
+
},
|
|
1989
|
+
4
|
|
1990
|
+
),
|
|
1991
|
+
/* @__PURE__ */ jsx(
|
|
1992
|
+
SmdChipLead,
|
|
1993
|
+
{
|
|
1994
|
+
position: {
|
|
1995
|
+
x: -fullWidth / 2 - extendedBodyDistance / 4,
|
|
1996
|
+
y: 0,
|
|
1997
|
+
z: leadThickness / 2
|
|
1998
|
+
},
|
|
1999
|
+
width: leadWidth,
|
|
2000
|
+
thickness: leadThickness,
|
|
2001
|
+
padContactLength,
|
|
2002
|
+
bodyDistance: extendedBodyDistance,
|
|
2003
|
+
height: leadHeight
|
|
2004
|
+
},
|
|
2005
|
+
3
|
|
2006
|
+
),
|
|
2007
|
+
/* @__PURE__ */ jsx(
|
|
2008
|
+
SmdChipLead,
|
|
2009
|
+
{
|
|
2010
|
+
position: {
|
|
2011
|
+
x: -fullWidth / 2 - extendedBodyDistance / 4,
|
|
2012
|
+
y: -padPitch,
|
|
2013
|
+
z: leadThickness / 2
|
|
2014
|
+
},
|
|
2015
|
+
width: leadWidth,
|
|
2016
|
+
thickness: leadThickness,
|
|
2017
|
+
padContactLength,
|
|
2018
|
+
bodyDistance: extendedBodyDistance,
|
|
2019
|
+
height: leadHeight
|
|
2020
|
+
},
|
|
2021
|
+
1
|
|
2022
|
+
),
|
|
2023
|
+
/* @__PURE__ */ jsx(
|
|
2024
|
+
SmdChipLead,
|
|
2025
|
+
{
|
|
2026
|
+
position: {
|
|
2027
|
+
x: -fullWidth / 2 - extendedBodyDistance / 4,
|
|
2028
|
+
y: padPitch,
|
|
2029
|
+
z: leadThickness / 2
|
|
2030
|
+
},
|
|
2031
|
+
width: leadWidth,
|
|
2032
|
+
thickness: leadThickness,
|
|
2033
|
+
padContactLength,
|
|
2034
|
+
bodyDistance: extendedBodyDistance,
|
|
2035
|
+
height: leadHeight
|
|
2036
|
+
},
|
|
2037
|
+
2
|
|
2038
|
+
),
|
|
2039
|
+
/* @__PURE__ */ jsx(
|
|
2040
|
+
ChipBody,
|
|
2041
|
+
{
|
|
2042
|
+
center: { x: 0, y: 0, z: 0 },
|
|
2043
|
+
width: bodyWidth,
|
|
2044
|
+
length: bodyLength10,
|
|
2045
|
+
height: bodyHeight,
|
|
2046
|
+
includeNotch: false,
|
|
2047
|
+
taperRatio: 0.06,
|
|
2048
|
+
straightHeightRatio: 0.45
|
|
2049
|
+
}
|
|
2050
|
+
)
|
|
2051
|
+
] });
|
|
2052
|
+
};
|
|
2053
|
+
|
|
1946
2054
|
// lib/Footprinter3d.tsx
|
|
1947
2055
|
var Footprinter3d = ({ footprint }) => {
|
|
1948
2056
|
const fpJson = fp.string(footprint).json();
|
|
@@ -2029,6 +2137,8 @@ var Footprinter3d = ({ footprint }) => {
|
|
|
2029
2137
|
}
|
|
2030
2138
|
case "sot235":
|
|
2031
2139
|
return /* @__PURE__ */ jsx(SOT_235_default, {});
|
|
2140
|
+
case "sot223":
|
|
2141
|
+
return /* @__PURE__ */ jsx(SOT223, {});
|
|
2032
2142
|
case "pushbutton":
|
|
2033
2143
|
return /* @__PURE__ */ jsx(
|
|
2034
2144
|
PushButton,
|