jscad-electronics 0.0.119 → 0.0.121

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
@@ -4094,7 +4094,7 @@ var StampBoard = ({
4094
4094
  for (let i = 0; i < leadsRight; i++) {
4095
4095
  const y = yOffset + i * leadsPitch;
4096
4096
  pads.push({
4097
- x: -halfBoardWidth + leadLength / 2,
4097
+ x: halfBoardWidth - leadLength / 2,
4098
4098
  y: -y,
4099
4099
  // Flip y
4100
4100
  pl: leadLength,
@@ -4102,8 +4102,8 @@ var StampBoard = ({
4102
4102
  });
4103
4103
  if (innerHoles) {
4104
4104
  holes.push(
4105
- { x: -halfBoardWidth, y: -y },
4106
- { x: -halfBoardWidth + innerHoleEdgeDistance, y: -y }
4105
+ { x: halfBoardWidth, y: -y },
4106
+ { x: halfBoardWidth - innerHoleEdgeDistance, y: -y }
4107
4107
  );
4108
4108
  }
4109
4109
  }
@@ -4113,7 +4113,7 @@ var StampBoard = ({
4113
4113
  for (let i = 0; i < leadsLeft; i++) {
4114
4114
  const y = yOffset + i * leadsPitch;
4115
4115
  pads.push({
4116
- x: halfBoardWidth - leadLength / 2,
4116
+ x: -halfBoardWidth + leadLength / 2,
4117
4117
  y: -y,
4118
4118
  // Flip y
4119
4119
  pl: leadLength,
@@ -4121,8 +4121,8 @@ var StampBoard = ({
4121
4121
  });
4122
4122
  if (innerHoles) {
4123
4123
  holes.push(
4124
- { x: halfBoardWidth, y: -y },
4125
- { x: halfBoardWidth - innerHoleEdgeDistance, y: -y }
4124
+ { x: -halfBoardWidth, y: -y },
4125
+ { x: -halfBoardWidth + innerHoleEdgeDistance, y: -y }
4126
4126
  );
4127
4127
  }
4128
4128
  }
@@ -4134,14 +4134,14 @@ var StampBoard = ({
4134
4134
  pads.push({
4135
4135
  x: -x,
4136
4136
  // Flip x
4137
- y: -bodyLength10 / 2 + leadLength / 2,
4137
+ y: bodyLength10 / 2 - leadLength / 2,
4138
4138
  pl: leadWidth,
4139
4139
  pw: leadLength
4140
4140
  });
4141
4141
  if (innerHoles) {
4142
4142
  holes.push(
4143
- { x: -x, y: -bodyLength10 / 2 },
4144
- { x: -x, y: -bodyLength10 / 2 + innerHoleEdgeDistance }
4143
+ { x: -x, y: bodyLength10 / 2 },
4144
+ { x: -x, y: bodyLength10 / 2 - innerHoleEdgeDistance }
4145
4145
  );
4146
4146
  }
4147
4147
  }
@@ -4153,14 +4153,14 @@ var StampBoard = ({
4153
4153
  pads.push({
4154
4154
  x: -x,
4155
4155
  // Flip x
4156
- y: bodyLength10 / 2 - leadLength / 2,
4156
+ y: -bodyLength10 / 2 + leadLength / 2,
4157
4157
  pl: leadWidth,
4158
4158
  pw: leadLength
4159
4159
  });
4160
4160
  if (innerHoles) {
4161
4161
  holes.push(
4162
- { x: -x, y: bodyLength10 / 2 },
4163
- { x: -x, y: bodyLength10 / 2 - innerHoleEdgeDistance }
4162
+ { x: -x, y: -bodyLength10 / 2 },
4163
+ { x: -x, y: -bodyLength10 / 2 + innerHoleEdgeDistance }
4164
4164
  );
4165
4165
  }
4166
4166
  }
@@ -4216,6 +4216,68 @@ var StampBoard = ({
4216
4216
  ] });
4217
4217
  };
4218
4218
 
4219
+ // lib/Screen.tsx
4220
+ var Screen = ({
4221
+ width: width10 = 30,
4222
+ height: height10 = 22,
4223
+ thickness = 1,
4224
+ bezelInset = 2,
4225
+ bezelDepth = 1,
4226
+ screenColor = "#001414",
4227
+ bezelColor = "#0f1116",
4228
+ screenWidth,
4229
+ screenHeight,
4230
+ offset
4231
+ }) => {
4232
+ const w = width10;
4233
+ const h2 = height10;
4234
+ const stackHeight = Math.max(thickness, 0.4);
4235
+ const clampedBezelDepth = Math.max(Math.min(bezelDepth, stackHeight), 0.2);
4236
+ const backBlockHeight = Math.max(stackHeight - clampedBezelDepth, 0);
4237
+ const inset = Math.max(bezelInset, 0);
4238
+ const innerWidth = Math.max(screenWidth ?? w - inset * 2, 2);
4239
+ const innerHeight = Math.max(screenHeight ?? h2 - inset * 2, 2);
4240
+ const screenThickness = Math.min(
4241
+ Math.max(clampedBezelDepth * 0.6, 0.2),
4242
+ clampedBezelDepth
4243
+ );
4244
+ const offsetX = offset?.x ?? 0;
4245
+ const offsetY = offset?.y ?? 0;
4246
+ const offsetZ = offset?.z ?? 0;
4247
+ return /* @__PURE__ */ jsxs(Translate, { offset: { x: offsetX, y: offsetY, z: offsetZ }, children: [
4248
+ backBlockHeight > 0 && /* @__PURE__ */ jsx(Colorize, { color: bezelColor, children: /* @__PURE__ */ jsx(
4249
+ Cuboid,
4250
+ {
4251
+ size: [w, h2, backBlockHeight],
4252
+ offset: [0, 0, backBlockHeight / 2]
4253
+ }
4254
+ ) }),
4255
+ /* @__PURE__ */ jsx(Colorize, { color: bezelColor, children: /* @__PURE__ */ jsxs(Subtract, { children: [
4256
+ /* @__PURE__ */ jsx(
4257
+ Cuboid,
4258
+ {
4259
+ size: [w, h2, clampedBezelDepth],
4260
+ offset: [0, 0, backBlockHeight + clampedBezelDepth / 2]
4261
+ }
4262
+ ),
4263
+ /* @__PURE__ */ jsx(
4264
+ Cuboid,
4265
+ {
4266
+ size: [innerWidth, innerHeight, clampedBezelDepth + 0.02],
4267
+ offset: [0, 0, backBlockHeight + clampedBezelDepth / 2]
4268
+ }
4269
+ )
4270
+ ] }) }),
4271
+ /* @__PURE__ */ jsx(Colorize, { color: screenColor, children: /* @__PURE__ */ jsx(
4272
+ Cuboid,
4273
+ {
4274
+ size: [innerWidth, innerHeight, screenThickness],
4275
+ offset: [0, 0, backBlockHeight + screenThickness / 2]
4276
+ }
4277
+ ) })
4278
+ ] });
4279
+ };
4280
+
4219
4281
  // lib/MountedPcbModule.tsx
4220
4282
  var MountedPcbModule = ({
4221
4283
  numPins = 5,
@@ -4231,8 +4293,10 @@ var MountedPcbModule = ({
4231
4293
  holeInset = 1,
4232
4294
  pinRowHoleEdgeToEdgeDist = 2,
4233
4295
  female,
4234
- nopin
4296
+ nopin,
4297
+ screen
4235
4298
  }) => {
4299
+ const showScreen = screen ?? false;
4236
4300
  const boardCenterZ = boardThickness / 2;
4237
4301
  const numPinsPerRow = Math.ceil(numPins / rows);
4238
4302
  let calculatedWidth;
@@ -4310,6 +4374,7 @@ var MountedPcbModule = ({
4310
4374
  const longSidePinLength = 6;
4311
4375
  const shortSidePinLength = 3;
4312
4376
  const boardOffsetZ = nopin || female ? 0 : pinBodyHeight;
4377
+ const boardTopZ = boardOffsetZ + boardThickness;
4313
4378
  const boardBody = /* @__PURE__ */ jsx(Colorize, { color: "#008080", children: /* @__PURE__ */ jsxs(Subtract, { children: [
4314
4379
  /* @__PURE__ */ jsx(
4315
4380
  Cuboid,
@@ -4381,7 +4446,15 @@ var MountedPcbModule = ({
4381
4446
  boardBody,
4382
4447
  platedHoles,
4383
4448
  !female && !nopin && headerPins,
4384
- female && femaleHeaderRow
4449
+ female && femaleHeaderRow,
4450
+ showScreen && /* @__PURE__ */ jsx(
4451
+ Screen,
4452
+ {
4453
+ width: finalWidth * 0.8,
4454
+ height: finalHeight * 0.6,
4455
+ offset: { x: 0, y: 0, z: boardTopZ }
4456
+ }
4457
+ )
4385
4458
  ] });
4386
4459
  };
4387
4460
 
@@ -4665,7 +4738,8 @@ var Footprinter3d = ({ footprint }) => {
4665
4738
  holeInset,
4666
4739
  pinRowHoleEdgeToEdgeDist,
4667
4740
  nopin: fpJson.nopin,
4668
- female: fpJson.female
4741
+ female: fpJson.female,
4742
+ screen: fpJson.screen
4669
4743
  }
4670
4744
  );
4671
4745
  }