@rulecad/fixings 0.1.3 → 0.1.4

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/CHANGELOG.md ADDED
@@ -0,0 +1,32 @@
1
+ # Changelog: @rulecad/fixings
2
+
3
+ What changed in each release, for someone upgrading a workspace. A **printed size** is a dimension of a part you
4
+ print (a hole's diameter, a seat's depth, a part's outline). Each release says whether any printed size moved, and
5
+ why.
6
+
7
+ ## 0.1.4: the kit reads its screws from fixings (Fixings 3)
8
+
9
+ ### What reads fixings now
10
+
11
+ This package is now where every screw size in the kit comes from:
12
+ - `@rulecad/cad`: `v.fixings` in a design, and the `fasten` relation in an assembly, which follows a screw through the
13
+ parts, chooses its sold length and counts it in `cad list`.
14
+ - `@rulecad/motors`: a motor's mounting screws, their clearance holes and counterbores.
15
+ - `@rulecad/pcb`: a board's mounting holes, named by their thread (`mount('M2', x, y)`).
16
+ - `@rulecad/shapes` does not import this package (that would make a cycle, since this package draws with shapes'
17
+ seats). Its seats take the screw's figures from here as plain numbers.
18
+
19
+ ### Changed
20
+
21
+ - `screwGroup(places, o).turns` is `null` when the twist about a single screw rounds to 0 N m at the thousandth it is
22
+ given in. It used to be `0`, and cad then warned "a twist of 0 N m about the one screw is held by friction alone"
23
+ on a part held by one screw whose own weight sits a hair off the screw's axis. A test holds this.
24
+
25
+ ### Printed sizes that moved
26
+
27
+ None. No hole, seat or piece of hardware this package draws changed size or shape.
28
+
29
+ ### What a workspace should change
30
+
31
+ Nothing is required. Code that tested `screwGroup(...).turns > 0` keeps working; code that tested `turns !== null`
32
+ to mean "a twist" now skips a twist that rounds to nothing, which is the intent.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulecad/fixings",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Screws, nuts, washers and inserts from rule sets, and the holes and seats they need in printed parts: a fixing as a model with sourced figures, holes sized by what they are for, counterbores, countersinks, nut pockets and insert bosses that print without supports, light solids of the hardware for an assembly, threads cut for printing, and first sums for a joint (engagement, stripping, preload, seating, the sold length that fits).",
5
5
  "type": "module",
6
6
  "exports": {
@@ -28,6 +28,7 @@
28
28
  "strength.d.mts",
29
29
  "draw.d.mts",
30
30
  "README.md",
31
+ "CHANGELOG.md",
31
32
  "LICENSE"
32
33
  ],
33
34
  "license": "MIT",
package/strength.d.mts CHANGED
@@ -224,7 +224,7 @@ export function lengthFor(stack: number | number[], m: Fixing | string, o?: {
224
224
  * @returns {{ count: number, centroid: number[], polar: number, line: boolean, screws: { at: number[], shear: number, tension: number, across: number[] }[], turns: number | null, rests: object[] }}
225
225
  * polar: the sum of the squared distances from the centroid, mm²; screws: each one's shear (N, across the joint) and
226
226
  * tension (N, along it: under 0, the load presses that screw's parts together); turns: a twist one screw alone
227
- * cannot hold by shear, in N·m (it holds by friction only)
227
+ * cannot hold by shear, in N·m (it holds by friction only), null when it rounds to 0 at the thousandth
228
228
  */
229
229
  export function screwGroup(places: number[][], o?: {
230
230
  force?: number[];
package/strength.mjs CHANGED
@@ -280,7 +280,7 @@ const crossed = (p, q) => [p[1] * q[2] - p[2] * q[1], p[2] * q[0] - p[0] * q[2],
280
280
  * @returns {{ count: number, centroid: number[], polar: number, line: boolean, screws: { at: number[], shear: number, tension: number, across: number[] }[], turns: number | null, rests: object[] }}
281
281
  * polar: the sum of the squared distances from the centroid, mm²; screws: each one's shear (N, across the joint) and
282
282
  * tension (N, along it: under 0, the load presses that screw's parts together); turns: a twist one screw alone
283
- * cannot hold by shear, in N·m (it holds by friction only)
283
+ * cannot hold by shear, in N·m (it holds by friction only), null when it rounds to 0 at the thousandth
284
284
  */
285
285
  export function screwGroup(places, o = {}) {
286
286
  const what = 'screwGroup';
@@ -302,7 +302,8 @@ export function screwGroup(places, o = {}) {
302
302
  tension = s.map((x) => F[2] / n + (S2 > 1e-9 ? (along * x) / S2 : 0) + (Math.abs(about) > 1e-9 ? Math.abs(about) / (n * o.pivot) : 0));
303
303
  }
304
304
  const screws = r.map(([x, y], i) => { const across = polar > 1e-9 ? [F[0] / n - (M[2] * y) / polar, F[1] / n + (M[2] * x) / polar] : [F[0] / n, F[1] / n]; return { at: [P[i][0], P[i][1]], shear: Math.hypot(...across), tension: tension[i], across }; }); // (not rounded: a check rounds what it prints)
305
- return { count: n, centroid: [r3(c[0]), r3(c[1])], polar: r3(polar), line, screws, turns: polar > 1e-9 || Math.abs(M[2]) < 1e-9 ? null : r3(Math.abs(M[2]) / 1000),
305
+ const twist = r3(Math.abs(M[2]) / 1000); // N·m, as said: a twist that rounds to nothing is none
306
+ return { count: n, centroid: [r3(c[0]), r3(c[1])], polar: r3(polar), line, screws, turns: polar > 1e-9 || !twist ? null : twist,
306
307
  rests: [{ name: 'the elastic method, in shear', value: 'P/n and M d / Σd² about the centroid', kind: 'spec', source: 'Eccentrically loaded bolt groups, the elastic method: https://steelcalculator.pages.dev/reference/bolt-group-capacity/ (read 2026-11-15)' },
307
308
  { name: 'the elastic method, in tension', value: 'a plane of tension through the centroid', kind: 'estimate', source: 'No source read: a moment shared as the shear is, each screw\'s pull growing with its distance from the centroid, which holds while the clamped parts stay pressed together. A joint that opens tips about its edge and loads its far screws more' }] };
308
309
  }