jscad-electronics 0.0.60 → 0.0.61

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
@@ -175,4 +175,6 @@ declare const SMB: () => react_jsx_runtime.JSX.Element;
175
175
 
176
176
  declare const SMC: () => react_jsx_runtime.JSX.Element;
177
177
 
178
- export { A01005, A0201, A0402, A0603, A0805, A1206, A1210, A2010, A2512, BGA, ChipBody, type ChipBodyProps, ExtrudedPads, FootprintPad, FootprintPlatedHole, Footprinter3d, PinRow, QFN, QFP, SMA, SMB, SMC, SOD123, SOD523, SOT233P, SOT563, SOT723, SmdChipLead, type SmdChipLeadProps, Tssop, VSSOP };
178
+ declare const SMF: () => react_jsx_runtime.JSX.Element;
179
+
180
+ export { A01005, A0201, A0402, A0603, A0805, A1206, A1210, A2010, A2512, BGA, ChipBody, type ChipBodyProps, ExtrudedPads, FootprintPad, FootprintPlatedHole, Footprinter3d, PinRow, QFN, QFP, SMA, SMB, SMC, SMF, SOD123, SOD523, SOT233P, SOT563, SOT723, SmdChipLead, type SmdChipLeadProps, Tssop, VSSOP };
package/dist/index.js CHANGED
@@ -1895,15 +1895,63 @@ var SMC = () => {
1895
1895
  ] });
1896
1896
  };
1897
1897
 
