jscad-electronics 0.0.191 → 0.0.193
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/cables.d.ts +4 -1
- package/dist/cables.js +49 -5
- package/dist/cables.js.map +1 -1
- package/dist/index.js +20 -6
- package/dist/index.js.map +1 -1
- package/dist/vanilla.js +20 -6
- package/dist/vanilla.js.map +1 -1
- package/package.json +2 -2
package/dist/vanilla.js
CHANGED
|
@@ -1411,7 +1411,10 @@ import jscad3 from "@jscad/modeling";
|
|
|
1411
1411
|
|
|
1412
1412
|
// lib/utils/nemaMotorWireGeometry.ts
|
|
1413
1413
|
import jscad2 from "@jscad/modeling";
|
|
1414
|
-
import {
|
|
1414
|
+
import {
|
|
1415
|
+
getJstMotorConnector,
|
|
1416
|
+
getNemaMotorReferencePoints
|
|
1417
|
+
} from "@tscircuit/modelprinter";
|
|
1415
1418
|
|
|
1416
1419
|
// lib/utils/nemaMotorParameters.ts
|
|
1417
1420
|
import { mp, nemaMotorModelPropsSchema } from "@tscircuit/modelprinter";
|
|
@@ -1461,18 +1464,29 @@ function createNemaMotorWireGeometry(input) {
|
|
|
1461
1464
|
)
|
|
1462
1465
|
}));
|
|
1463
1466
|
}
|
|
1467
|
+
const connector = getJstMotorConnector(p.wireConnection);
|
|
1468
|
+
const { pinCount, pitch, bodyWidth, bodyHeight, matingDepth } = connector;
|
|
1469
|
+
const wall = pitch === 2 ? 0.6 : 0.3;
|
|
1470
|
+
const contactLength = pitch === 2 ? 3.4 : 2.4;
|
|
1471
|
+
const contactSize = pitch === 2 ? 0.5 : 0.3;
|
|
1464
1472
|
const shell = jscad2.booleans.subtract(
|
|
1465
|
-
jscad2.primitives.cuboid({
|
|
1466
|
-
|
|
1473
|
+
jscad2.primitives.cuboid({
|
|
1474
|
+
size: [matingDepth + 0.1, bodyWidth, bodyHeight],
|
|
1475
|
+
center: [(matingDepth - 0.1) / 2, 0, 0]
|
|
1476
|
+
}),
|
|
1477
|
+
jscad2.primitives.cuboid({
|
|
1478
|
+
size: [matingDepth - 0.5, bodyWidth - 2 * wall, bodyHeight - 2 * wall],
|
|
1479
|
+
center: [matingDepth / 2 + 0.55, 0, 0]
|
|
1480
|
+
})
|
|
1467
1481
|
);
|
|
1468
1482
|
return [
|
|
1469
1483
|
{ color: "#eeeeea", geometry: place(shell) },
|
|
1470
|
-
...Array.from({ length:
|
|
1484
|
+
...Array.from({ length: pinCount }, (_, i) => ({
|
|
1471
1485
|
color: "#b8bec6",
|
|
1472
1486
|
geometry: place(
|
|
1473
1487
|
jscad2.primitives.cuboid({
|
|
1474
|
-
size: [
|
|
1475
|
-
center: [
|
|
1488
|
+
size: [contactLength, contactSize, contactSize],
|
|
1489
|
+
center: [contactLength / 2, (i - (pinCount - 1) / 2) * pitch, 0]
|
|
1476
1490
|
})
|
|
1477
1491
|
)
|
|
1478
1492
|
}))
|