@rulecad/fixings 0.1.8 → 0.2.0
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 +36 -0
- package/README.md +1 -1
- package/bolts.d.mts +26 -18
- package/bolts.mjs +201 -49
- package/draw.d.mts +4 -2
- package/draw.mjs +58 -17
- package/fixings.d.mts +9 -6
- package/fixings.mjs +185 -26
- package/hardware.d.mts +42 -20
- package/hardware.mjs +388 -80
- package/holes.d.mts +32 -25
- package/holes.mjs +243 -61
- package/magnets.d.mts +45 -30
- package/magnets.mjs +521 -122
- package/model.d.mts +47 -29
- package/model.mjs +751 -134
- package/package.json +16 -30
- package/pins.d.mts +46 -32
- package/pins.mjs +480 -113
- package/seats.d.mts +61 -30
- package/seats.mjs +770 -144
- package/snaps.d.mts +32 -24
- package/snaps.mjs +770 -180
- package/strength.d.mts +65 -35
- package/strength.mjs +850 -181
- package/threads.d.mts +59 -42
- package/threads.mjs +910 -193
package/strength.d.mts
CHANGED
|
@@ -14,10 +14,12 @@ export function weakest(mat: any): {
|
|
|
14
14
|
/**
|
|
15
15
|
* Whether enough thread is engaged, against the engagement rule for what the thread is in: 1 diameter in steel, 2 in
|
|
16
16
|
* aluminium, 2.5 in plastic (the engagement rule set of @rulecad/rules).
|
|
17
|
-
* @param {Fixing | string} m a fixing's model or
|
|
17
|
+
* @param {Fixing | string} m a fixing's model or
|
|
18
|
+
* name @param {{ depth: number, material: string | object, sets?: object }} o
|
|
18
19
|
* depth: the length of thread engaged, in mm; material: a class (plastic, aluminium, steel), a material of the kit
|
|
19
20
|
* (pla, petg, abs, asa, pa_cf, al6061, al7075, s275, ss304) or a material's rule set
|
|
20
|
-
* @returns {{ thread: string, depth: number, need: number, turns: number, diameters: number, class: string,
|
|
21
|
+
* @returns {{ thread: string, depth: number, need: number, turns: number, diameters: number, class: string,
|
|
22
|
+
* material: string | null, enough: boolean, rests: object[], findings: object[] }}
|
|
21
23
|
* need: the depth that would do; turns: threads engaged; diameters: the depth in diameters of the screw
|
|
22
24
|
*/
|
|
23
25
|
export function engagement(m: Fixing | string, o?: {
|
|
@@ -40,13 +42,17 @@ export function engagement(m: Fixing | string, o?: {
|
|
|
40
42
|
* The load that strips an internal thread, from its shear area and the strength of what it is cut or formed in,
|
|
41
43
|
* against the screw's own proof load. The shear area is the handbook's for a 60° thread at its basic sizes,
|
|
42
44
|
* 0.875 π d Le; the shear strength is the material's strength over √3, an estimate.
|
|
43
|
-
* @param {Fixing | string} m @param {{ depth: number, material: string | object, screw?: 'steel' | 'stainless',
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
45
|
+
* @param {Fixing | string} m @param {{ depth: number, material: string | object, screw?: 'steel' | 'stainless',
|
|
46
|
+
* proof?: number, load?: number, sets?: object }} o
|
|
47
|
+
* depth: the length of thread engaged; material: what the internal thread is in; screw: steel (its property class,
|
|
48
|
+
* the default) or stainless; proof: another screw's proof stress in MPa (830 for class 10.9); load: the load the
|
|
49
|
+
* joint carries along the screw, in N, to hold with twice the margin
|
|
50
|
+
* @returns {{ thread: string, depth: number, material: string, area: number, shear: number, strip: number,
|
|
51
|
+
* stressArea: number, proof: number, margin: number, depthFor: number, load: number | null, rests: object[], findings:
|
|
52
|
+
* object[] }}
|
|
53
|
+
* area: the internal thread's shear area, mm²; shear: the shear strength taken, MPa; strip: the load that strips the
|
|
54
|
+
* thread, N; proof: the screw's proof load, N; margin: strip over proof (under 1: the thread goes first); depthFor:
|
|
55
|
+
* the depth at which the thread is as strong as the screw
|
|
50
56
|
*/
|
|
51
57
|
export function stripping(m: Fixing | string, o?: {
|
|
52
58
|
depth: number;
|
|
@@ -73,10 +79,14 @@ export function stripping(m: Fixing | string, o?: {
|
|
|
73
79
|
/**
|
|
74
80
|
* The clamp force a tightening torque gives, or the torque for a clamp force: T = K d F, with the nut factor K an
|
|
75
81
|
* estimate (0.2 unless given). Give torque or force.
|
|
76
|
-
* @param {Fixing | string} m @param {{ torque?: number, force?: number, K?: number, screw?: 'steel' | 'stainless',
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
82
|
+
* @param {Fixing | string} m @param {{ torque?: number, force?: number, K?: number, screw?: 'steel' | 'stainless',
|
|
83
|
+
* proof?: number, sets?: object }} o
|
|
84
|
+
* torque: in N·m; force: the clamp force (preload) wanted, in N; K: another nut factor (a lubricated thread's is
|
|
85
|
+
* lower)
|
|
86
|
+
* @returns {{ thread: string, torque: number, force: number, K: number, proof: number, share: number,
|
|
87
|
+
* full: { force: number, torque: number }, rests: object[], findings: object[] }}
|
|
88
|
+
* share: the force as a share of the screw's proof load; full: the force and torque of a screw tightened to three
|
|
89
|
+
* quarters of its proof load
|
|
80
90
|
*/
|
|
81
91
|
export function preload(m: Fixing | string, o?: {
|
|
82
92
|
torque?: number;
|
|
@@ -101,8 +111,10 @@ export function preload(m: Fixing | string, o?: {
|
|
|
101
111
|
};
|
|
102
112
|
/**
|
|
103
113
|
* The tightening torque for a clamp force: preload the other way round.
|
|
104
|
-
* @param {Fixing | string} m @param {{ force: number, K?: number, screw?: 'steel' | 'stainless', proof?: number,
|
|
105
|
-
*
|
|
114
|
+
* @param {Fixing | string} m @param {{ force: number, K?: number, screw?: 'steel' | 'stainless', proof?: number,
|
|
115
|
+
* sets?: object }} o
|
|
116
|
+
* @returns {{ thread: string, torque: number, force: number, K: number, proof: number, share: number,
|
|
117
|
+
* full: { force: number, torque: number }, rests: object[], findings: object[] }}
|
|
106
118
|
*/
|
|
107
119
|
export function torqueFor(m: Fixing | string, o?: {
|
|
108
120
|
force: number;
|
|
@@ -127,14 +139,18 @@ export function torqueFor(m: Fixing | string, o?: {
|
|
|
127
139
|
/**
|
|
128
140
|
* The pressure under a screw's head against what it sits on, and the washer that would bring it within. The head
|
|
129
141
|
* bears on the ring between its own diameter and the clearance hole as drawn; the limit is the material's strength.
|
|
130
|
-
* @param {Fixing | string} m @param {{ head?: string, material: string | object, force?: number, torque?: number,
|
|
142
|
+
* @param {Fixing | string} m @param {{ head?: string, material: string | object, force?: number, torque?: number,
|
|
143
|
+
* K?: number, hole?: string, printer?: object, screw?: 'steel' | 'stainless', proof?: number, sets?: object }} o
|
|
131
144
|
* head: cap, button, hex, countersunk or pan (default the model's, else cap); material: what the head sits on;
|
|
132
145
|
* force: the clamp force in N, or torque: the tightening torque in N·m (default a screw tightened fully, to three
|
|
133
146
|
* quarters of its proof load); hole: clearance (the default), close or loose
|
|
134
|
-
* @returns {{ thread: string, head: string, material: string, force: number, area: number, pressure: number,
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
147
|
+
* @returns {{ thread: string, head: string, material: string, force: number, area: number, pressure: number,
|
|
148
|
+
* limit: number, within: boolean,
|
|
149
|
+
* washer: { diameter: number, area: number, pressure: number, within: boolean } | null, most:
|
|
150
|
+
* { force: number, torque: number, washerForce: number | null, washerTorque: number | null }, rests: object[],
|
|
151
|
+
* findings: object[] }} area: the bearing ring under the head, mm²; pressure and limit in MPa; washer: the same under
|
|
152
|
+
* the thread's plain washer; most: the greatest clamp force the seat takes and the torque for it, bare and on the
|
|
153
|
+
* washer
|
|
138
154
|
*/
|
|
139
155
|
export function seating(m: Fixing | string, o?: {
|
|
140
156
|
head?: string;
|
|
@@ -174,18 +190,23 @@ export function seating(m: Fixing | string, o?: {
|
|
|
174
190
|
/**
|
|
175
191
|
* The sold length of screw that passes through a stack of parts and engages enough at the far end, without bottoming
|
|
176
192
|
* out or standing proud: the shortest that does. Refused by name where no sold length fits, with the nearest.
|
|
177
|
-
* @param {number | number[]} stack the thicknesses the screw passes through under its head, in order, in mm (a
|
|
193
|
+
* @param {number | number[]} stack the thicknesses the screw passes through under its head, in order, in mm (a
|
|
194
|
+
* countersunk
|
|
178
195
|
* screw's length includes its head, so its stack does too)
|
|
179
196
|
* @param {Fixing | string} m a thread or a screw ('M3', 'M3 button'): its head form is the model's, else cap
|
|
180
|
-
* @param {{ into: string | { kind: string, depth?: number, room?: number, through?: boolean, material?: string,
|
|
197
|
+
* @param {{ into: string | { kind: string, depth?: number, room?: number, through?: boolean, material?: string,
|
|
198
|
+
* nut?: string, length?: number }, head?: string, washer?: boolean, sunk?: number, sets?: object }} o
|
|
181
199
|
* into: what the screw ends in: 'pilot', 'tap', 'thread' (a printed one), 'insert' or 'nut', or the same with its
|
|
182
200
|
* depth (a blind hole's), room (how far the screw may go past where its thread starts), through (it may come out
|
|
183
201
|
* the far side), material (a tapped or printed thread's), nut (hex, square, lock) or length (another insert's);
|
|
184
|
-
* washer: a plain washer under the head; sunk: how far the head's seat lies under the first face (a counterbore's
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
202
|
+
* washer: a plain washer under the head; sunk: how far the head's seat lies under the first face (a counterbore's
|
|
203
|
+
* depth)
|
|
204
|
+
* @returns {{ name: string, thread: string, head: string, length: number, grip: number, engaged: number, need: number,
|
|
205
|
+
* room: number | null, spare: number | null, depth: number | null, into: string,
|
|
206
|
+
* lengths: { length: number, name: string, engaged: number, fits: 'short' | 'fits' | 'long' }[], rests: object[],
|
|
207
|
+
* findings: object[] }} grip: what the screw passes before its thread engages; engaged: thread in the far end; room:
|
|
208
|
+
* how far it may go (null: no limit); spare: room left past its tip; depth: for a blind hole not given a depth, the
|
|
209
|
+
* depth to draw; lengths: every sold length with its verdict
|
|
189
210
|
*/
|
|
190
211
|
export function lengthFor(stack: number | number[], m: Fixing | string, o?: {
|
|
191
212
|
into: string | {
|
|
@@ -234,7 +255,8 @@ export function lengthFor(stack: number | number[], m: Fixing | string, o?: {
|
|
|
234
255
|
* moment: [x, y, z] in N·m on that part, about `at`; at: where the force acts, [x, y] or [x, y, z] in mm, z the
|
|
235
256
|
* height off the joint's face (default the centroid); pivot: for screws in a line, how far the clamped face
|
|
236
257
|
* reaches past the line, in mm
|
|
237
|
-
* @returns {{ count: number, centroid: number[], polar: number, line: boolean, screws: { at: number[], shear: number,
|
|
258
|
+
* @returns {{ count: number, centroid: number[], polar: number, line: boolean, screws: { at: number[], shear: number,
|
|
259
|
+
* tension: number, across: number[] }[], turns: number | null, rests: object[] }}
|
|
238
260
|
* polar: the sum of the squared distances from the centroid, mm²; screws: each one's shear (N, across the joint) and
|
|
239
261
|
* tension (N, along it: under 0, the load presses that screw's parts together); turns: a twist one screw alone
|
|
240
262
|
* cannot hold by shear, in N·m (it holds by friction only), null when it rounds to 0 at the thousandth
|
|
@@ -263,15 +285,23 @@ export function screwGroup(places: number[][], o?: {
|
|
|
263
285
|
* internal thread strips, and the clamped parts slip, at its preload. The screw takes its preload and the whole pull
|
|
264
286
|
* on it (a printed part is far softer than a steel screw, so little of the pull goes into easing the clamp), with
|
|
265
287
|
* its shear, against its proof load; the thread takes the same pull and preload against its stripping load; the clamp
|
|
266
|
-
* is eased by the whole pull for slipping, the safe side each time.
|
|
267
|
-
*
|
|
268
|
-
*
|
|
288
|
+
* is eased by the whole pull for slipping, the safe side each time. The thread's margin is its stripping load over the
|
|
289
|
+
* preload and the pull together. With no torque given, the preload is the most that leaves the thread
|
|
290
|
+
* fixings.load_margin times the preload and the pull, within the seat's take over fixings.load_margin and three
|
|
291
|
+
* quarters of the proof load, and the torque for it is said: a stripping load is an estimate, and the clamp a torque
|
|
292
|
+
* gives scatters by a quarter to a third, so the preload is held to at most half the stripping load.
|
|
293
|
+
* @param {Fixing | string} m @param {{ tension?: number, shear?: number, depth?: number, material?: string | object,
|
|
294
|
+
* end?: string, torque?: number, most?: number, K?: number, friction?: number, screw?: 'steel' | 'stainless', proof?:
|
|
295
|
+
* number, sets?: object }} o
|
|
269
296
|
* tension, shear: the screw's share, in N; depth and material: the thread engaged and what it is in (a pilot, tap or
|
|
270
297
|
* printed thread), or end: 'insert' or 'nut' where the thread is metal; torque: the tightening torque given, N·m;
|
|
271
|
-
* most: the most clamp force the seat under the head takes, N; friction: between the clamped parts (default
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
298
|
+
* most: the most clamp force the seat under the head takes, N; friction: between the clamped parts (default
|
|
299
|
+
* fixings.clamp_friction)
|
|
300
|
+
* @returns {{ thread: string, tension: number, shear: number, preload: { force: number, torque: number,
|
|
301
|
+
* given: boolean }, proof: number, strip: number | null,
|
|
302
|
+
* margins: { screw: number, thread: number | null, slip: number | null }, margin: number, governs: string, rests:
|
|
303
|
+
* object[], findings: object[] }} margins: how many times the load each holds, the thread's counting the preload with
|
|
304
|
+
* the pull (null: not checked); margin: the least of the screw's and the thread's
|
|
275
305
|
*/
|
|
276
306
|
export function screwLoad(m: Fixing | string, o?: {
|
|
277
307
|
tension?: number;
|