1898
+ // lib/SMF.tsx
1899
+ import { Colorize as Colorize14, Cuboid as Cuboid22, Hull as Hull8, Translate as Translate13, Union as Union9 } from "jscad-fiber";
1900
+ import { Fragment as Fragment26, jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
1901
+ var SMF = () => {
1902
+ const fullWidth = 2.9;
1903
+ const bodyLength10 = 1.9;
1904
+ const bodyHeight = 1.08;
1905
+ const padWidth = 1.2;
1906
+ const padLength = 1;
1907
+ const padThickness = 0.25;
1908
+ const bodyWidth = fullWidth;
1909
+ const leftPadCenterX = -1.3;
1910
+ const rightPadCenterX = 1.3;
1911
+ const taperOffset = 0.2;
1912
+ const straightHeight = bodyHeight * 0.5;
1913
+ const Body = /* @__PURE__ */ jsx30(Colorize14, { color: "#222", children: /* @__PURE__ */ jsxs28(Union9, { children: [
1914
+ /* @__PURE__ */ jsx30(Translate13, { z: straightHeight / 2, children: /* @__PURE__ */ jsx30(Cuboid22, { size: [bodyWidth, bodyLength10, straightHeight] }) }),
1915
+ /* @__PURE__ */ jsxs28(Hull8, { children: [
1916
+ /* @__PURE__ */ jsx30(Translate13, { z: straightHeight, children: /* @__PURE__ */ jsx30(Cuboid22, { size: [bodyWidth, bodyLength10, 0.01] }) }),
1917
+ /* @__PURE__ */ jsx30(Translate13, { z: bodyHeight, children: /* @__PURE__ */ jsx30(
1918
+ Cuboid22,
1919
+ {
1920
+ size: [bodyWidth - taperOffset, bodyLength10 - taperOffset, 0.01]
1921
+ }
1922
+ ) })
1923
+ ] })
1924
+ ] }) });
1925
+ return /* @__PURE__ */ jsxs28(Fragment26, { children: [
1926
+ /* @__PURE__ */ jsx30(
1927
+ Cuboid22,
1928
+ {
1929
+ color: "#ccc",
1930
+ size: [padLength, padWidth, padThickness],
1931
+ center: [leftPadCenterX, 0, padThickness / 2]
1932
+ }
1933
+ ),
1934
+ /* @__PURE__ */ jsx30(
1935
+ Cuboid22,
1936
+ {
1937
+ color: "#ccc",
1938
+ size: [padLength, padWidth, padThickness],
1939
+ center: [rightPadCenterX, 0, padThickness / 2]
1940
+ }
1941
+ ),
1942
+ Body
1943
+ ] });
1944
+ };
1945
+
1898
1946
  // lib/Footprinter3d.tsx
1899
- import { jsx as jsx30 } from "react/jsx-runtime";
1947
+ import { jsx as jsx31 } from "react/jsx-runtime";
1900
1948
  var Footprinter3d = ({ footprint }) => {
1901
1949
  const fpJson = fp3.string(footprint).json();
1902
1950
  switch (fpJson.fn) {
1903
1951
  case "dip":
1904
- return /* @__PURE__ */ jsx30(Dip, { numPins: fpJson.num_pins, pitch: fpJson.p, bodyWidth: fpJson.w });
1952
+ return /* @__PURE__ */ jsx31(Dip, { numPins: fpJson.num_pins, pitch: fpJson.p, bodyWidth: fpJson.w });
1905
1953
  case "tssop":
1906
- return /* @__PURE__ */ jsx30(
1954
+ return /* @__PURE__ */ jsx31(
1907
1955
  Tssop,
1908
1956
  {
1909
1957
  pinCount: fpJson.num_pins,
@@ -1914,7 +1962,7 @@ var Footprinter3d = ({ footprint }) => {
1914
1962
  }
1915
1963
  );
1916
1964
  case "vssop":
1917
- return /* @__PURE__ */ jsx30(
1965
+ return /* @__PURE__ */ jsx31(
1918
1966
  VSSOP,
1919
1967
  {
1920
1968
  pinCount: fpJson.num_pins,
@@ -1926,7 +1974,7 @@ var Footprinter3d = ({ footprint }) => {
1926
1974
  }
1927
1975
  );
1928
1976
  case "qfp":
1929
- return /* @__PURE__ */ jsx30(
1977
+ return /* @__PURE__ */ jsx31(
1930
1978
  QFP,
1931
1979
  {
1932
1980
  pinCount: fpJson.num_pins,
@@ -1938,7 +1986,7 @@ var Footprinter3d = ({ footprint }) => {
1938
1986
  );
1939
1987
  case "qfn":
1940
1988
  const hasThermalPad = typeof fpJson.thermalpad?.x === "number" && typeof fpJson.thermalpad?.y === "number";
1941
- return /* @__PURE__ */ jsx30(
1989
+ return /* @__PURE__ */ jsx31(
1942
1990
  qfn_default,
1943
1991
  {
1944
1992
  num_pins: fpJson.num_pins,
@@ -1955,35 +2003,35 @@ var Footprinter3d = ({ footprint }) => {
1955
2003
  );
1956
2004
  case "pinrow":
1957
2005
  if (fpJson.male)
1958
- return /* @__PURE__ */ jsx30(PinRow, { numberOfPins: fpJson.num_pins, pitch: fpJson.p });
2006
+ return /* @__PURE__ */ jsx31(PinRow, { numberOfPins: fpJson.num_pins, pitch: fpJson.p });
1959
2007
  if (fpJson.female)
1960
- return /* @__PURE__ */ jsx30(FemaleHeader, { numberOfPins: fpJson.num_pins, pitch: fpJson.p });
2008
+ return /* @__PURE__ */ jsx31(FemaleHeader, { numberOfPins: fpJson.num_pins, pitch: fpJson.p });
1961
2009
  case "cap": {
1962
2010
  switch (fpJson.imperial) {
1963
2011
  case "0402":
1964
- return /* @__PURE__ */ jsx30(A0402, { color: "#856c4d" });
2012
+ return /* @__PURE__ */ jsx31(A0402, { color: "#856c4d" });
1965
2013
  case "0603":
1966
- return /* @__PURE__ */ jsx30(A0603, { color: "#856c4d" });
2014
+ return /* @__PURE__ */ jsx31(A0603, { color: "#856c4d" });
1967
2015
  case "0805":
1968
- return /* @__PURE__ */ jsx30(A0805, { color: "#856c4d" });
2016
+ return /* @__PURE__ */ jsx31(A0805, { color: "#856c4d" });
1969
2017
  case "0201":
1970
- return /* @__PURE__ */ jsx30(A0201, { color: "#856c4d" });
2018
+ return /* @__PURE__ */ jsx31(A0201, { color: "#856c4d" });
1971
2019
  case "01005":
1972
- return /* @__PURE__ */ jsx30(A01005, { color: "#856c4d" });
2020
+ return /* @__PURE__ */ jsx31(A01005, { color: "#856c4d" });
1973
2021
  case "1206":
1974
- return /* @__PURE__ */ jsx30(A1206, { color: "#856c4d" });
2022
+ return /* @__PURE__ */ jsx31(A1206, { color: "#856c4d" });
1975
2023
  case "1210":
1976
- return /* @__PURE__ */ jsx30(A1210, { color: "#856c4d" });
2024
+ return /* @__PURE__ */ jsx31(A1210, { color: "#856c4d" });
1977
2025
  case "2010":
1978
- return /* @__PURE__ */ jsx30(A2010, { color: "#856c4d" });
2026
+ return /* @__PURE__ */ jsx31(A2010, { color: "#856c4d" });
1979
2027
  case "2512":
1980
- return /* @__PURE__ */ jsx30(A2512, { color: "#856c4d" });
2028
+ return /* @__PURE__ */ jsx31(A2512, { color: "#856c4d" });
1981
2029
  }
1982
2030
  }
1983
2031
  case "sot235":
1984
- return /* @__PURE__ */ jsx30(SOT_235_default, {});
2032
+ return /* @__PURE__ */ jsx31(SOT_235_default, {});
1985
2033
  case "pushbutton":
1986
- return /* @__PURE__ */ jsx30(
2034
+ return /* @__PURE__ */ jsx31(
1987
2035
  PushButton,
1988
2036
  {
1989
2037
  width: fpJson.w,
@@ -1992,7 +2040,7 @@ var Footprinter3d = ({ footprint }) => {
1992
2040
  }
1993
2041
  );
1994
2042
  case "soic":
1995
- return /* @__PURE__ */ jsx30(
2043
+ return /* @__PURE__ */ jsx31(
1996
2044
  SOIC,
1997
2045
  {
1998
2046
  pinCount: fpJson.num_pins,
@@ -2003,41 +2051,43 @@ var Footprinter3d = ({ footprint }) => {
2003
2051
  }
2004
2052
  );
2005
2053
  case "sod523":
2006
- return /* @__PURE__ */ jsx30(SOD523, {});
2054
+ return /* @__PURE__ */ jsx31(SOD523, {});
2007
2055
  case "sma":
2008
- return /* @__PURE__ */ jsx30(SMA, {});
2056
+ return /* @__PURE__ */ jsx31(SMA, {});
2009
2057
  case "smb":
2010
- return /* @__PURE__ */ jsx30(SMB, {});
2058
+ return /* @__PURE__ */ jsx31(SMB, {});
2011
2059
  case "smc":
2012
- return /* @__PURE__ */ jsx30(SMC, {});
2060
+ return /* @__PURE__ */ jsx31(SMC, {});
2061
+ case "smf":
2062
+ return /* @__PURE__ */ jsx31(SMF, {});
2013
2063
  }
2014
2064
  const colorMatch = footprint.match(/_color\(([^)]+)\)/);
2015
2065
  const color = colorMatch ? colorMatch[1] : void 0;
2016
2066
  switch (fpJson.imperial) {
2017
2067
  case "0402":
2018
- return /* @__PURE__ */ jsx30(A0402, { color });
2068
+ return /* @__PURE__ */ jsx31(A0402, { color });
2019
2069
  case "0603":
2020
- return /* @__PURE__ */ jsx30(A0603, { color });
2070
+ return /* @__PURE__ */ jsx31(A0603, { color });
2021
2071
  case "0805":
2022
- return /* @__PURE__ */ jsx30(A0805, { color });
2072
+ return /* @__PURE__ */ jsx31(A0805, { color });
2023
2073
  case "0201":
2024
- return /* @__PURE__ */ jsx30(A0201, { color });
2074
+ return /* @__PURE__ */ jsx31(A0201, { color });
2025
2075
  case "01005":
2026
- return /* @__PURE__ */ jsx30(A01005, { color });
2076
+ return /* @__PURE__ */ jsx31(A01005, { color });
2027
2077
  case "1206":
2028
- return /* @__PURE__ */ jsx30(A1206, { color });
2078
+ return /* @__PURE__ */ jsx31(A1206, { color });
2029
2079
  case "1210":
2030
- return /* @__PURE__ */ jsx30(A1210, { color });
2080
+ return /* @__PURE__ */ jsx31(A1210, { color });
2031
2081
  case "2010":
2032
- return /* @__PURE__ */ jsx30(A2010, { color });
2082
+ return /* @__PURE__ */ jsx31(A2010, { color });
2033
2083
  case "2512":
2034
- return /* @__PURE__ */ jsx30(A2512, { color });
2084
+ return /* @__PURE__ */ jsx31(A2512, { color });
2035
2085
  }
2036
2086
  return null;
2037
2087
  };
2038
2088
 
2039
2089
  // lib/SOT-23-3P.tsx
2040
- import { Fragment as Fragment26, jsx as jsx31, jsxs as jsxs28 } from "react/jsx-runtime";
2090
+ import { Fragment as Fragment27, jsx as jsx32, jsxs as jsxs29 } from "react/jsx-runtime";
2041
2091
  var SOT233P = ({ fullWidth = 2.9, fullLength: fullLength10 = 2.8 }) => {
2042
2092
  const bodyWidth = 1.3;
2043
2093
  const bodyLength10 = 2.9;
@@ -2048,8 +2098,8 @@ var SOT233P = ({ fullWidth = 2.9, fullLength: fullLength10 = 2.8 }) => {
2048
2098
  const padContactLength = 0.4;
2049
2099
  const padThickness = leadThickness / 2;
2050
2100
  const extendedBodyDistance = (fullWidth - bodyWidth) / 2 + 0.3;
2051
- return /* @__PURE__ */ jsxs28(Fragment26, { children: [
2052
- /* @__PURE__ */ jsx31(
2101
+ return /* @__PURE__ */ jsxs29(Fragment27, { children: [
2102
+ /* @__PURE__ */ jsx32(
2053
2103
  SmdChipLead,
2054
2104
  {
2055
2105
  rotation: Math.PI,
@@ -2066,7 +2116,7 @@ var SOT233P = ({ fullWidth = 2.9, fullLength: fullLength10 = 2.8 }) => {
2066
2116
  },
2067
2117
  1
2068
2118
  ),
2069
- /* @__PURE__ */ jsx31(
2119
+ /* @__PURE__ */ jsx32(
2070
2120
  SmdChipLead,
2071
2121
  {
2072
2122
  rotation: Math.PI,
@@ -2083,7 +2133,7 @@ var SOT233P = ({ fullWidth = 2.9, fullLength: fullLength10 = 2.8 }) => {
2083
2133
  },
2084
2134
  2
2085
2135
  ),
2086
- /* @__PURE__ */ jsx31(
2136
+ /* @__PURE__ */ jsx32(
2087
2137
  SmdChipLead,
2088
2138
  {
2089
2139
  position: {
@@ -2099,7 +2149,7 @@ var SOT233P = ({ fullWidth = 2.9, fullLength: fullLength10 = 2.8 }) => {
2099
2149
  },
2100
2150
  3
2101
2151
  ),
2102
- /* @__PURE__ */ jsx31(
2152
+ /* @__PURE__ */ jsx32(
2103
2153
  ChipBody,
2104
2154
  {
2105
2155
  center: { x: 0, y: 0, z: 0 },
@@ -2112,8 +2162,8 @@ var SOT233P = ({ fullWidth = 2.9, fullLength: fullLength10 = 2.8 }) => {
2112
2162
  };
2113
2163
 
2114
2164
  // lib/SOT-563.tsx
2115
- import { Cuboid as Cuboid22, Translate as Translate13, Rotate as Rotate6, Colorize as Colorize14 } from "jscad-fiber";
2116
- import { Fragment as Fragment27, jsx as jsx32, jsxs as jsxs29 } from "react/jsx-runtime";
2165
+ import { Cuboid as Cuboid23, Translate as Translate14, Rotate as Rotate6, Colorize as Colorize15 } from "jscad-fiber";
2166
+ import { Fragment as Fragment28, jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
2117
2167
  var SOT563 = ({ fullWidth = 1.94, fullLength: fullLength10 = 1.6 }) => {
2118
2168
  const bodyWidth = 1.2;
2119
2169
  const bodyLength10 = 1.6;
@@ -2123,28 +2173,28 @@ var SOT563 = ({ fullWidth = 1.94, fullLength: fullLength10 = 1.6 }) => {
2123
2173
  const leadHeight = 0.13;
2124
2174
  const leadSpacing = 0.5;
2125
2175
  const bodyZOffset = -0.4;
2126
- return /* @__PURE__ */ jsxs29(Fragment27, { children: [
2127
- /* @__PURE__ */ jsx32(Rotate6, { rotation: [45 * Math.PI, 0, 0], children: /* @__PURE__ */ jsx32(Translate13, { center: [0, 0, bodyZOffset], children: /* @__PURE__ */ jsx32(Colorize14, { color: "grey", children: /* @__PURE__ */ jsx32(Cuboid22, { size: [bodyWidth, bodyLength10, bodyHeight] }) }) }) }),
2176
+ return /* @__PURE__ */ jsxs30(Fragment28, { children: [
2177
+ /* @__PURE__ */ jsx33(Rotate6, { rotation: [45 * Math.PI, 0, 0], children: /* @__PURE__ */ jsx33(Translate14, { center: [0, 0, bodyZOffset], children: /* @__PURE__ */ jsx33(Colorize15, { color: "grey", children: /* @__PURE__ */ jsx33(Cuboid23, { size: [bodyWidth, bodyLength10, bodyHeight] }) }) }) }),
2128
2178
  [-1, 0, 1].flatMap((yOffset, index) => [
2129
2179
  // Left lead
2130
- /* @__PURE__ */ jsx32(
2131
- Translate13,
2180
+ /* @__PURE__ */ jsx33(
2181
+ Translate14,
2132
2182
  {
2133
2183
  center: [
2134
2184
  -bodyWidth / 2 - 0.03,
2135
2185
  yOffset * leadSpacing,
2136
2186
  leadHeight / 2
2137
2187
  ],
2138
- children: /* @__PURE__ */ jsx32(Cuboid22, { size: [leadLength, leadWidth, leadHeight] })
2188
+ children: /* @__PURE__ */ jsx33(Cuboid23, { size: [leadLength, leadWidth, leadHeight] })
2139
2189
  },
2140
2190
  `left-${index}`
2141
2191
  ),
2142
2192
  // Right lead
2143
- /* @__PURE__ */ jsx32(
2144
- Translate13,
2193
+ /* @__PURE__ */ jsx33(
2194
+ Translate14,
2145
2195
  {
2146
2196
  center: [bodyWidth / 2 + 0.03, yOffset * leadSpacing, leadHeight / 2],
2147
- children: /* @__PURE__ */ jsx32(Cuboid22, { size: [leadLength, leadWidth, leadHeight] })
2197
+ children: /* @__PURE__ */ jsx33(Cuboid23, { size: [leadLength, leadWidth, leadHeight] })
2148
2198
  },
2149
2199
  `right-${index}`
2150
2200
  )
@@ -2153,8 +2203,8 @@ var SOT563 = ({ fullWidth = 1.94, fullLength: fullLength10 = 1.6 }) => {
2153
2203
  };
2154
2204
 
2155
2205
  // lib/SOT-723.tsx
2156
- import { Cuboid as Cuboid23, Translate as Translate14, Rotate as Rotate7, Colorize as Colorize15 } from "jscad-fiber";
2157
- import { Fragment as Fragment28, jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
2206
+ import { Cuboid as Cuboid24, Translate as Translate15, Rotate as Rotate7, Colorize as Colorize16 } from "jscad-fiber";
2207
+ import { Fragment as Fragment29, jsx as jsx34, jsxs as jsxs31 } from "react/jsx-runtime";
2158
2208
  var getCcwSot723Coords = (pn) => {
2159
2209
  if (pn === 1) {
2160
2210
  return { x: 0, y: 0 };
@@ -2172,12 +2222,12 @@ var SOT723 = () => {
2172
2222
  const leadLength = 0.3;
2173
2223
  const leadHeight = 0.1;
2174
2224
  const centerLeadWidth = 0.42;
2175
- return /* @__PURE__ */ jsxs30(Fragment28, { children: [
2176
- /* @__PURE__ */ jsx33(Rotate7, { rotation: [45 * Math.PI, 0, 0], children: /* @__PURE__ */ jsx33(Translate14, { center: [0.475, leadHeight / 2, -0.25], children: /* @__PURE__ */ jsx33(Colorize15, { color: "grey", children: /* @__PURE__ */ jsx33(Cuboid23, { size: [bodyWidth, bodyLength10, bodyHeight] }) }) }) }),
2225
+ return /* @__PURE__ */ jsxs31(Fragment29, { children: [
2226
+ /* @__PURE__ */ jsx34(Rotate7, { rotation: [45 * Math.PI, 0, 0], children: /* @__PURE__ */ jsx34(Translate15, { center: [0.475, leadHeight / 2, -0.25], children: /* @__PURE__ */ jsx34(Colorize16, { color: "grey", children: /* @__PURE__ */ jsx34(Cuboid24, { size: [bodyWidth, bodyLength10, bodyHeight] }) }) }) }),
2177
2227
  [1, 2, 3].map((pn) => {
2178
2228
  const { x, y } = getCcwSot723Coords(pn);
2179
- return /* @__PURE__ */ jsx33(Translate14, { center: [x, y, 0], children: /* @__PURE__ */ jsx33(
2180
- Cuboid23,
2229
+ return /* @__PURE__ */ jsx34(Translate15, { center: [x, y, 0], children: /* @__PURE__ */ jsx34(
2230
+ Cuboid24,
2181
2231
  {
2182
2232
  size: [
2183
2233
  leadLength,
@@ -2191,7 +2241,7 @@ var SOT723 = () => {
2191
2241
  };
2192
2242
 
2193
2243
  // lib/sod-123.tsx
2194
- import { Fragment as Fragment29, jsx as jsx34, jsxs as jsxs31 } from "react/jsx-runtime";
2244
+ import { Fragment as Fragment30, jsx as jsx35, jsxs as jsxs32 } from "react/jsx-runtime";
2195
2245
  var SOD123 = ({ fullWidth = 3.8, fullLength: fullLength10 = 1.6 }) => {
2196
2246
  const bodyWidth = 2.9;
2197
2247
  const bodyLength10 = 1.3;
@@ -2202,8 +2252,8 @@ var SOD123 = ({ fullWidth = 3.8, fullLength: fullLength10 = 1.6 }) => {
2202
2252
  const padContactLength = 0.4;
2203
2253
  const padThickness = leadThickness / 2;
2204
2254
  const bodyDistance = (fullWidth - bodyWidth) / 2;
2205
- return /* @__PURE__ */ jsxs31(Fragment29, { children: [
2206
- /* @__PURE__ */ jsx34(
2255
+ return /* @__PURE__ */ jsxs32(Fragment30, { children: [
2256
+ /* @__PURE__ */ jsx35(
2207
2257
  SmdChipLead,
2208
2258
  {
2209
2259
  position: {
@@ -2219,7 +2269,7 @@ var SOD123 = ({ fullWidth = 3.8, fullLength: fullLength10 = 1.6 }) => {
2219
2269
  },
2220
2270
  1
2221
2271
  ),
2222
- /* @__PURE__ */ jsx34(
2272
+ /* @__PURE__ */ jsx35(
2223
2273
  SmdChipLead,
2224
2274
  {
2225
2275
  rotation: Math.PI,
@@ -2236,7 +2286,7 @@ var SOD123 = ({ fullWidth = 3.8, fullLength: fullLength10 = 1.6 }) => {
2236
2286
  },
2237
2287
  2
2238
2288
  ),
2239
- /* @__PURE__ */ jsx34(
2289
+ /* @__PURE__ */ jsx35(
2240
2290
  ChipBody,
2241
2291
  {
2242
2292
  center: { x: 0, y: 0, z: 0 },
@@ -2269,6 +2319,7 @@ export {
2269
2319
  SMA,
2270
2320
  SMB,
2271
2321
  SMC,
2322
+ SMF,
2272
2323
  SOD123,
2273
2324
  SOD523,
2274
2325
  SOT233P,