jscad-electronics 0.0.69 → 0.0.71
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 +20 -2
- package/dist/index.js +275 -81
- package/dist/index.js.map +1 -1
- package/dist/vanilla.js +212 -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,178 @@ 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
|
+
|
|
2054
|
+
// lib/SOT-323.tsx
|
|
2055
|
+
var SOT323 = () => {
|
|
2056
|
+
const fullWidth = 2.05;
|
|
2057
|
+
const bodyWidth = 1.25;
|
|
2058
|
+
const bodyLength10 = 2;
|
|
2059
|
+
const bodyHeight = 0.9;
|
|
2060
|
+
const leadWidth = 0.3;
|
|
2061
|
+
const leadThickness = 0.18;
|
|
2062
|
+
const leadHeight = 0.65;
|
|
2063
|
+
const padContactLength = 0.2;
|
|
2064
|
+
const padPitch = 0.65;
|
|
2065
|
+
const extendedBodyDistance = fullWidth - bodyWidth;
|
|
2066
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
2067
|
+
/* @__PURE__ */ jsx(
|
|
2068
|
+
SmdChipLead,
|
|
2069
|
+
{
|
|
2070
|
+
rotation: Math.PI,
|
|
2071
|
+
position: {
|
|
2072
|
+
x: fullWidth / 2 + extendedBodyDistance / 4,
|
|
2073
|
+
y: 0,
|
|
2074
|
+
z: leadThickness / 2
|
|
2075
|
+
},
|
|
2076
|
+
width: leadWidth,
|
|
2077
|
+
thickness: leadThickness,
|
|
2078
|
+
padContactLength,
|
|
2079
|
+
bodyDistance: extendedBodyDistance,
|
|
2080
|
+
height: leadHeight
|
|
2081
|
+
},
|
|
2082
|
+
4
|
|
2083
|
+
),
|
|
2084
|
+
/* @__PURE__ */ jsx(
|
|
2085
|
+
SmdChipLead,
|
|
2086
|
+
{
|
|
2087
|
+
position: {
|
|
2088
|
+
x: -fullWidth / 2 - extendedBodyDistance / 4,
|
|
2089
|
+
y: -padPitch,
|
|
2090
|
+
z: leadThickness / 2
|
|
2091
|
+
},
|
|
2092
|
+
width: leadWidth,
|
|
2093
|
+
thickness: leadThickness,
|
|
2094
|
+
padContactLength,
|
|
2095
|
+
bodyDistance: extendedBodyDistance,
|
|
2096
|
+
height: leadHeight
|
|
2097
|
+
},
|
|
2098
|
+
1
|
|
2099
|
+
),
|
|
2100
|
+
/* @__PURE__ */ jsx(
|
|
2101
|
+
SmdChipLead,
|
|
2102
|
+
{
|
|
2103
|
+
position: {
|
|
2104
|
+
x: -fullWidth / 2 - extendedBodyDistance / 4,
|
|
2105
|
+
y: padPitch,
|
|
2106
|
+
z: leadThickness / 2
|
|
2107
|
+
},
|
|
2108
|
+
width: leadWidth,
|
|
2109
|
+
thickness: leadThickness,
|
|
2110
|
+
padContactLength,
|
|
2111
|
+
bodyDistance: extendedBodyDistance,
|
|
2112
|
+
height: leadHeight
|
|
2113
|
+
},
|
|
2114
|
+
2
|
|
2115
|
+
),
|
|
2116
|
+
/* @__PURE__ */ jsx(
|
|
2117
|
+
ChipBody,
|
|
2118
|
+
{
|
|
2119
|
+
center: { x: 0, y: 0, z: 0 },
|
|
2120
|
+
width: bodyWidth,
|
|
2121
|
+
length: bodyLength10,
|
|
2122
|
+
height: bodyHeight,
|
|
2123
|
+
includeNotch: false,
|
|
2124
|
+
taperRatio: 0.06,
|
|
2125
|
+
straightHeightRatio: 0.7,
|
|
2126
|
+
heightAboveSurface: 0.05
|
|
2127
|
+
}
|
|
2128
|
+
)
|
|
2129
|
+
] });
|
|
2130
|
+
};
|
|
2131
|
+
|
|
1946
2132
|
// lib/Footprinter3d.tsx
|
|
1947
2133
|
var Footprinter3d = ({ footprint }) => {
|
|
1948
2134
|
const fpJson = fp.string(footprint).json();
|
|
@@ -2029,6 +2215,10 @@ var Footprinter3d = ({ footprint }) => {
|
|
|
2029
2215
|
}
|
|
2030
2216
|
case "sot235":
|
|
2031
2217
|
return /* @__PURE__ */ jsx(SOT_235_default, {});
|
|
2218
|
+
case "sot223":
|
|
2219
|
+
return /* @__PURE__ */ jsx(SOT223, {});
|
|
2220
|
+
case "sot323":
|
|
2221
|
+
return /* @__PURE__ */ jsx(SOT323, {});
|
|
2032
2222
|
case "pushbutton":
|
|
2033
2223
|
return /* @__PURE__ */ jsx(
|
|
2034
2224
|
PushButton,
|