jscad-electronics 0.0.120 → 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/index.d.ts +22 -2
- package/dist/index.js +184 -103
- package/dist/index.js.map +1 -1
- package/dist/vanilla.js +77 -3
- package/dist/vanilla.js.map +1 -1
- package/package.json +2 -2
package/dist/vanilla.js
CHANGED
|
@@ -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
|
}
|