jscad-electronics 0.0.239 → 0.0.241

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
@@ -20474,8 +20474,154 @@ function createDualRowGullWing(p) {
20474
20474
  // lib/SSOP.tsx
20475
20475
  var SSOP = (props) => createDualRowGullWing(props);
20476
20476
 
20477
+ // lib/utils/FlatLeadDiode.tsx
20478
+ function createFlatLeadDiode(p) {
20479
+ const dimensions5 = [
20480
+ "bodyLength",
20481
+ "bodyWidth",
20482
+ "bodyHeight",
20483
+ "leadSpan",
20484
+ "cathodeLength",
20485
+ "cathodeWidth",
20486
+ "anodeLength",
20487
+ "anodeWidth",
20488
+ "terminalThickness",
20489
+ "standoff",
20490
+ "taperInset",
20491
+ "markingWidth"
20492
+ ];
20493
+ for (const name of dimensions5) {
20494
+ const value = p[name];
20495
+ const allowZero = ["standoff", "taperInset", "markingWidth"].includes(name);
20496
+ if (!Number.isFinite(value) || (allowZero ? value < 0 : value <= 0))
20497
+ throw new Error(`Invalid diode dimension: ${name}`);
20498
+ }
20499
+ const overhang = (p.leadSpan - p.bodyLength) / 2;
20500
+ if (overhang < 0 || p.cathodeLength <= overhang || p.anodeLength <= overhang || p.cathodeLength + p.anodeLength >= p.leadSpan || p.cathodeWidth > p.bodyWidth || p.anodeWidth > p.bodyWidth || p.standoff >= p.terminalThickness || p.terminalThickness >= p.bodyHeight || p.taperInset * 2 >= Math.min(p.bodyLength, p.bodyWidth) || p.markingWidth * 2 >= p.bodyLength - p.taperInset * 2)
20501
+ throw new Error(
20502
+ "Diode dimensions leave disconnected terminals or an invalid mold"
20503
+ );
20504
+ const slice = Math.min(p.bodyHeight - p.standoff, p.bodyWidth) / 100;
20505
+ const body = /* @__PURE__ */ jsxs(Hull, { children: [
20506
+ /* @__PURE__ */ jsx(
20507
+ Cuboid,
20508
+ {
20509
+ size: [p.bodyLength, p.bodyWidth, slice],
20510
+ center: [0, 0, p.standoff + slice / 2]
20511
+ }
20512
+ ),
20513
+ /* @__PURE__ */ jsx(
20514
+ Cuboid,
20515
+ {
20516
+ size: [
20517
+ p.bodyLength - p.taperInset * 2,
20518
+ p.bodyWidth - p.taperInset * 2,
20519
+ slice
20520
+ ],
20521
+ center: [0, 0, p.bodyHeight - slice / 2]
20522
+ }
20523
+ )
20524
+ ] });
20525
+ const stripe = /* @__PURE__ */ jsx(
20526
+ Cuboid,
20527
+ {
20528
+ size: [p.markingWidth, (p.bodyWidth - p.taperInset * 2) * 0.9, slice],
20529
+ center: [
20530
+ -p.bodyLength / 2 + p.taperInset + p.markingWidth,
20531
+ 0,
20532
+ p.bodyHeight - slice / 2
20533
+ ]
20534
+ }
20535
+ );
20536
+ return /* @__PURE__ */ jsxs(Fragment2, { children: [
20537
+ /* @__PURE__ */ jsx(Colorize, { color: "#25272a", children: p.markingWidth > 0 ? /* @__PURE__ */ jsxs(Subtract, { children: [
20538
+ body,
20539
+ stripe
20540
+ ] }) : body }),
20541
+ /* @__PURE__ */ jsxs(Colorize, { color: "#c7c9cd", children: [
20542
+ /* @__PURE__ */ jsx(
20543
+ Cuboid,
20544
+ {
20545
+ size: [p.cathodeLength, p.cathodeWidth, p.terminalThickness],
20546
+ center: [
20547
+ -p.leadSpan / 2 + p.cathodeLength / 2,
20548
+ 0,
20549
+ p.terminalThickness / 2
20550
+ ]
20551
+ }
20552
+ ),
20553
+ /* @__PURE__ */ jsx(
20554
+ Cuboid,
20555
+ {
20556
+ size: [p.anodeLength, p.anodeWidth, p.terminalThickness],
20557
+ center: [
20558
+ p.leadSpan / 2 - p.anodeLength / 2,
20559
+ 0,
20560
+ p.terminalThickness / 2
20561
+ ]
20562
+ }
20563
+ )
20564
+ ] }),
20565
+ p.markingWidth > 0 && /* @__PURE__ */ jsx(Colorize, { color: "#aaaaa8", children: stripe })
20566
+ ] });
20567
+ }
20568
+
20569
+ // lib/DO219AD.tsx
20570
+ var DO219AD = (props) => createFlatLeadDiode({
20571
+ bodyLength: 2.2,
20572
+ bodyWidth: 1.3,
20573
+ bodyHeight: 0.68,
20574
+ leadSpan: 2.5,
20575
+ cathodeLength: 1.3,
20576
+ cathodeWidth: 0.88,
20577
+ anodeLength: 0.65,
20578
+ anodeWidth: 0.65,
20579
+ terminalThickness: 0.195,
20580
+ standoff: 0.11,
20581
+ taperInset: 0.05,
20582
+ markingWidth: 0.23,
20583
+ ...props
20584
+ });
20585
+
20586
+ // lib/SOD323HE.tsx
20587
+ var SOD323HE = (props) => createFlatLeadDiode({
20588
+ bodyLength: 2,
20589
+ bodyWidth: 1.4,
20590
+ bodyHeight: 0.6,
20591
+ leadSpan: 2.5,
20592
+ cathodeLength: 0.55,
20593
+ cathodeWidth: 0.8,
20594
+ anodeLength: 0.55,
20595
+ anodeWidth: 0.8,
20596
+ terminalThickness: 0.17,
20597
+ standoff: 0.05,
20598
+ taperInset: 0.15,
20599
+ markingWidth: 0.2,
20600
+ ...props
20601
+ });
20602
+
20477
20603
  // lib/utils/FootprinterBodyModels.tsx
20478
20604
  function renderFootprinterBodyModel(p) {
20605
+ if (p.fn === "do219ad" || p.fn === "sod323he") {
20606
+ const Diode = p.fn === "do219ad" ? DO219AD : SOD323HE;
20607
+ return /* @__PURE__ */ jsx(
20608
+ Diode,
20609
+ {
20610
+ bodyLength: p.bodylength,
20611
+ bodyWidth: p.bodywidth,
20612
+ bodyHeight: p.bodyheight,
20613
+ leadSpan: p.leadspan,
20614
+ cathodeLength: p.cathodelength,
20615
+ cathodeWidth: p.cathodewidth,
20616
+ anodeLength: p.anodelength,
20617
+ anodeWidth: p.anodewidth,
20618
+ terminalThickness: p.terminalthickness,
20619
+ standoff: p.standoff,
20620
+ taperInset: p.taperinset,
20621
+ markingWidth: p.markingwidth
20622
+ }
20623
+ );
20624
+ }
20479
20625
  if (p.bodywidth === void 0 && p.bodyheight === void 0 && p.bodythickness === void 0)
20480
20626
  return null;
20481
20627
  if (p.fn === "ssop") {
@@ -27904,8 +28050,8 @@ var Footprinter3d = ({ footprint }) => {
27904
28050
  DFN,
27905
28051
  {
27906
28052
  num_pins: fpJson.num_pins,
27907
- bodyWidth: fpJson.w,
27908
- bodyLength: fpJson.h,
28053
+ bodyWidth: fpJson.bodywidth ?? fpJson.w,
28054
+ bodyLength: fpJson.bodylength ?? fpJson.h,
27909
28055
  pitch: fpJson.p,
27910
28056
  padLength: fpJson.pl,
27911
28057
  padWidth: fpJson.pw,