jscad-electronics 0.0.190 → 0.0.192

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
@@ -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 { getNemaMotorReferencePoints } from "@tscircuit/modelprinter";
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({ size: [6.1, 13.9, 4.5], center: [2.95, 0, 0] }),
1466
- jscad2.primitives.cuboid({ size: [5.5, 12.7, 3.3], center: [3.55, 0, 0] })
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: 6 }, (_, i) => ({
1484
+ ...Array.from({ length: pinCount }, (_, i) => ({
1471
1485
  color: "#b8bec6",
1472
1486
  geometry: place(
1473
1487
  jscad2.primitives.cuboid({
1474
- size: [3.4, 0.5, 0.5],
1475
- center: [1.7, (i - 2.5) * 2, 0]
1488
+ size: [contactLength, contactSize, contactSize],
1489
+ center: [contactLength / 2, (i - (pinCount - 1) / 2) * pitch, 0]
1476
1490
  })
1477
1491
  )
1478
1492
  }))