jscad-electronics 0.0.147 → 0.0.149

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
@@ -43,16 +43,23 @@ var jsx = (type, props, _key) => h(type, props);
43
43
  var jsxs = (type, props, _key) => h(type, props);
44
44
 
45
45
  // lib/FootprintPad.tsx
46
+ var PAD_THICKNESS = 0.01;
46
47
  var FootprintPad = ({
47
48
  pad,
48
49
  isPin1
49
50
  }) => {
51
+ const color = isPin1 ? [0, 255, 0] : [255, 0, 0];
50
52
  if (pad.shape === "rect") {
51
- const color = isPin1 ? [0, 255, 0] : [255, 0, 0];
52
- return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Translate, { offset: [pad.x, pad.y, -5e-3], children: /* @__PURE__ */ jsx(Cuboid, { size: [pad.width, pad.height, 0.01] }) }) });
53
- } else {
54
- throw new Error("Shape not supported: " + pad.shape);
53
+ return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Translate, { offset: [pad.x, pad.y, -5e-3], children: /* @__PURE__ */ jsx(Cuboid, { size: [pad.width, pad.height, PAD_THICKNESS] }) }) });
54
+ }
55
+ if (pad.shape === "polygon") {
56
+ const points = (pad.points ?? []).map(
57
+ ({ x, y }) => [x, y]
58
+ );
59
+ if (points.length < 3) return null;
60
+ 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 }) }) }) });
55
61
  }
62
+ throw new Error("Shape not supported: " + pad.shape);
56
63
  };
57
64
 
58
65
  // lib/FootprintPlatedHole.tsx
@@ -5933,10 +5940,13 @@ var Footprinter3d = ({ footprint }) => {
5933
5940
  break;
5934
5941
  }
5935
5942
  case "sot23":
5936
- if (fpJson.num_pins === 3) return /* @__PURE__ */ jsx(SOT233P, { color });
5943
+ switch (fpJson.num_pins) {
5944
+ case 3:
5945
+ return /* @__PURE__ */ jsx(SOT233P, { color });
5946
+ case 5:
5947
+ return /* @__PURE__ */ jsx(SOT_235_default, {});
5948
+ }
5937
5949
  break;
5938
- case "sot235":
5939
- return /* @__PURE__ */ jsx(SOT_235_default, {});
5940
5950
  case "sot457":
5941
5951
  return /* @__PURE__ */ jsx(SOT457, {});
5942
5952
  case "sot223":