jscad-electronics 0.0.191 → 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/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/index.js
CHANGED
|
@@ -2151,7 +2151,10 @@ import jscad3 from "@jscad/modeling";
|
|
|
2151
2151
|
|
|
2152
2152
|
// lib/utils/nemaMotorWireGeometry.ts
|
|
2153
2153
|
import jscad2 from "@jscad/modeling";
|
|
2154
|
-
import {
|
|
2154
|
+
import {
|
|
2155
|
+
getJstMotorConnector,
|
|
2156
|
+
getNemaMotorReferencePoints
|
|
2157
|
+
} from "@tscircuit/modelprinter";
|
|
2155
2158
|
|
|
2156
2159
|
// lib/utils/nemaMotorParameters.ts
|
|
2157
2160
|
import { mp, nemaMotorModelPropsSchema } from "@tscircuit/modelprinter";
|
|
@@ -2201,18 +2204,29 @@ function createNemaMotorWireGeometry(input) {
|
|
|
2201
2204
|
)
|
|
2202
2205
|
}));
|
|
2203
2206
|
}
|
|
2207
|
+
const connector = getJstMotorConnector(p.wireConnection);
|
|
2208
|
+
const { pinCount, pitch, bodyWidth, bodyHeight, matingDepth } = connector;
|
|
2209
|
+
const wall = pitch === 2 ? 0.6 : 0.3;
|
|
2210
|
+
const contactLength = pitch === 2 ? 3.4 : 2.4;
|
|
2211
|
+
const contactSize = pitch === 2 ? 0.5 : 0.3;
|
|
2204
2212
|
const shell = jscad2.booleans.subtract(
|
|
2205
|
-
jscad2.primitives.cuboid({
|
|
2206
|
-
|
|
2213
|
+
jscad2.primitives.cuboid({
|
|
2214
|
+
size: [matingDepth + 0.1, bodyWidth, bodyHeight],
|
|
2215
|
+
center: [(matingDepth - 0.1) / 2, 0, 0]
|
|
2216
|
+
}),
|
|
2217
|
+
jscad2.primitives.cuboid({
|
|
2218
|
+
size: [matingDepth - 0.5, bodyWidth - 2 * wall, bodyHeight - 2 * wall],
|
|
2219
|
+
center: [matingDepth / 2 + 0.55, 0, 0]
|
|
2220
|
+
})
|
|
2207
2221
|
);
|
|
2208
2222
|
return [
|
|
2209
2223
|
{ color: "#eeeeea", geometry: place(shell) },
|
|
2210
|
-
...Array.from({ length:
|
|
2224
|
+
...Array.from({ length: pinCount }, (_, i) => ({
|
|
2211
2225
|
color: "#b8bec6",
|
|
2212
2226
|
geometry: place(
|
|
2213
2227
|
jscad2.primitives.cuboid({
|
|
2214
|
-
size: [
|
|
2215
|
-
center: [
|
|
2228
|
+
size: [contactLength, contactSize, contactSize],
|
|
2229
|
+
center: [contactLength / 2, (i - (pinCount - 1) / 2) * pitch, 0]
|
|
2216
2230
|
})
|
|
2217
2231
|
)
|
|
2218
2232
|
}))
|