jscad-electronics 0.0.142 → 0.0.143

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
@@ -5114,6 +5114,86 @@ var SmdPinHeader = ({
5114
5114
  }) });
5115
5115
  };
5116
5116
 
5117
+ // lib/Led5050.tsx
5118
+ var Led5050 = ({
5119
+ color = "#ffff00",
5120
+ bodyColor = "#ffffff",
5121
+ leadColor = "#dedede"
5122
+ }) => {
5123
+ const bodySize = 5;
5124
+ const leadSpan = 5.4;
5125
+ const bodyBottom = 0.2;
5126
+ const bodyHeight = 1.3;
5127
+ const bodyTop = bodyBottom + bodyHeight;
5128
+ const leadLength = 1.4;
5129
+ const leadWidth = 1;
5130
+ const leadThickness = 0.2;
5131
+ const leadCenterX = leadSpan / 2 - leadLength / 2;
5132
+ const lensRadius = 2;
5133
+ const lensHeight = 0.25;
5134
+ const lensTop = 1.55;
5135
+ const cornerCutDepth = 0.3;
5136
+ const leadYPositions = [-1.7, 0, 1.7];
5137
+ const leadSides = [-1, 1];
5138
+ return /* @__PURE__ */ jsxs(Fragment2, { children: [
5139
+ leadYPositions.flatMap(
5140
+ (y) => leadSides.map((side) => /* @__PURE__ */ jsx(
5141
+ Cuboid,
5142
+ {
5143
+ color: leadColor,
5144
+ size: [leadLength, leadWidth, leadThickness],
5145
+ center: [side * leadCenterX, y, leadThickness / 2]
5146
+ },
5147
+ `${side}-${y}`
5148
+ ))
5149
+ ),
5150
+ /* @__PURE__ */ jsx(Colorize, { color: bodyColor, children: /* @__PURE__ */ jsxs(Subtract, { children: [
5151
+ /* @__PURE__ */ jsx(
5152
+ ChipBody,
5153
+ {
5154
+ width: bodySize,
5155
+ length: bodySize,
5156
+ height: bodyHeight,
5157
+ heightAboveSurface: bodyBottom,
5158
+ center: { x: 0, y: 0, z: 0 },
5159
+ color: bodyColor,
5160
+ taperRatio: 0.036,
5161
+ straightHeightRatio: 0.01,
5162
+ includeNotch: false
5163
+ }
5164
+ ),
5165
+ /* @__PURE__ */ jsx(
5166
+ Cylinder,
5167
+ {
5168
+ radius: lensRadius,
5169
+ height: lensHeight,
5170
+ center: [0, 0, bodyTop - lensHeight / 2]
5171
+ }
5172
+ ),
5173
+ /* @__PURE__ */ jsx(
5174
+ Translate,
5175
+ {
5176
+ offset: [
5177
+ -bodySize / 2,
5178
+ bodySize / 2,
5179
+ bodyTop - cornerCutDepth / 2 + 5e-3
5180
+ ],
5181
+ children: /* @__PURE__ */ jsx(Rotate, { rotation: [0, 0, Math.PI / 4], children: /* @__PURE__ */ jsx(Cuboid, { size: [0.9, 0.9, cornerCutDepth + 0.01] }) })
5182
+ }
5183
+ )
5184
+ ] }) }),
5185
+ /* @__PURE__ */ jsx(
5186
+ Cylinder,
5187
+ {
5188
+ color,
5189
+ radius: lensRadius,
5190
+ height: lensHeight,
5191
+ center: [0, 0, lensTop - lensHeight / 2]
5192
+ }
5193
+ )
5194
+ ] });
5195
+ };
5196
+
5117
5197
  // lib/RJ45.tsx
5118
5198
  var range2 = (length) => Array.from({ length }, (_, index) => index);
5119
5199
  var RJ45 = ({
@@ -5359,6 +5439,8 @@ var Footprinter3d = ({ footprint }) => {
5359
5439
  normalizedFootprint = `zh${numPins}`;
5360
5440
  }
5361
5441
  const fpJson = fp2.string(normalizedFootprint).json();
5442
+ const colorMatch = footprint.match(/_color\(([^)]+)\)/);
5443
+ const color = colorMatch ? colorMatch[1] : void 0;
5362
5444
  switch (fpJson.fn) {
5363
5445
  case "dip":
5364
5446
  return /* @__PURE__ */ jsx(Dip, { numPins: fpJson.num_pins, pitch: fpJson.p, bodyWidth: fpJson.w });
@@ -5484,6 +5566,8 @@ var Footprinter3d = ({ footprint }) => {
5484
5566
  bodyWidth: fpJson.bh
5485
5567
  }
5486
5568
  );
5569
+ case "led5050":
5570
+ return /* @__PURE__ */ jsx(Led5050, { color });
5487
5571
  case "cap": {
5488
5572
  switch (fpJson.imperial) {
5489
5573
  case "0402":
@@ -5706,8 +5790,6 @@ var Footprinter3d = ({ footprint }) => {
5706
5790
  );
5707
5791
  }
5708
5792
  }
5709
- const colorMatch = footprint.match(/_color\(([^)]+)\)/);
5710
- const color = colorMatch ? colorMatch[1] : void 0;
5711
5793
  switch (fpJson.imperial) {
5712
5794
  case "0402":
5713
5795
  return /* @__PURE__ */ jsx(A0402, { color });