jscad-electronics 0.0.188 → 0.0.189

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
@@ -22,6 +22,18 @@ function h(type, props, ...restChildren) {
22
22
  import { mp } from "@tscircuit/modelprinter";
23
23
  import { fp } from "@tscircuit/footprinter";
24
24
 
25
+ // lib/materials.ts
26
+ var componentMaterials = {
27
+ moldedPlastic: { metalness: 0, roughness: 0.7 },
28
+ rubber: { metalness: 0, roughness: 0.9 },
29
+ sleeve: { metalness: 0, roughness: 0.45 },
30
+ tinnedLead: { metalness: 0.8, roughness: 0.55 },
31
+ goldContact: { metalness: 1, roughness: 0.25 },
32
+ copper: { metalness: 1, roughness: 0.35 },
33
+ brushedMetal: { metalness: 1, roughness: 0.4 },
34
+ steel: { metalness: 1, roughness: 0.25 }
35
+ };
36
+
25
37
  // lib/vanilla/primitives.ts
26
38
  var Cuboid = /* @__PURE__ */ Symbol("Cuboid");
27
39
  var Cube = /* @__PURE__ */ Symbol("Cube");
@@ -52,7 +64,7 @@ var FootprintPad = ({
52
64
  }) => {
53
65
  const color = isPin1 ? [0, 255, 0] : [255, 0, 0];
54
66
  if (pad.shape === "rect" || pad.shape === "rotated_rect") {
55
- return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Translate, { offset: [pad.x, pad.y, -5e-3], children: /* @__PURE__ */ jsx(
67
+ return /* @__PURE__ */ jsx(Colorize, { color, material: componentMaterials.copper, children: /* @__PURE__ */ jsx(Translate, { offset: [pad.x, pad.y, -5e-3], children: /* @__PURE__ */ jsx(
56
68
  Rotate,
57
69
  {
58
70
  angles: [
@@ -66,14 +78,14 @@ var FootprintPad = ({
66
78
  }
67
79
  if (pad.shape === "circle") {
68
80
  const radius = pad.radius ?? pad.r ?? 0.25;
69
- return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Translate, { offset: [pad.x, pad.y, -5e-3], children: /* @__PURE__ */ jsx(Cylinder, { radius, height: PAD_THICKNESS }) }) });
81
+ return /* @__PURE__ */ jsx(Colorize, { color, material: componentMaterials.copper, children: /* @__PURE__ */ jsx(Translate, { offset: [pad.x, pad.y, -5e-3], children: /* @__PURE__ */ jsx(Cylinder, { radius, height: PAD_THICKNESS }) }) });
70
82
  }
71
83
  if (pad.shape === "polygon") {
72
84
  const points = (pad.points ?? []).map(
73
85
  ({ x, y }) => [x, y]
74
86
  );
75
87
  if (points.length < 3) return null;
76
- return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Translate, { offset: [0, 0, -5e-3], children: /* @__PURE__ */ jsx(ExtrudeLinear, { height: PAD_THICKNESS, children: /* @__PURE__ */ jsx(Polygon, { points }) }) }) });
88
+ return /* @__PURE__ */ jsx(Colorize, { color, material: componentMaterials.copper, children: /* @__PURE__ */ jsx(Translate, { offset: [0, 0, -5e-3], children: /* @__PURE__ */ jsx(ExtrudeLinear, { height: PAD_THICKNESS, children: /* @__PURE__ */ jsx(Polygon, { points }) }) }) });
77
89
  }
78
90
  throw new Error("Shape not supported: " + pad.shape);
79
91
  };
@@ -85,13 +97,13 @@ var FootprintPlatedHole = ({
85
97
  }) => {
86
98
  const color = isPin1 ? "#00ff00" : "#b87333";
87
99
  if (hole.shape === "circle") {
88
- return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Translate, { offset: [hole.x, hole.y, -5e-3], children: /* @__PURE__ */ jsxs(Subtract, { children: [
100
+ return /* @__PURE__ */ jsx(Colorize, { color, material: componentMaterials.copper, children: /* @__PURE__ */ jsx(Translate, { offset: [hole.x, hole.y, -5e-3], children: /* @__PURE__ */ jsxs(Subtract, { children: [
89
101
  /* @__PURE__ */ jsx(Cylinder, { radius: hole.outer_diameter / 2, height: 0.01 }),
90
102
  /* @__PURE__ */ jsx(Cylinder, { radius: hole.hole_diameter / 2, height: 0.01 })
91
103
  ] }) }) });
92
104
  }
93
105
  if (hole.shape === "circular_hole_with_rect_pad") {
94
- return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Translate, { offset: [hole.x, hole.y, 0], children: /* @__PURE__ */ jsxs(Subtract, { children: [
106
+ return /* @__PURE__ */ jsx(Colorize, { color, material: componentMaterials.copper, children: /* @__PURE__ */ jsx(Translate, { offset: [hole.x, hole.y, 0], children: /* @__PURE__ */ jsxs(Subtract, { children: [
95
107
  /* @__PURE__ */ jsx(
96
108
  Cuboid,
97
109
  {
@@ -109,7 +121,7 @@ var FootprintPlatedHole = ({
109
121
  const isHorizontal = width10 > height10;
110
122
  const holeWidth = hole.hole_width ?? 0.8;
111
123
  const holeHeight = hole.hole_height ?? 0.8;
112
- return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Translate, { offset: [hole.x, hole.y, 0], children: /* @__PURE__ */ jsxs(Subtract, { children: [
124
+ return /* @__PURE__ */ jsx(Colorize, { color, material: componentMaterials.copper, children: /* @__PURE__ */ jsx(Translate, { offset: [hole.x, hole.y, 0], children: /* @__PURE__ */ jsxs(Subtract, { children: [
113
125
  /* @__PURE__ */ jsxs(Hull, { children: [
114
126
  /* @__PURE__ */ jsx(
115
127
  Cylinder,
@@ -657,7 +669,7 @@ function HexSocketBolt({
657
669
  color = "#737e8f",
658
670
  ...props
659
671
  }) {
660
- return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Custom, { geometry: createHexSocketBoltGeom(props) }) });
672
+ return /* @__PURE__ */ jsx(Colorize, { color, material: componentMaterials.steel, children: /* @__PURE__ */ jsx(Custom, { geometry: createHexSocketBoltGeom(props) }) });
661
673
  }
662
674
 
663
675
  // lib/mechanical/sheet-metal-mesh.ts
@@ -810,7 +822,7 @@ function createSheetMetalGeom(input) {
810
822
  return indexedMeshToGeom3(createSheetMetalMesh(input));
811
823
  }
812
824
  function SheetMetal({ color = "#737e8f", ...props }) {
813
- return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Custom, { geometry: createSheetMetalGeom(props) }) });
825
+ return /* @__PURE__ */ jsx(Colorize, { color, material: componentMaterials.brushedMetal, children: /* @__PURE__ */ jsx(Custom, { geometry: createSheetMetalGeom(props) }) });
814
826
  }
815
827
 
816
828
  // lib/SpurGear.tsx
@@ -1213,23 +1225,40 @@ function NemaMotor({
1213
1225
  return /* @__PURE__ */ jsx(
1214
1226
  Colorize,
1215
1227
  {
1228
+ material: section.name === "body" ? componentMaterials.moldedPlastic : section.name === "shaft" ? componentMaterials.steel : componentMaterials.brushedMetal,
1216
1229
  color: section.name === "body" ? bodyColor : section.name === "shaft" ? shaftColor : capColor,
1217
1230
  children: /* @__PURE__ */ jsx(Custom, { geometry: generalize({ simplify: true }, geometry) })
1218
1231
  },
1219
1232
  `${section.name}-${index}`
1220
1233
  );
1221
1234
  }),
1222
- createNemaMotorWireGeometry(p).map(({ geometry, color }, index) => /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Custom, { geometry: generalize({ simplify: true }, geometry) }) }, `wire-${index}`)),
1235
+ createNemaMotorWireGeometry(p).map(({ geometry, color }, index) => /* @__PURE__ */ jsx(
1236
+ Colorize,
1237
+ {
1238
+ material: componentMaterials.rubber,
1239
+ color,
1240
+ children: /* @__PURE__ */ jsx(Custom, { geometry: generalize({ simplify: true }, geometry) })
1241
+ },
1242
+ `wire-${index}`
1243
+ )),
1223
1244
  screw && [-halfPitch, halfPitch].flatMap(
1224
- (x) => [-halfPitch, halfPitch].map((y) => /* @__PURE__ */ jsx(Colorize, { color: screwColor, children: /* @__PURE__ */ jsx(
1225
- Custom,
1245
+ (x) => [-halfPitch, halfPitch].map((y) => /* @__PURE__ */ jsx(
1246
+ Colorize,
1226
1247
  {
1227
- geometry: jscad3.transforms.translate(
1228
- [x, y, -p.bodyLength],
1229
- generalize({ simplify: true }, screw)
1248
+ material: componentMaterials.steel,
1249
+ color: screwColor,
1250
+ children: /* @__PURE__ */ jsx(
1251
+ Custom,
1252
+ {
1253
+ geometry: jscad3.transforms.translate(
1254
+ [x, y, -p.bodyLength],
1255
+ generalize({ simplify: true }, screw)
1256
+ )
1257
+ }
1230
1258
  )
1231
- }
1232
- ) }, `rear-screw-${x}-${y}`))
1259
+ },
1260
+ `rear-screw-${x}-${y}`
1261
+ ))
1233
1262
  )
1234
1263
  ] });
1235
1264
  }
@@ -1599,7 +1628,7 @@ var ChipBody = ({
1599
1628
  chamferCutout(-xOffset, -yOffset)
1600
1629
  ] });
1601
1630
  }
1602
- 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: [
1631
+ return /* @__PURE__ */ jsx(Colorize, { color, material: componentMaterials.moldedPlastic, children: /* @__PURE__ */ jsx(Translate, { offset: center, children: /* @__PURE__ */ jsx(Translate, { offset: { x: 0, y: 0, z: heightAboveSurface2 }, children: includeNotch ? /* @__PURE__ */ jsxs(Subtract, { children: [
1603
1632
  finalBody,
1604
1633
  /* @__PURE__ */ jsx(Translate, { offset: actualNotchPosition, children: /* @__PURE__ */ jsx(Rotate, { rotation: notchRotation, children: /* @__PURE__ */ jsx(Cylinder, { radius: actualNotchRadius, height: notchWidth }) }) })
1605
1634
  ] }) : finalBody }) }) });
@@ -1697,12 +1726,19 @@ var heightAboveSurface = 0.5;
1697
1726
  var DipPinLeg = ({ x, y, z }) => {
1698
1727
  const isRotated = x > 0;
1699
1728
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
1700
- /* @__PURE__ */ jsx(Translate, { offset: { x: x + 0.25 / 2, y, z }, children: /* @__PURE__ */ jsx(Rotate, { rotation: ["-90deg", 0, "90deg"], children: /* @__PURE__ */ jsx(ExtrudeLinear, { height: 0.25, children: /* @__PURE__ */ jsx(
1701
- Polygon,
1729
+ /* @__PURE__ */ jsx(
1730
+ Translate,
1702
1731
  {
1703
- points: svgPathPoints.slice().reverse().map((p) => [p.x, p.y])
1732
+ material: componentMaterials.tinnedLead,
1733
+ offset: { x: x + 0.25 / 2, y, z },
1734
+ children: /* @__PURE__ */ jsx(Rotate, { rotation: ["-90deg", 0, "90deg"], children: /* @__PURE__ */ jsx(ExtrudeLinear, { height: 0.25, children: /* @__PURE__ */ jsx(
1735
+ Polygon,
1736
+ {
1737
+ points: svgPathPoints.slice().reverse().map((p) => [p.x, p.y])
1738
+ }
1739
+ ) }) })
1704
1740
  }
1705
- ) }) }) }),
1741
+ ),
1706
1742
  /* @__PURE__ */ jsx(
1707
1743
  Translate,
1708
1744
  {
@@ -1790,7 +1826,7 @@ var SmdChipLead = (props) => {
1790
1826
  const N = 15;
1791
1827
  const points = Array.from({ length: N }).map((_, i) => i / (N - 1) * bodyDistance).map((x) => [x, calculateSCurve(x, props)]);
1792
1828
  const polygon = getExpandedStroke(points, thickness);
1793
- return /* @__PURE__ */ jsx(Colorize, { color: "#fff", children: /* @__PURE__ */ jsx(Translate, { offset: { z: 0, y: 0, x: 0, ...props.position }, children: /* @__PURE__ */ jsx(Rotate, { rotation: ["90deg", 0, rotation ?? 0], children: /* @__PURE__ */ jsx(Translate, { offset: { x: 0, y: 0, z: -width10 / 2 }, children: /* @__PURE__ */ jsx(ExtrudeLinear, { height: width10, children: /* @__PURE__ */ jsx(Polygon, { points: polygon.map((p) => [p.x, p.y]) }) }) }) }) }) });
1829
+ return /* @__PURE__ */ jsx(Colorize, { color: "#c4c7ca", material: componentMaterials.tinnedLead, children: /* @__PURE__ */ jsx(Translate, { offset: { z: 0, y: 0, x: 0, ...props.position }, children: /* @__PURE__ */ jsx(Rotate, { rotation: ["90deg", 0, rotation ?? 0], children: /* @__PURE__ */ jsx(Translate, { offset: { x: 0, y: 0, z: -width10 / 2 }, children: /* @__PURE__ */ jsx(ExtrudeLinear, { height: width10, children: /* @__PURE__ */ jsx(Polygon, { points: polygon.map((p) => [p.x, p.y]) }) }) }) }) }) });
1794
1830
  };
1795
1831
 
1796
1832
  // lib/Tssop.tsx
@@ -1948,6 +1984,7 @@ var A0402 = ({ color = "#333" }) => {
1948
1984
  {
1949
1985
  size: [bodyLength, width, height],
1950
1986
  offset: [0, 0, height / 2],
1987
+ material: componentMaterials.moldedPlastic,
1951
1988
  color
1952
1989
  }
1953
1990
  ),
@@ -1956,6 +1993,7 @@ var A0402 = ({ color = "#333" }) => {
1956
1993
  {
1957
1994
  size: [terminatorWidth, height, width],
1958
1995
  offset: [fullLength / 2 - terminatorWidth / 2, 0, height / 2],
1996
+ material: componentMaterials.tinnedLead,
1959
1997
  color: "#ccc"
1960
1998
  }
1961
1999
  ),
@@ -1964,6 +2002,7 @@ var A0402 = ({ color = "#333" }) => {
1964
2002
  {
1965
2003
  size: [terminatorWidth, height, width],
1966
2004
  offset: [-fullLength / 2 + terminatorWidth / 2, 0, height / 2],
2005
+ material: componentMaterials.tinnedLead,
1967
2006
  color: "#ccc"
1968
2007
  }
1969
2008
  )
@@ -1983,6 +2022,7 @@ var A0603 = ({ color = "#333" }) => {
1983
2022
  {
1984
2023
  size: [bodyLength2, width2, height2],
1985
2024
  offset: [0, 0, height2 / 2],
2025
+ material: componentMaterials.moldedPlastic,
1986
2026
  color
1987
2027
  }
1988
2028
  ),
@@ -1991,6 +2031,7 @@ var A0603 = ({ color = "#333" }) => {
1991
2031
  {
1992
2032
  size: [terminatorLength, width2, height2],
1993
2033
  offset: [fullLength2 / 2 - terminatorLength / 2, 0, height2 / 2],
2034
+ material: componentMaterials.tinnedLead,
1994
2035
  color: "#ccc"
1995
2036
  }
1996
2037
  ),
@@ -1999,6 +2040,7 @@ var A0603 = ({ color = "#333" }) => {
1999
2040
  {
2000
2041
  size: [terminatorLength, width2, height2],
2001
2042
  offset: [-fullLength2 / 2 + terminatorLength / 2, 0, height2 / 2],
2043
+ material: componentMaterials.tinnedLead,
2002
2044
  color: "#ccc"
2003
2045
  }
2004
2046
  )
@@ -2078,6 +2120,7 @@ var A0805 = ({ color = "#333" }) => {
2078
2120
  {
2079
2121
  size: [bodyLength3, width3, height3],
2080
2122
  offset: [0, 0, height3 / 2],
2123
+ material: componentMaterials.moldedPlastic,
2081
2124
  color
2082
2125
  }
2083
2126
  ),
@@ -2086,6 +2129,7 @@ var A0805 = ({ color = "#333" }) => {
2086
2129
  {
2087
2130
  size: [terminatorWidth2, width3, height3],
2088
2131
  offset: [fullLength3 / 2 - terminatorWidth2 / 2, 0, height3 / 2],
2132
+ material: componentMaterials.tinnedLead,
2089
2133
  color: "#ccc"
2090
2134
  }
2091
2135
  ),
@@ -2094,6 +2138,7 @@ var A0805 = ({ color = "#333" }) => {
2094
2138
  {
2095
2139
  size: [terminatorWidth2, width3, height3],
2096
2140
  offset: [-fullLength3 / 2 + terminatorWidth2 / 2, 0, height3 / 2],
2141
+ material: componentMaterials.tinnedLead,
2097
2142
  color: "#ccc"
2098
2143
  }
2099
2144
  )
@@ -2277,69 +2322,84 @@ var PinHeader = ({
2277
2322
  Cuboid,
2278
2323
  {
2279
2324
  color: "#222",
2325
+ material: componentMaterials.moldedPlastic,
2280
2326
  size: [bodyLength10, bodyWidth, bodyHeight],
2281
2327
  center: [x, y, flipZ(bodyHeight / 2)]
2282
2328
  }
2283
2329
  ) }),
2284
- /* @__PURE__ */ jsx(Colorize, { color: PIN_METAL_COLOR, children: smd ? /* @__PURE__ */ jsx(
2285
- SmdChipLead,
2330
+ /* @__PURE__ */ jsx(
2331
+ Colorize,
2286
2332
  {
2287
- rotation: -Math.PI / 2,
2288
- position: {
2289
- x,
2290
- y: y + 1,
2291
- z: pinThickness / 2
2292
- },
2293
- thickness: pinThickness,
2294
- width: pinThickness,
2295
- height: pinThickness,
2296
- padContactLength: 2,
2297
- bodyDistance: 3
2333
+ color: PIN_METAL_COLOR,
2334
+ material: componentMaterials.goldContact,
2335
+ children: smd ? /* @__PURE__ */ jsx(
2336
+ SmdChipLead,
2337
+ {
2338
+ rotation: -Math.PI / 2,
2339
+ position: {
2340
+ x,
2341
+ y: y + 1,
2342
+ z: pinThickness / 2
2343
+ },
2344
+ thickness: pinThickness,
2345
+ width: pinThickness,
2346
+ height: pinThickness,
2347
+ padContactLength: 2,
2348
+ bodyDistance: 3
2349
+ }
2350
+ ) : /* @__PURE__ */ jsxs(Hull, { children: [
2351
+ /* @__PURE__ */ jsx(
2352
+ Cuboid,
2353
+ {
2354
+ color: PIN_METAL_COLOR,
2355
+ size: [pinThickness, pinThickness, shortSidePinLength * 0.9],
2356
+ center: [x, y, flipZ(bodyHeight * 0.9 + bodyHeight / 2)]
2357
+ }
2358
+ ),
2359
+ /* @__PURE__ */ jsx(
2360
+ Cuboid,
2361
+ {
2362
+ color: PIN_METAL_COLOR,
2363
+ size: [
2364
+ pinThickness / 1.8,
2365
+ pinThickness / 1.8,
2366
+ shortSidePinLength
2367
+ ],
2368
+ center: [x, y, flipZ(bodyHeight + bodyHeight / 2)]
2369
+ }
2370
+ )
2371
+ ] })
2298
2372
  }
2299
- ) : /* @__PURE__ */ jsxs(Hull, { children: [
2300
- /* @__PURE__ */ jsx(
2301
- Cuboid,
2302
- {
2303
- color: PIN_METAL_COLOR,
2304
- size: [pinThickness, pinThickness, shortSidePinLength * 0.9],
2305
- center: [x, y, flipZ(bodyHeight * 0.9 + bodyHeight / 2)]
2306
- }
2307
- ),
2308
- /* @__PURE__ */ jsx(
2309
- Cuboid,
2310
- {
2311
- color: PIN_METAL_COLOR,
2312
- size: [
2313
- pinThickness / 1.8,
2314
- pinThickness / 1.8,
2315
- shortSidePinLength
2316
- ],
2317
- center: [x, y, flipZ(bodyHeight + bodyHeight / 2)]
2318
- }
2319
- )
2320
- ] }) }),
2321
- /* @__PURE__ */ jsx(Colorize, { color: PIN_METAL_COLOR, children: /* @__PURE__ */ jsx(Translate, { y: rightangle ? -3.9 : 0, z: rightangle ? 1 : 0, children: /* @__PURE__ */ jsx(Rotate, { rotation: rightangle ? [-Math.PI / 2, 0, 0] : [0, 0, 0], children: /* @__PURE__ */ jsxs(Hull, { children: [
2322
- /* @__PURE__ */ jsx(
2323
- Cuboid,
2324
- {
2325
- color: PIN_METAL_COLOR,
2326
- size: [pinThickness, pinThickness, longSidePinLength * 0.9],
2327
- center: [x, y, flipZ(-longSidePinLength / 2 * 0.9)]
2328
- }
2329
- ),
2330
- /* @__PURE__ */ jsx(
2331
- Cuboid,
2332
- {
2333
- color: PIN_METAL_COLOR,
2334
- size: [
2335
- pinThickness / 1.8,
2336
- pinThickness / 1.8,
2337
- longSidePinLength
2338
- ],
2339
- center: [x, y, flipZ(-longSidePinLength / 2)]
2340
- }
2341
- )
2342
- ] }) }) }) })
2373
+ ),
2374
+ /* @__PURE__ */ jsx(
2375
+ Colorize,
2376
+ {
2377
+ color: PIN_METAL_COLOR,
2378
+ material: componentMaterials.goldContact,
2379
+ children: /* @__PURE__ */ jsx(Translate, { y: rightangle ? -3.9 : 0, z: rightangle ? 1 : 0, children: /* @__PURE__ */ jsx(Rotate, { rotation: rightangle ? [-Math.PI / 2, 0, 0] : [0, 0, 0], children: /* @__PURE__ */ jsxs(Hull, { children: [
2380
+ /* @__PURE__ */ jsx(
2381
+ Cuboid,
2382
+ {
2383
+ color: PIN_METAL_COLOR,
2384
+ size: [pinThickness, pinThickness, longSidePinLength * 0.9],
2385
+ center: [x, y, flipZ(-longSidePinLength / 2 * 0.9)]
2386
+ }
2387
+ ),
2388
+ /* @__PURE__ */ jsx(
2389
+ Cuboid,
2390
+ {
2391
+ color: PIN_METAL_COLOR,
2392
+ size: [
2393
+ pinThickness / 1.8,
2394
+ pinThickness / 1.8,
2395
+ longSidePinLength
2396
+ ],
2397
+ center: [x, y, flipZ(-longSidePinLength / 2)]
2398
+ }
2399
+ )
2400
+ ] }) }) })
2401
+ }
2402
+ )
2343
2403
  ] });
2344
2404
  };
2345
2405
 
@@ -2614,7 +2674,7 @@ var LegacyQFN = ({
2614
2674
  pinPositions.push({ pn, x, y, pw, pl });
2615
2675
  }
2616
2676
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
2617
- /* @__PURE__ */ jsx(Colorize, { color: "grey", children: /* @__PURE__ */ jsx(
2677
+ /* @__PURE__ */ jsx(Colorize, { material: componentMaterials.tinnedLead, color: "grey", children: /* @__PURE__ */ jsx(
2618
2678
  Cuboid,
2619
2679
  {
2620
2680
  center: [0, 0, bodyThickness / 2],
@@ -2919,6 +2979,7 @@ var A0201 = ({ color = "#333" }) => {
2919
2979
  {
2920
2980
  size: [bodyLength4, width4, height4],
2921
2981
  offset: [0, 0, height4 / 2],
2982
+ material: componentMaterials.moldedPlastic,
2922
2983
  color
2923
2984
  }
2924
2985
  ),
@@ -2927,6 +2988,7 @@ var A0201 = ({ color = "#333" }) => {
2927
2988
  {
2928
2989
  size: [terminatorWidth3, width4, height4],
2929
2990
  offset: [fullLength4 / 2 - terminatorWidth3 / 2, 0, height4 / 2],
2991
+ material: componentMaterials.tinnedLead,
2930
2992
  color: "#ccc"
2931
2993
  }
2932
2994
  ),
@@ -2935,6 +2997,7 @@ var A0201 = ({ color = "#333" }) => {
2935
2997
  {
2936
2998
  size: [terminatorWidth3, width4, height4],
2937
2999
  offset: [-fullLength4 / 2 + terminatorWidth3 / 2, 0, height4 / 2],
3000
+ material: componentMaterials.tinnedLead,
2938
3001
  color: "#ccc"
2939
3002
  }
2940
3003
  )
@@ -2954,6 +3017,7 @@ var A01005 = ({ color = "#333" }) => {
2954
3017
  {
2955
3018
  size: [bodyLength5, width5, height5],
2956
3019
  offset: [0, 0, height5 / 2],
3020
+ material: componentMaterials.moldedPlastic,
2957
3021
  color
2958
3022
  }
2959
3023
  ),
@@ -2962,6 +3026,7 @@ var A01005 = ({ color = "#333" }) => {
2962
3026
  {
2963
3027
  size: [terminatorWidth4, width5, height5],
2964
3028
  offset: [fullLength5 / 2 - terminatorWidth4 / 2, 0, height5 / 2],
3029
+ material: componentMaterials.tinnedLead,
2965
3030
  color: "#ccc"
2966
3031
  }
2967
3032
  ),
@@ -2970,6 +3035,7 @@ var A01005 = ({ color = "#333" }) => {
2970
3035
  {
2971
3036
  size: [terminatorWidth4, width5, height5],
2972
3037
  offset: [-fullLength5 / 2 + terminatorWidth4 / 2, 0, height5 / 2],
3038
+ material: componentMaterials.tinnedLead,
2973
3039
  color: "#ccc"
2974
3040
  }
2975
3041
  )
@@ -2989,6 +3055,7 @@ var A1206 = ({ color = "#333" }) => {
2989
3055
  {
2990
3056
  size: [bodyLength6, width6, height6],
2991
3057
  offset: [0, 0, height6 / 2],
3058
+ material: componentMaterials.moldedPlastic,
2992
3059
  color
2993
3060
  }
2994
3061
  ),
@@ -2997,6 +3064,7 @@ var A1206 = ({ color = "#333" }) => {
2997
3064
  {
2998
3065
  size: [terminatorWidth5, width6, height6],
2999
3066
  offset: [fullLength6 / 2 - terminatorWidth5 / 2, 0, height6 / 2],
3067
+ material: componentMaterials.tinnedLead,
3000
3068
  color: "#ccc"
3001
3069
  }
3002
3070
  ),
@@ -3005,6 +3073,7 @@ var A1206 = ({ color = "#333" }) => {
3005
3073
  {
3006
3074
  size: [terminatorWidth5, width6, height6],
3007
3075
  offset: [-fullLength6 / 2 + terminatorWidth5 / 2, 0, height6 / 2],
3076
+ material: componentMaterials.tinnedLead,
3008
3077
  color: "#ccc"
3009
3078
  }
3010
3079
  )
@@ -3024,6 +3093,7 @@ var A1210 = ({ color = "#333" }) => {
3024
3093
  {
3025
3094
  size: [bodyLength7, width7, height7],
3026
3095
  offset: [0, 0, height7 / 2],
3096
+ material: componentMaterials.moldedPlastic,
3027
3097
  color
3028
3098
  }
3029
3099
  ),
@@ -3032,6 +3102,7 @@ var A1210 = ({ color = "#333" }) => {
3032
3102
  {
3033
3103
  size: [terminatorWidth6, width7, height7],
3034
3104
  offset: [fullLength7 / 2 - terminatorWidth6 / 2, 0, height7 / 2],
3105
+ material: componentMaterials.tinnedLead,
3035
3106
  color: "#ccc"
3036
3107
  }
3037
3108
  ),
@@ -3040,6 +3111,7 @@ var A1210 = ({ color = "#333" }) => {
3040
3111
  {
3041
3112
  size: [terminatorWidth6, width7, height7],
3042
3113
  offset: [-fullLength7 / 2 + terminatorWidth6 / 2, 0, height7 / 2],
3114
+ material: componentMaterials.tinnedLead,
3043
3115
  color: "#ccc"
3044
3116
  }
3045
3117
  )
@@ -3059,6 +3131,7 @@ var A2010 = ({ color = "#333" }) => {
3059
3131
  {
3060
3132
  size: [bodyLength8, width8, height8],
3061
3133
  offset: [0, 0, height8 / 2],
3134
+ material: componentMaterials.moldedPlastic,
3062
3135
  color
3063
3136
  }
3064
3137
  ),
@@ -3067,6 +3140,7 @@ var A2010 = ({ color = "#333" }) => {
3067
3140
  {
3068
3141
  size: [terminatorWidth7, width8, height8],
3069
3142
  offset: [fullLength8 / 2 - terminatorWidth7 / 2, 0, height8 / 2],
3143
+ material: componentMaterials.tinnedLead,
3070
3144
  color: "#ccc"
3071
3145
  }
3072
3146
  ),
@@ -3075,6 +3149,7 @@ var A2010 = ({ color = "#333" }) => {
3075
3149
  {
3076
3150
  size: [terminatorWidth7, width8, height8],
3077
3151
  offset: [-fullLength8 / 2 + terminatorWidth7 / 2, 0, height8 / 2],
3152
+ material: componentMaterials.tinnedLead,
3078
3153
  color: "#ccc"
3079
3154
  }
3080
3155
  )
@@ -3094,6 +3169,7 @@ var A2512 = ({ color = "#333" }) => {
3094
3169
  {
3095
3170
  size: [bodyLength9, width9, height9],
3096
3171
  offset: [0, 0, height9 / 2],
3172
+ material: componentMaterials.moldedPlastic,
3097
3173
  color
3098
3174
  }
3099
3175
  ),
@@ -3102,6 +3178,7 @@ var A2512 = ({ color = "#333" }) => {
3102
3178
  {
3103
3179
  size: [terminatorWidth8, width9, height9],
3104
3180
  offset: [fullLength9 / 2 - terminatorWidth8 / 2, 0, height9 / 2],
3181
+ material: componentMaterials.tinnedLead,
3105
3182
  color: "#ccc"
3106
3183
  }
3107
3184
  ),
@@ -3110,6 +3187,7 @@ var A2512 = ({ color = "#333" }) => {
3110
3187
  {
3111
3188
  size: [terminatorWidth8, width9, height9],
3112
3189
  offset: [-fullLength9 / 2 + terminatorWidth8 / 2, 0, height9 / 2],
3190
+ material: componentMaterials.tinnedLead,
3113
3191
  color: "#ccc"
3114
3192
  }
3115
3193
  )
@@ -4948,11 +5026,11 @@ var DFN = ({
4948
5026
  }
4949
5027
  );
4950
5028
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
4951
- /* @__PURE__ */ jsx(Colorize, { color: "#25272a", children: pin1MarkWidth > 0 ? /* @__PURE__ */ jsxs(Subtract, { children: [
5029
+ /* @__PURE__ */ jsx(Colorize, { material: componentMaterials.moldedPlastic, color: "#25272a", children: pin1MarkWidth > 0 ? /* @__PURE__ */ jsxs(Subtract, { children: [
4952
5030
  body,
4953
5031
  stripe
4954
5032
  ] }) : body }),
4955
- /* @__PURE__ */ jsx(Colorize, { color: "#c7c9cd", children: pinPositions.map(
5033
+ /* @__PURE__ */ jsx(Colorize, { material: componentMaterials.tinnedLead, color: "#c7c9cd", children: pinPositions.map(
4956
5034
  (p) => p.pinNumber === 1 && pin1TerminalChamfer > 0 ? /* @__PURE__ */ jsxs(Hull, { children: [
4957
5035
  /* @__PURE__ */ jsx(
4958
5036
  Cuboid,
@@ -4992,6 +5070,7 @@ var DFN = ({
4992
5070
  thermalPadSize && /* @__PURE__ */ jsx(
4993
5071
  Cuboid,
4994
5072
  {
5073
+ material: componentMaterials.tinnedLead,
4995
5074
  color: "#c7c9cd",
4996
5075
  size: [
4997
5076
  thermalPadSize.width,
@@ -6629,99 +6708,114 @@ var JSTZH1_5mm = ({
6629
6708
  const bodyWidth = (numPins - 1) * pitch + 4;
6630
6709
  const startX = -((numPins - 1) * pitch) / 2;
6631
6710
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
6632
- /* @__PURE__ */ jsx(Translate, { offset: [0, 0, bodyHeight], children: /* @__PURE__ */ jsx(Rotate, { angles: [Math.PI, 0, 0], children: /* @__PURE__ */ jsx(Colorize, { color: bodyColor, children: /* @__PURE__ */ jsxs(Subtract, { children: [
6633
- /* @__PURE__ */ jsx(
6634
- Cuboid,
6635
- {
6636
- size: [bodyWidth, bodyDepth, bodyHeight],
6637
- center: [0, 0, bodyHeight / 2]
6638
- }
6639
- ),
6640
- /* @__PURE__ */ jsx(
6641
- Cuboid,
6642
- {
6643
- size: [
6644
- bodyWidth - wallThickness * 2,
6645
- bodyDepth - wallThickness * 2,
6646
- hollowHeight
6647
- ],
6648
- center: [0, 0, hollowHeight / 2]
6649
- }
6650
- ),
6651
- /* @__PURE__ */ jsx(
6652
- Cuboid,
6653
- {
6654
- size: [bodyWidth, bodyDepth / 3, hollowHeight],
6655
- center: [0, 0, hollowHeight / 6]
6656
- }
6657
- ),
6658
- /* @__PURE__ */ jsx(
6659
- Cuboid,
6660
- {
6661
- size: [
6662
- bodyWidth - wallThickness * 2,
6663
- wallThickness / 2,
6664
- hollowHeight
6665
- ],
6666
- center: [
6667
- 0,
6668
- bodyDepth / 2 - wallThickness / 4,
6669
- hollowHeight / 2
6670
- ]
6671
- }
6672
- ),
6673
- /* @__PURE__ */ jsx(
6674
- Cuboid,
6675
- {
6676
- size: [
6677
- bodyWidth - wallThickness * 2,
6678
- wallThickness / 2,
6679
- hollowHeight
6680
- ],
6681
- center: [
6682
- 0,
6683
- -bodyDepth / 2 + wallThickness / 4,
6684
- hollowHeight / 2
6685
- ]
6686
- }
6687
- ),
6688
- /* @__PURE__ */ jsx(
6689
- Cuboid,
6690
- {
6691
- size: [1, wallThickness + 2, 1],
6692
- center: [-bodyWidth / 4, bodyDepth / 2, bodyHeight / 2]
6693
- }
6694
- ),
6695
- /* @__PURE__ */ jsx(
6696
- Cuboid,
6697
- {
6698
- size: [1, wallThickness + 3, 1],
6699
- center: [bodyWidth / 4, bodyDepth / 2, bodyHeight / 2]
6700
- }
6701
- ),
6702
- /* @__PURE__ */ jsx(
6703
- Cuboid,
6704
- {
6705
- size: [1, wallThickness + 2, 1],
6706
- center: [-bodyWidth / 4, -bodyDepth / 2, bodyHeight / 2]
6707
- }
6708
- ),
6709
- /* @__PURE__ */ jsx(
6710
- Cuboid,
6711
- {
6712
- size: [1, wallThickness + 3, 1],
6713
- center: [bodyWidth / 4, -bodyDepth / 2, bodyHeight / 2]
6714
- }
6715
- )
6716
- ] }) }) }) }),
6717
- showPins && Array.from({ length: numPins }).map((_, i) => /* @__PURE__ */ jsx(Colorize, { color: pinColor, children: /* @__PURE__ */ jsx(
6718
- Cylinder,
6711
+ /* @__PURE__ */ jsx(Translate, { offset: [0, 0, bodyHeight], children: /* @__PURE__ */ jsx(Rotate, { angles: [Math.PI, 0, 0], children: /* @__PURE__ */ jsx(
6712
+ Colorize,
6719
6713
  {
6720
- height: pinLength,
6721
- radius: 0.35,
6722
- center: [startX + i * pitch, 0, 2.5]
6714
+ material: componentMaterials.moldedPlastic,
6715
+ color: bodyColor,
6716
+ children: /* @__PURE__ */ jsxs(Subtract, { children: [
6717
+ /* @__PURE__ */ jsx(
6718
+ Cuboid,
6719
+ {
6720
+ size: [bodyWidth, bodyDepth, bodyHeight],
6721
+ center: [0, 0, bodyHeight / 2]
6722
+ }
6723
+ ),
6724
+ /* @__PURE__ */ jsx(
6725
+ Cuboid,
6726
+ {
6727
+ size: [
6728
+ bodyWidth - wallThickness * 2,
6729
+ bodyDepth - wallThickness * 2,
6730
+ hollowHeight
6731
+ ],
6732
+ center: [0, 0, hollowHeight / 2]
6733
+ }
6734
+ ),
6735
+ /* @__PURE__ */ jsx(
6736
+ Cuboid,
6737
+ {
6738
+ size: [bodyWidth, bodyDepth / 3, hollowHeight],
6739
+ center: [0, 0, hollowHeight / 6]
6740
+ }
6741
+ ),
6742
+ /* @__PURE__ */ jsx(
6743
+ Cuboid,
6744
+ {
6745
+ size: [
6746
+ bodyWidth - wallThickness * 2,
6747
+ wallThickness / 2,
6748
+ hollowHeight
6749
+ ],
6750
+ center: [
6751
+ 0,
6752
+ bodyDepth / 2 - wallThickness / 4,
6753
+ hollowHeight / 2
6754
+ ]
6755
+ }
6756
+ ),
6757
+ /* @__PURE__ */ jsx(
6758
+ Cuboid,
6759
+ {
6760
+ size: [
6761
+ bodyWidth - wallThickness * 2,
6762
+ wallThickness / 2,
6763
+ hollowHeight
6764
+ ],
6765
+ center: [
6766
+ 0,
6767
+ -bodyDepth / 2 + wallThickness / 4,
6768
+ hollowHeight / 2
6769
+ ]
6770
+ }
6771
+ ),
6772
+ /* @__PURE__ */ jsx(
6773
+ Cuboid,
6774
+ {
6775
+ size: [1, wallThickness + 2, 1],
6776
+ center: [-bodyWidth / 4, bodyDepth / 2, bodyHeight / 2]
6777
+ }
6778
+ ),
6779
+ /* @__PURE__ */ jsx(
6780
+ Cuboid,
6781
+ {
6782
+ size: [1, wallThickness + 3, 1],
6783
+ center: [bodyWidth / 4, bodyDepth / 2, bodyHeight / 2]
6784
+ }
6785
+ ),
6786
+ /* @__PURE__ */ jsx(
6787
+ Cuboid,
6788
+ {
6789
+ size: [1, wallThickness + 2, 1],
6790
+ center: [-bodyWidth / 4, -bodyDepth / 2, bodyHeight / 2]
6791
+ }
6792
+ ),
6793
+ /* @__PURE__ */ jsx(
6794
+ Cuboid,
6795
+ {
6796
+ size: [1, wallThickness + 3, 1],
6797
+ center: [bodyWidth / 4, -bodyDepth / 2, bodyHeight / 2]
6798
+ }
6799
+ )
6800
+ ] })
6723
6801
  }
6724
- ) }, i)),
6802
+ ) }) }),
6803
+ showPins && Array.from({ length: numPins }).map((_, i) => /* @__PURE__ */ jsx(
6804
+ Colorize,
6805
+ {
6806
+ material: componentMaterials.tinnedLead,
6807
+ color: pinColor,
6808
+ children: /* @__PURE__ */ jsx(
6809
+ Cylinder,
6810
+ {
6811
+ height: pinLength,
6812
+ radius: 0.35,
6813
+ center: [startX + i * pitch, 0, 2.5]
6814
+ }
6815
+ )
6816
+ },
6817
+ i
6818
+ )),
6725
6819
  showFootprint && Array.from({ length: numPins }).map((_, i) => {
6726
6820
  const isPin1 = i === 0;
6727
6821
  const hole = isPin1 ? {
@@ -6787,120 +6881,135 @@ var JSTPH2_0mm = ({
6787
6881
  const topReliefWidth = 0.8;
6788
6882
  const topReliefDepth = 0.65;
6789
6883
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
6790
- /* @__PURE__ */ jsx(Translate, { offset: [0, 0, bodyHeight], children: /* @__PURE__ */ jsx(Rotate, { angles: [Math.PI, 0, 0], children: /* @__PURE__ */ jsx(Colorize, { color: bodyColor, children: /* @__PURE__ */ jsxs(Subtract, { children: [
6791
- /* @__PURE__ */ jsx(
6792
- Cuboid,
6793
- {
6794
- size: [bodyWidth, bodyDepth, bodyHeight],
6795
- center: [0, 0, bodyHeight / 2]
6796
- }
6797
- ),
6798
- /* @__PURE__ */ jsx(
6799
- Cuboid,
6800
- {
6801
- size: [
6802
- bodyWidth - wallThickness * 2,
6803
- bodyDepth - wallThickness * 2,
6804
- hollowHeight
6805
- ],
6806
- center: [0, 0, hollowHeight / 2]
6807
- }
6808
- ),
6809
- /* @__PURE__ */ jsx(
6810
- Cuboid,
6811
- {
6812
- size: [bodyWidth, bodyDepth / 3, hollowHeight],
6813
- center: [0, 0, hollowHeight / 6]
6814
- }
6815
- ),
6816
- /* @__PURE__ */ jsx(
6817
- Cuboid,
6818
- {
6819
- size: [
6820
- bodyWidth - wallThickness * 2,
6821
- wallThickness / 2,
6822
- hollowHeight
6823
- ],
6824
- center: [
6825
- 0,
6826
- bodyDepth / 2 - wallThickness / 4,
6827
- hollowHeight / 2
6828
- ]
6829
- }
6830
- ),
6831
- /* @__PURE__ */ jsx(
6832
- Cuboid,
6833
- {
6834
- size: [
6835
- bodyWidth - wallThickness * 2,
6836
- wallThickness / 2,
6837
- hollowHeight
6838
- ],
6839
- center: [
6840
- 0,
6841
- -bodyDepth / 2 + wallThickness / 4,
6842
- hollowHeight / 2
6843
- ]
6844
- }
6845
- ),
6846
- /* @__PURE__ */ jsx(
6847
- Cuboid,
6848
- {
6849
- size: [
6850
- latchWindowWidth,
6851
- bodyDepth + wallThickness,
6852
- latchWindowHeight
6853
- ],
6854
- center: [-bodyWidth / 2 + latchWindowInset, 0, bodyHeight / 2]
6855
- }
6856
- ),
6857
- /* @__PURE__ */ jsx(
6858
- Cuboid,
6859
- {
6860
- size: [
6861
- latchWindowWidth,
6862
- bodyDepth + wallThickness,
6863
- latchWindowHeight
6864
- ],
6865
- center: [bodyWidth / 2 - latchWindowInset, 0, bodyHeight / 2]
6866
- }
6867
- ),
6868
- /* @__PURE__ */ jsx(
6869
- Cuboid,
6870
- {
6871
- size: [wallThickness * 3, topReliefWidth, topReliefDepth],
6872
- center: [-bodyWidth / 2, 0, topReliefDepth / 2]
6873
- }
6874
- ),
6875
- /* @__PURE__ */ jsx(Translate, { offset: [-bodyWidth / 2, 0, topReliefDepth], children: /* @__PURE__ */ jsx(Rotate, { angles: [0, Math.PI / 2, 0], children: /* @__PURE__ */ jsx(
6876
- Cylinder,
6877
- {
6878
- height: wallThickness * 3,
6879
- radius: topReliefWidth / 2
6880
- }
6881
- ) }) }),
6882
- /* @__PURE__ */ jsx(
6883
- Cuboid,
6884
- {
6885
- size: [wallThickness * 3, topReliefWidth, topReliefDepth],
6886
- center: [bodyWidth / 2, 0, topReliefDepth / 2]
6887
- }
6888
- ),
6889
- /* @__PURE__ */ jsx(Translate, { offset: [bodyWidth / 2, 0, topReliefDepth], children: /* @__PURE__ */ jsx(Rotate, { angles: [0, Math.PI / 2, 0], children: /* @__PURE__ */ jsx(
6890
- Cylinder,
6891
- {
6892
- height: wallThickness * 3,
6893
- radius: topReliefWidth / 2
6894
- }
6895
- ) }) })
6896
- ] }) }) }) }),
6897
- showPins && Array.from({ length: numPins }).map((_, i) => /* @__PURE__ */ jsx(Colorize, { color: pinColor, children: /* @__PURE__ */ jsx(
6898
- Cuboid,
6884
+ /* @__PURE__ */ jsx(Translate, { offset: [0, 0, bodyHeight], children: /* @__PURE__ */ jsx(Rotate, { angles: [Math.PI, 0, 0], children: /* @__PURE__ */ jsx(
6885
+ Colorize,
6899
6886
  {
6900
- size: [pinThickness, pinThickness, pinLength],
6901
- center: [startX + i * pitch, 0, (pinTop - pinTailLength) / 2]
6887
+ color: bodyColor,
6888
+ material: componentMaterials.moldedPlastic,
6889
+ children: /* @__PURE__ */ jsxs(Subtract, { children: [
6890
+ /* @__PURE__ */ jsx(
6891
+ Cuboid,
6892
+ {
6893
+ size: [bodyWidth, bodyDepth, bodyHeight],
6894
+ center: [0, 0, bodyHeight / 2]
6895
+ }
6896
+ ),
6897
+ /* @__PURE__ */ jsx(
6898
+ Cuboid,
6899
+ {
6900
+ size: [
6901
+ bodyWidth - wallThickness * 2,
6902
+ bodyDepth - wallThickness * 2,
6903
+ hollowHeight
6904
+ ],
6905
+ center: [0, 0, hollowHeight / 2]
6906
+ }
6907
+ ),
6908
+ /* @__PURE__ */ jsx(
6909
+ Cuboid,
6910
+ {
6911
+ size: [bodyWidth, bodyDepth / 3, hollowHeight],
6912
+ center: [0, 0, hollowHeight / 6]
6913
+ }
6914
+ ),
6915
+ /* @__PURE__ */ jsx(
6916
+ Cuboid,
6917
+ {
6918
+ size: [
6919
+ bodyWidth - wallThickness * 2,
6920
+ wallThickness / 2,
6921
+ hollowHeight
6922
+ ],
6923
+ center: [
6924
+ 0,
6925
+ bodyDepth / 2 - wallThickness / 4,
6926
+ hollowHeight / 2
6927
+ ]
6928
+ }
6929
+ ),
6930
+ /* @__PURE__ */ jsx(
6931
+ Cuboid,
6932
+ {
6933
+ size: [
6934
+ bodyWidth - wallThickness * 2,
6935
+ wallThickness / 2,
6936
+ hollowHeight
6937
+ ],
6938
+ center: [
6939
+ 0,
6940
+ -bodyDepth / 2 + wallThickness / 4,
6941
+ hollowHeight / 2
6942
+ ]
6943
+ }
6944
+ ),
6945
+ /* @__PURE__ */ jsx(
6946
+ Cuboid,
6947
+ {
6948
+ size: [
6949
+ latchWindowWidth,
6950
+ bodyDepth + wallThickness,
6951
+ latchWindowHeight
6952
+ ],
6953
+ center: [-bodyWidth / 2 + latchWindowInset, 0, bodyHeight / 2]
6954
+ }
6955
+ ),
6956
+ /* @__PURE__ */ jsx(
6957
+ Cuboid,
6958
+ {
6959
+ size: [
6960
+ latchWindowWidth,
6961
+ bodyDepth + wallThickness,
6962
+ latchWindowHeight
6963
+ ],
6964
+ center: [bodyWidth / 2 - latchWindowInset, 0, bodyHeight / 2]
6965
+ }
6966
+ ),
6967
+ /* @__PURE__ */ jsx(
6968
+ Cuboid,
6969
+ {
6970
+ size: [wallThickness * 3, topReliefWidth, topReliefDepth],
6971
+ center: [-bodyWidth / 2, 0, topReliefDepth / 2]
6972
+ }
6973
+ ),
6974
+ /* @__PURE__ */ jsx(Translate, { offset: [-bodyWidth / 2, 0, topReliefDepth], children: /* @__PURE__ */ jsx(Rotate, { angles: [0, Math.PI / 2, 0], children: /* @__PURE__ */ jsx(
6975
+ Cylinder,
6976
+ {
6977
+ height: wallThickness * 3,
6978
+ radius: topReliefWidth / 2
6979
+ }
6980
+ ) }) }),
6981
+ /* @__PURE__ */ jsx(
6982
+ Cuboid,
6983
+ {
6984
+ size: [wallThickness * 3, topReliefWidth, topReliefDepth],
6985
+ center: [bodyWidth / 2, 0, topReliefDepth / 2]
6986
+ }
6987
+ ),
6988
+ /* @__PURE__ */ jsx(Translate, { offset: [bodyWidth / 2, 0, topReliefDepth], children: /* @__PURE__ */ jsx(Rotate, { angles: [0, Math.PI / 2, 0], children: /* @__PURE__ */ jsx(
6989
+ Cylinder,
6990
+ {
6991
+ height: wallThickness * 3,
6992
+ radius: topReliefWidth / 2
6993
+ }
6994
+ ) }) })
6995
+ ] })
6902
6996
  }
6903
- ) }, i)),
6997
+ ) }) }),
6998
+ showPins && Array.from({ length: numPins }).map((_, i) => /* @__PURE__ */ jsx(
6999
+ Colorize,
7000
+ {
7001
+ color: pinColor,
7002
+ material: componentMaterials.tinnedLead,
7003
+ children: /* @__PURE__ */ jsx(
7004
+ Cuboid,
7005
+ {
7006
+ size: [pinThickness, pinThickness, pinLength],
7007
+ center: [startX + i * pitch, 0, (pinTop - pinTailLength) / 2]
7008
+ }
7009
+ )
7010
+ },
7011
+ i
7012
+ )),
6904
7013
  showFootprint && Array.from({ length: numPins }).map((_, i) => {
6905
7014
  const isPin1 = i === 0;
6906
7015
  const hole = isPin1 ? {
@@ -6971,7 +7080,7 @@ var JSTXH2_5mm = ({
6971
7080
  );
6972
7081
  const lockNotchHeight = 2.4;
6973
7082
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
6974
- /* @__PURE__ */ jsx(Translate, { offset: [0, 0, bodyHeight / 2], children: /* @__PURE__ */ jsx(Colorize, { color: bodyColor, children: /* @__PURE__ */ jsxs(Subtract, { children: [
7083
+ /* @__PURE__ */ jsx(Translate, { offset: [0, 0, bodyHeight / 2], children: /* @__PURE__ */ jsx(Colorize, { material: componentMaterials.moldedPlastic, color: bodyColor, children: /* @__PURE__ */ jsxs(Subtract, { children: [
6975
7084
  /* @__PURE__ */ jsx(Cuboid, { size: [bodyWidth, bodyDepth, bodyHeight] }),
6976
7085
  /* @__PURE__ */ jsx(Translate, { offset: [0, 0, (bodyHeight - hollowHeight) / 2 + 0.1], children: /* @__PURE__ */ jsx(
6977
7086
  Cuboid,
@@ -7048,7 +7157,15 @@ var JSTXH2_5mm = ({
7048
7157
  `vent_${i}`
7049
7158
  ))
7050
7159
  ] }) }) }),
7051
- showPins && Array.from({ length: numPins }).map((_, i) => /* @__PURE__ */ jsx(Colorize, { color: pinColor, children: /* @__PURE__ */ jsx(Translate, { offset: [startX + i * pitch, 0, pinLength / 2 - 3.4], children: /* @__PURE__ */ jsx(Cuboid, { size: [0.64, 0.64, pinLength] }) }) }, i)),
7160
+ showPins && Array.from({ length: numPins }).map((_, i) => /* @__PURE__ */ jsx(
7161
+ Colorize,
7162
+ {
7163
+ material: componentMaterials.tinnedLead,
7164
+ color: pinColor,
7165
+ children: /* @__PURE__ */ jsx(Translate, { offset: [startX + i * pitch, 0, pinLength / 2 - 3.4], children: /* @__PURE__ */ jsx(Cuboid, { size: [0.64, 0.64, pinLength] }) })
7166
+ },
7167
+ i
7168
+ )),
7052
7169
  showFootprint && (() => {
7053
7170
  try {
7054
7171
  const circuitJson = fp2.string(`jst${numPins}_xh`).circuitJson();
@@ -7101,7 +7218,7 @@ var JstSh = ({ footprint = "jst6_sh" }) => {
7101
7218
  const y = rowY + direction * 1.8, width10 = n + 2, depth = 2.9, height10 = 4.2;
7102
7219
  const pinY = y - direction * 0.25;
7103
7220
  return /* @__PURE__ */ jsxs(Rotate, { rotation: [0, 0, angle], children: [
7104
- /* @__PURE__ */ jsx(Colorize, { color: "#e4e1d6", children: /* @__PURE__ */ jsxs(Subtract, { children: [
7221
+ /* @__PURE__ */ jsx(Colorize, { material: componentMaterials.moldedPlastic, color: "#e4e1d6", children: /* @__PURE__ */ jsxs(Subtract, { children: [
7105
7222
  /* @__PURE__ */ jsx(
7106
7223
  Cuboid,
7107
7224
  {
@@ -7137,7 +7254,7 @@ var JstSh = ({ footprint = "jst6_sh" }) => {
7137
7254
  side
7138
7255
  ))
7139
7256
  ] }) }),
7140
- /* @__PURE__ */ jsxs(Colorize, { color: "#c6c7c9", children: [
7257
+ /* @__PURE__ */ jsxs(Colorize, { material: componentMaterials.tinnedLead, color: "#c6c7c9", children: [
7141
7258
  signals.map((pad, i) => {
7142
7259
  const tailY = pad.y - direction * pad.height * 0.4;
7143
7260
  return /* @__PURE__ */ jsxs(Union, { children: [
@@ -7275,18 +7392,26 @@ var Crystal = ({
7275
7392
  })
7276
7393
  ];
7277
7394
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
7278
- terminalPositions.map((center, index) => /* @__PURE__ */ jsx(Colorize, { color: "#d6a258", children: /* @__PURE__ */ jsx(ExtrudeLinear, { height: terminalThickness, children: /* @__PURE__ */ jsx(
7279
- Polygon,
7395
+ terminalPositions.map((center, index) => /* @__PURE__ */ jsx(
7396
+ Colorize,
7280
7397
  {
7281
- points: getTerminalPoints(
7282
- center,
7283
- terminalWidth,
7284
- terminalLength,
7285
- bodyChamfer,
7286
- index === 0
7287
- )
7288
- }
7289
- ) }) }, index)),
7398
+ color: "#d6a258",
7399
+ material: componentMaterials.goldContact,
7400
+ children: /* @__PURE__ */ jsx(ExtrudeLinear, { height: terminalThickness, children: /* @__PURE__ */ jsx(
7401
+ Polygon,
7402
+ {
7403
+ points: getTerminalPoints(
7404
+ center,
7405
+ terminalWidth,
7406
+ terminalLength,
7407
+ bodyChamfer,
7408
+ index === 0
7409
+ )
7410
+ }
7411
+ ) })
7412
+ },
7413
+ index
7414
+ )),
7290
7415
  /* @__PURE__ */ jsx(
7291
7416
  ChipBody,
7292
7417
  {
@@ -7302,8 +7427,8 @@ var Crystal = ({
7302
7427
  chamferSize: bodyChamfer
7303
7428
  }
7304
7429
  ),
7305
- /* @__PURE__ */ jsx(Colorize, { color: "#d2a057", children: /* @__PURE__ */ jsx(Hull, { children: sealProfile }) }),
7306
- /* @__PURE__ */ jsx(Colorize, { color: "#b9bec2", children: /* @__PURE__ */ jsx(Hull, { children: lidProfiles }) })
7430
+ /* @__PURE__ */ jsx(Colorize, { color: "#d2a057", material: componentMaterials.goldContact, children: /* @__PURE__ */ jsx(Hull, { children: sealProfile }) }),
7431
+ /* @__PURE__ */ jsx(Colorize, { color: "#b9bec2", material: componentMaterials.brushedMetal, children: /* @__PURE__ */ jsx(Hull, { children: lidProfiles }) })
7307
7432
  ] });
7308
7433
  };
7309
7434
 
@@ -7742,6 +7867,7 @@ var ParametricChip = ({
7742
7867
  {
7743
7868
  size: [bodyLength10, width10, height10],
7744
7869
  offset: [0, 0, height10 / 2],
7870
+ material: componentMaterials.moldedPlastic,
7745
7871
  color
7746
7872
  }
7747
7873
  ),
@@ -7750,6 +7876,7 @@ var ParametricChip = ({
7750
7876
  {
7751
7877
  size: [terminatorWidth9, height10, width10],
7752
7878
  offset: [fullLength10 / 2 - terminatorWidth9 / 2, 0, height10 / 2],
7879
+ material: componentMaterials.tinnedLead,
7753
7880
  color: "#ccc"
7754
7881
  }
7755
7882
  ),
@@ -7758,6 +7885,7 @@ var ParametricChip = ({
7758
7885
  {
7759
7886
  size: [terminatorWidth9, height10, width10],
7760
7887
  offset: [-fullLength10 / 2 + terminatorWidth9 / 2, 0, height10 / 2],
7888
+ material: componentMaterials.tinnedLead,
7761
7889
  color: "#ccc"
7762
7890
  }
7763
7891
  )
@@ -8154,14 +8282,14 @@ var DPAK = ({
8154
8282
  const leadZ = tabThickness / 2;
8155
8283
  const leadThickness = 0.4;
8156
8284
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
8157
- /* @__PURE__ */ jsx(Colorize, { color: tabColor, children: /* @__PURE__ */ jsx(
8285
+ /* @__PURE__ */ jsx(Colorize, { material: componentMaterials.tinnedLead, color: tabColor, children: /* @__PURE__ */ jsx(
8158
8286
  Cuboid,
8159
8287
  {
8160
8288
  size: [tabWidth, tabLength, tabThickness],
8161
8289
  center: [tabCenterX, 0, tabThickness / 2]
8162
8290
  }
8163
8291
  ) }),
8164
- /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(
8292
+ /* @__PURE__ */ jsx(Colorize, { material: componentMaterials.moldedPlastic, color, children: /* @__PURE__ */ jsx(
8165
8293
  Cuboid,
8166
8294
  {
8167
8295
  size: [bodyWidth, bodyLength10, bodyHeight],
@@ -8169,39 +8297,47 @@ var DPAK = ({
8169
8297
  }
8170
8298
  ) }),
8171
8299
  [-1, 1].map((side) => {
8172
- return /* @__PURE__ */ jsxs(Colorize, { color: leadColor, children: [
8173
- /* @__PURE__ */ jsx(
8174
- Cuboid,
8175
- {
8176
- size: [leadContactLength, leadWidth, leadThickness],
8177
- center: [
8178
- leadPadX + leadContactLength / 2,
8179
- side * pitch,
8180
- leadThickness / 2
8181
- ]
8182
- }
8183
- ),
8184
- /* @__PURE__ */ jsxs(Hull, { children: [
8185
- /* @__PURE__ */ jsx(
8186
- Cuboid,
8187
- {
8188
- size: [0.1, leadWidth, leadThickness],
8189
- center: [
8190
- leadPadX + leadContactLength,
8191
- side * pitch,
8192
- leadThickness / 2
8193
- ]
8194
- }
8195
- ),
8196
- /* @__PURE__ */ jsx(
8197
- Cuboid,
8198
- {
8199
- size: [0.1, leadWidth, leadThickness],
8200
- center: [bodyFrontX, side * pitch, leadZ + tabThickness / 2]
8201
- }
8202
- )
8203
- ] })
8204
- ] }, `lead-${side}`);
8300
+ return /* @__PURE__ */ jsxs(
8301
+ Colorize,
8302
+ {
8303
+ material: componentMaterials.tinnedLead,
8304
+ color: leadColor,
8305
+ children: [
8306
+ /* @__PURE__ */ jsx(
8307
+ Cuboid,
8308
+ {
8309
+ size: [leadContactLength, leadWidth, leadThickness],
8310
+ center: [
8311
+ leadPadX + leadContactLength / 2,
8312
+ side * pitch,
8313
+ leadThickness / 2
8314
+ ]
8315
+ }
8316
+ ),
8317
+ /* @__PURE__ */ jsxs(Hull, { children: [
8318
+ /* @__PURE__ */ jsx(
8319
+ Cuboid,
8320
+ {
8321
+ size: [0.1, leadWidth, leadThickness],
8322
+ center: [
8323
+ leadPadX + leadContactLength,
8324
+ side * pitch,
8325
+ leadThickness / 2
8326
+ ]
8327
+ }
8328
+ ),
8329
+ /* @__PURE__ */ jsx(
8330
+ Cuboid,
8331
+ {
8332
+ size: [0.1, leadWidth, leadThickness],
8333
+ center: [bodyFrontX, side * pitch, leadZ + tabThickness / 2]
8334
+ }
8335
+ )
8336
+ ] })
8337
+ ]
8338
+ },
8339
+ `lead-${side}`
8340
+ );
8205
8341
  })
8206
8342
  ] });
8207
8343
  };
@@ -8225,7 +8361,7 @@ var ElectrolyticCapacitor = ({
8225
8361
  const grooveWidth = Math.max(diameter * 0.06, 0.2);
8226
8362
  const grooveDepth = 0.3;
8227
8363
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
8228
- /* @__PURE__ */ jsx(Colorize, { color: baseColor, children: /* @__PURE__ */ jsx(
8364
+ /* @__PURE__ */ jsx(Colorize, { color: baseColor, material: componentMaterials.rubber, children: /* @__PURE__ */ jsx(
8229
8365
  Cylinder,
8230
8366
  {
8231
8367
  radius: radius - 0.05,
@@ -8233,7 +8369,7 @@ var ElectrolyticCapacitor = ({
8233
8369
  center: [0, 0, baseHeight / 2]
8234
8370
  }
8235
8371
  ) }),
8236
- /* @__PURE__ */ jsx(Colorize, { color: sleeveColor, children: /* @__PURE__ */ jsxs(Subtract, { children: [
8372
+ /* @__PURE__ */ jsx(Colorize, { color: sleeveColor, material: componentMaterials.sleeve, children: /* @__PURE__ */ jsxs(Subtract, { children: [
8237
8373
  /* @__PURE__ */ jsx(
8238
8374
  RoundedCylinder,
8239
8375
  {
@@ -8258,14 +8394,22 @@ var ElectrolyticCapacitor = ({
8258
8394
  }
8259
8395
  )
8260
8396
  ] }) }),
8261
- [-1, 1].map((side) => /* @__PURE__ */ jsx(Colorize, { color: "#c0c0c0", children: /* @__PURE__ */ jsx(
8262
- Cylinder,
8397
+ [-1, 1].map((side) => /* @__PURE__ */ jsx(
8398
+ Colorize,
8263
8399
  {
8264
- radius: leadDiameter / 2,
8265
- height: leadLength + baseHeight,
8266
- center: [side * leadPitch / 2, 0, (baseHeight - leadLength) / 2]
8267
- }
8268
- ) }, `lead-${side}`))
8400
+ material: componentMaterials.tinnedLead,
8401
+ color: "#c0c0c0",
8402
+ children: /* @__PURE__ */ jsx(
8403
+ Cylinder,
8404
+ {
8405
+ radius: leadDiameter / 2,
8406
+ height: leadLength + baseHeight,
8407
+ center: [side * leadPitch / 2, 0, (baseHeight - leadLength) / 2]
8408
+ }
8409
+ )
8410
+ },
8411
+ `lead-${side}`
8412
+ ))
8269
8413
  ] });
8270
8414
  };
8271
8415
 
@@ -8572,7 +8716,7 @@ var UsbCMidmount = ({
8572
8716
  );
8573
8717
  const tabBottom = -0.9, tabTop = centerZ + 0.1;
8574
8718
  return /* @__PURE__ */ jsxs(Rotate, { rotation: [0, 0, angle], children: [
8575
- /* @__PURE__ */ jsx(Colorize, { color: "#b8bdc4", children: /* @__PURE__ */ jsx(Translate, { offset: [0, centerY, centerZ], children: /* @__PURE__ */ jsxs(Subtract, { children: [
8719
+ /* @__PURE__ */ jsx(Colorize, { color: "#b8bdc4", material: componentMaterials.brushedMetal, children: /* @__PURE__ */ jsx(Translate, { offset: [0, centerY, centerZ], children: /* @__PURE__ */ jsxs(Subtract, { children: [
8576
8720
  /* @__PURE__ */ jsx(Capsule, { width: width10, height: height10, depth }),
8577
8721
  /* @__PURE__ */ jsx(
8578
8722
  Capsule,
@@ -8583,7 +8727,7 @@ var UsbCMidmount = ({
8583
8727
  }
8584
8728
  )
8585
8729
  ] }) }) }),
8586
- /* @__PURE__ */ jsxs(Colorize, { color: "#242529", children: [
8730
+ /* @__PURE__ */ jsxs(Colorize, { color: "#242529", material: componentMaterials.moldedPlastic, children: [
8587
8731
  /* @__PURE__ */ jsx(
8588
8732
  Cuboid,
8589
8733
  {
@@ -8604,7 +8748,7 @@ var UsbCMidmount = ({
8604
8748
  ) : null
8605
8749
  )
8606
8750
  ] }),
8607
- /* @__PURE__ */ jsxs(Colorize, { color: "#d3ad57", children: [
8751
+ /* @__PURE__ */ jsxs(Colorize, { color: "#d3ad57", material: componentMaterials.goldContact, children: [
8608
8752
  [-1, 1].flatMap(
8609
8753
  (side) => [-2.75, -2.25, -1.25, -0.25, 0.25, 1.25, 2.25, 2.75].map((x) => /* @__PURE__ */ jsx(
8610
8754
  Cuboid,
@@ -8628,7 +8772,7 @@ var UsbCMidmount = ({
8628
8772
  i
8629
8773
  ))
8630
8774
  ] }),
8631
- /* @__PURE__ */ jsx(Colorize, { color: "#b8bdc4", children: slots.map((slot, i) => /* @__PURE__ */ jsx(
8775
+ /* @__PURE__ */ jsx(Colorize, { color: "#b8bdc4", material: componentMaterials.brushedMetal, children: slots.map((slot, i) => /* @__PURE__ */ jsx(
8632
8776
  Cuboid,
8633
8777
  {
8634
8778
  size: [
@@ -10033,6 +10177,16 @@ function renderNode(node, colorCtx, renderCtx) {
10033
10177
  return node.flatMap((n) => renderNode(n, colorCtx, renderCtx));
10034
10178
  if (!isVNode(node)) return [];
10035
10179
  const { type, props, children } = node;
10180
+ if (props?.material) {
10181
+ const { material, ...rest } = props;
10182
+ return renderNode({ ...node, props: rest }, colorCtx, renderCtx).map(
10183
+ (entry) => ({
10184
+ ...entry,
10185
+ material: { ...material },
10186
+ geom: { ...entry.geom, material: { ...material } }
10187
+ })
10188
+ );
10189
+ }
10036
10190
  if (type === Fragment) {
10037
10191
  return (children ?? []).flatMap((c) => renderNode(c, colorCtx, renderCtx));
10038
10192
  }
@@ -10049,7 +10203,8 @@ function renderNode(node, colorCtx, renderCtx) {
10049
10203
  const geoms = (children ?? []).flatMap(
10050
10204
  (c) => renderNode(c, colorCtx, renderCtx)
10051
10205
  );
10052
- return geoms.map(({ geom, color }) => ({
10206
+ return geoms.map(({ geom, color, material }) => ({
10207
+ material,
10053
10208
  geom: transforms.translate(off, geom),
10054
10209
  color: color ?? colorCtx
10055
10210
  }));
@@ -10064,7 +10219,8 @@ function renderNode(node, colorCtx, renderCtx) {
10064
10219
  const geoms = (children ?? []).flatMap(
10065
10220
  (c) => renderNode(c, colorCtx, renderCtx)
10066
10221
  );
10067
- return geoms.map(({ geom, color }) => ({
10222
+ return geoms.map(({ geom, color, material }) => ({
10223
+ material,
10068
10224
  geom: transforms.rotateZ(
10069
10225
  rot[2],
10070
10226
  transforms.rotateY(rot[1], transforms.rotateX(rot[0], geom))
@@ -10073,14 +10229,23 @@ function renderNode(node, colorCtx, renderCtx) {
10073
10229
  }));
10074
10230
  }
10075
10231
  if (type === Union || type === Subtract || type === Hull) {
10076
- const geoms = (children ?? []).flatMap((c) => renderNode(c, colorCtx, renderCtx)).map((g) => g.geom);
10232
+ const entries = (children ?? []).flatMap(
10233
+ (c) => renderNode(c, colorCtx, renderCtx)
10234
+ );
10235
+ const geoms = entries.map((g) => g.geom);
10077
10236
  if (geoms.length === 0) return [];
10078
10237
  let geom;
10079
10238
  if (type === Union) geom = booleans.union(geoms);
10080
10239
  else if (type === Subtract)
10081
10240
  geom = booleans.subtract(geoms[0], geoms.slice(1));
10082
10241
  else geom = hulls.hull(geoms);
10083
- return [{ geom, color: colorCtx }];
10242
+ return [
10243
+ {
10244
+ geom,
10245
+ color: colorCtx,
10246
+ material: type === Subtract ? entries[0]?.material : void 0
10247
+ }
10248
+ ];
10084
10249
  }
10085
10250
  if (type === Custom) {
10086
10251
  return [{ geom: props.geometry, color: colorCtx }];
@@ -10091,7 +10256,10 @@ function renderNode(node, colorCtx, renderCtx) {
10091
10256
  return [{ geom: g2, color: colorCtx ?? props?.color }];
10092
10257
  }
10093
10258
  if (type === ExtrudeLinear) {
10094
- const geoms2 = (children ?? []).flatMap((c) => renderNode(c, colorCtx, renderCtx)).map((g) => g.geom);
10259
+ const entries = (children ?? []).flatMap(
10260
+ (c) => renderNode(c, colorCtx, renderCtx)
10261
+ );
10262
+ const geoms2 = entries.map((g) => g.geom);
10095
10263
  if (geoms2.length === 0) return [];
10096
10264
  const base2 = geoms2.length > 1 ? booleans.union(geoms2) : geoms2[0];
10097
10265
  const height10 = props?.height ?? props?.h ?? 1;
@@ -10102,7 +10270,13 @@ function renderNode(node, colorCtx, renderCtx) {
10102
10270
  poly.vertices.reverse();
10103
10271
  }
10104
10272
  }
10105
- return [{ geom: g3, color: colorCtx ?? props?.color }];
10273
+ return [
10274
+ {
10275
+ geom: g3,
10276
+ color: colorCtx ?? props?.color,
10277
+ material: entries.length === 1 ? entries[0]?.material : void 0
10278
+ }
10279
+ ];
10106
10280
  }
10107
10281
  if (type === Cuboid || type === Cube || type === Cylinder || type === Sphere || type === RoundedCuboid || type === RoundedCylinder) {
10108
10282
  let g;
@@ -10147,7 +10321,11 @@ function renderNode(node, colorCtx, renderCtx) {
10147
10321
  }
10148
10322
  function render(root, jscad4) {
10149
10323
  const geometries = renderNode(root, void 0, { jscad: jscad4 });
10150
- return { geometries };
10324
+ return {
10325
+ geometries: geometries.map(
10326
+ (entry) => entry.material ? { ...entry, geom: { ...entry.geom, material: entry.material } } : entry
10327
+ )
10328
+ };
10151
10329
  }
10152
10330
 
10153
10331
  // lib/vanilla/convertCSGToThreeGeom.ts