@rulecad/fixings 0.1.9 → 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 +30 -0
- 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 +4 -4
- 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 +64 -38
- package/strength.mjs +849 -184
- package/threads.d.mts +59 -42
- package/threads.mjs +910 -193
package/seats.d.mts
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
* A counterbore for a screw's head, as numbers: wide enough for the head with the printer's fit round it, and deep
|
|
3
3
|
* enough to hide it.
|
|
4
4
|
* @param {Fixing | string} m
|
|
5
|
-
* @param {{ head?: string, depth?: number, diameter?: number, length?: number, thickness?: number, hole?: string,
|
|
5
|
+
* @param {{ head?: string, depth?: number, diameter?: number, length?: number, thickness?: number, hole?: string,
|
|
6
|
+
* printer?: object, into?: string, axis?: string, sets?: object }} [o]
|
|
6
7
|
* head: cap, button, hex or pan (default the model's, else cap); depth: of the seat (default the head's height, up to
|
|
7
8
|
* a whole layer); diameter: of the seat, for a socket's room; length: the whole hole's, from the face, to cut the
|
|
8
|
-
* screw's hole as well; thickness: the part's there (a seat deeper than the part is refused); hole: clearance, close
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* screw's hole as well; thickness: the part's there (a seat deeper than the part is refused); hole: clearance, close
|
|
10
|
+
* or loose
|
|
11
|
+
* @returns {{ thread: string, head: string, diameter: number, depth: number, sunk: number, hole: number,
|
|
12
|
+
* length: number | null, cone: number, into: string, teardrop: boolean, rests: object[], findings: object[] }}
|
|
13
|
+
* sunk: how far the head's top lies under the face (below 0: it stands proud); cone: the height of the 45° cone the
|
|
14
|
+
* seat ends in where it goes up from the bed
|
|
11
15
|
*/
|
|
12
16
|
export function counterboreModel(m: Fixing | string, o?: {
|
|
13
17
|
head?: string;
|
|
@@ -38,7 +42,8 @@ export function counterboreModel(m: Fixing | string, o?: {
|
|
|
38
42
|
* A counterbore for a screw's head, to subtract, with the screw's hole on through the part where length is given.
|
|
39
43
|
* On its side, the seat and the hole are one teardrop cutter: a 45° roof over each.
|
|
40
44
|
* @param {Fixing | string} m
|
|
41
|
-
* @param {{ head?: string, depth?: number, diameter?: number, length?: number, hole?: string, printer?: object,
|
|
45
|
+
* @param {{ head?: string, depth?: number, diameter?: number, length?: number, hole?: string, printer?: object,
|
|
46
|
+
* into?: string, axis?: string, sets?: object, at?: number[] }} [o] as counterboreModel; at: the point on the face
|
|
42
47
|
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
43
48
|
*/
|
|
44
49
|
export function counterbore(m: Fixing | string, o?: {
|
|
@@ -57,9 +62,11 @@ export function counterbore(m: Fixing | string, o?: {
|
|
|
57
62
|
* A countersink for a flat-head screw, as numbers: a cone to the head's angle, as wide as the head's sharp edge, so
|
|
58
63
|
* any head sits flush.
|
|
59
64
|
* @param {Fixing | string} m
|
|
60
|
-
* @param {{ length?: number, thickness?: number, hole?: string, printer?: object, into?: string, axis?: string,
|
|
65
|
+
* @param {{ length?: number, thickness?: number, hole?: string, printer?: object, into?: string, axis?: string,
|
|
66
|
+
* sets?: object }} [o] length: the whole hole's, from the face (default the cone and no more);
|
|
61
67
|
* thickness: the part's there (a cone deeper than the part is refused)
|
|
62
|
-
* @returns {{ thread: string, diameter: number, angle: number, depth: number, hole: number, length: number,
|
|
68
|
+
* @returns {{ thread: string, diameter: number, angle: number, depth: number, hole: number, length: number,
|
|
69
|
+
* into: string, teardrop: boolean, rests: object[], findings: object[] }}
|
|
63
70
|
* diameter: of the cone at the face, as drawn; depth: of the cone
|
|
64
71
|
*/
|
|
65
72
|
export function countersinkModel(m: Fixing | string, o?: {
|
|
@@ -86,7 +93,8 @@ export function countersinkModel(m: Fixing | string, o?: {
|
|
|
86
93
|
* A countersink and its hole, to subtract, the head flush with the face at `at`. A 90° head goes through
|
|
87
94
|
* @rulecad/shapes' countersink; another angle (an inch screw's 82°) is drawn here in the same form.
|
|
88
95
|
* @param {Fixing | string} m
|
|
89
|
-
* @param {{ length?: number, hole?: string, printer?: object, into?: string, axis?: string, sets?: object,
|
|
96
|
+
* @param {{ length?: number, hole?: string, printer?: object, into?: string, axis?: string, sets?: object,
|
|
97
|
+
* at?: number[] }} [o] as countersinkModel
|
|
90
98
|
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
91
99
|
*/
|
|
92
100
|
export function countersink(m: Fixing | string, o?: {
|
|
@@ -101,11 +109,16 @@ export function countersink(m: Fixing | string, o?: {
|
|
|
101
109
|
/**
|
|
102
110
|
* A pocket for a nut, let in from a face along the screw's axis, as numbers.
|
|
103
111
|
* @param {Fixing | string} m
|
|
104
|
-
* @param {{ kind?: string, depth?: number, thickness?: number, fit?: string | number, hole?: string, printer?: object,
|
|
112
|
+
* @param {{ kind?: string, depth?: number, thickness?: number, fit?: string | number, hole?: string, printer?: object,
|
|
113
|
+
* into?: string, axis?: string, sets?: object }} [o]
|
|
105
114
|
* kind: hex, square or lock (default the model's, else hex); depth: of the pocket (default the nut's height and two
|
|
106
|
-
* layers); thickness: the part's there (a pocket deeper than the part is refused); fit: snug (the default: the
|
|
107
|
-
*
|
|
108
|
-
*
|
|
115
|
+
* layers); thickness: the part's there (a pocket deeper than the part is refused); fit: snug (the default: the
|
|
116
|
+
* printer's measured nut_fit where it has one, else no clearance once printed, so the nut cannot turn), slip, press,
|
|
117
|
+
* or a clearance in mm
|
|
118
|
+
* @returns {{ thread: string, kind: string, flats: number, nominal: number, corner: number, depth: number,
|
|
119
|
+
* height: number, hole: number, clearance: number, roof: number, into: string, rests: object[], findings: object[] }}
|
|
120
|
+
* flats: across the flats, as drawn; nominal: the nut's; corner: across the pocket's corners; roof: the height of the
|
|
121
|
+
* 45° roof, going up from the bed
|
|
109
122
|
*/
|
|
110
123
|
export function nutPocketModel(m: Fixing | string, o?: {
|
|
111
124
|
kind?: string;
|
|
@@ -136,7 +149,8 @@ export function nutPocketModel(m: Fixing | string, o?: {
|
|
|
136
149
|
* A pocket for a nut, to subtract: open at the face at `at`, going in along the screw's axis. A hexagon goes through
|
|
137
150
|
* @rulecad/shapes' nutPocket. The screw's hole is a hole() of its own.
|
|
138
151
|
* @param {Fixing | string} m
|
|
139
|
-
* @param {{ kind?: string, depth?: number, fit?: string | number, hole?: string, printer?: object, into?: string,
|
|
152
|
+
* @param {{ kind?: string, depth?: number, fit?: string | number, hole?: string, printer?: object, into?: string,
|
|
153
|
+
* axis?: string, sets?: object, at?: number[] }} [o] as nutPocketModel
|
|
140
154
|
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
141
155
|
*/
|
|
142
156
|
export function nutPocket(m: Fixing | string, o?: {
|
|
@@ -153,13 +167,17 @@ export function nutPocket(m: Fixing | string, o?: {
|
|
|
153
167
|
/**
|
|
154
168
|
* A slot a nut slides into from the side, across the screw's axis, as numbers.
|
|
155
169
|
* @param {Fixing | string} m
|
|
156
|
-
* @param {{ kind?: string, axis?: 'x' | 'y' | 'z', into?: string, depth: number, fit?: string | number, hole?: string,
|
|
170
|
+
* @param {{ kind?: string, axis?: 'x' | 'y' | 'z', into?: string, depth: number, fit?: string | number, hole?: string,
|
|
171
|
+
* printer?: object, sets?: object }} o
|
|
157
172
|
* axis: the screw's (default z, standing up); into: the way the nut slides in, square to the axis (default +x for a
|
|
158
173
|
* screw standing up, -z, dropped in from the top, for one lying down); depth: from the face to the screw's axis;
|
|
159
|
-
* fit: slip (the default: the nut slides in by hand; the printer's measured nut_slip where it has one, else its
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
174
|
+
* fit: slip (the default: the nut slides in by hand; the printer's measured nut_slip where it has one, else its
|
|
175
|
+
* slip), snug, press, or a clearance in mm
|
|
176
|
+
* @returns {{ thread: string, kind: string, width: number, gap: number, depth: number, reach: number, hole: number,
|
|
177
|
+
* clearance: number, axis: string, into: string, span: number, rise: number, rests: object[], findings: object[] }}
|
|
178
|
+
* width: across the nut's flats, as drawn; clearance: the fit's, across the flats; gap: along the screw, for the
|
|
179
|
+
* nut's height; reach: how far the slot goes in from the face; span: what its roof bridges; rise: how far the roof
|
|
180
|
+
* rises at 45° where that is wider than the printer bridges
|
|
163
181
|
*/
|
|
164
182
|
export function nutTrapModel(m: Fixing | string, o?: {
|
|
165
183
|
kind?: string;
|
|
@@ -191,7 +209,8 @@ export function nutTrapModel(m: Fixing | string, o?: {
|
|
|
191
209
|
* From a side it goes through @rulecad/shapes' wallOpening (a roof that bridges, rising at 45° where it is too wide);
|
|
192
210
|
* dropped in from the top, the slot ends in the nut's own outline, so the nut sits on the screw's axis.
|
|
193
211
|
* @param {Fixing | string} m
|
|
194
|
-
* @param {{ kind?: string, axis?: 'x' | 'y' | 'z', into?: string, depth: number, fit?: string | number, hole?: string,
|
|
212
|
+
* @param {{ kind?: string, axis?: 'x' | 'y' | 'z', into?: string, depth: number, fit?: string | number, hole?: string,
|
|
213
|
+
* printer?: object, sets?: object, at?: number[] }} o as nutTrapModel
|
|
195
214
|
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
196
215
|
*/
|
|
197
216
|
export function nutTrap(m: Fixing | string, o?: {
|
|
@@ -205,7 +224,8 @@ export function nutTrap(m: Fixing | string, o?: {
|
|
|
205
224
|
sets?: object;
|
|
206
225
|
at?: number[];
|
|
207
226
|
}): object;
|
|
208
|
-
/** A slot for a thin square nut, as numbers: nutTrapModel for a square nut, dropped in from the top across a screw
|
|
227
|
+
/** A slot for a thin square nut, as numbers: nutTrapModel for a square nut, dropped in from the top across a screw
|
|
228
|
+
* lying along x unless told otherwise. */
|
|
209
229
|
export function squareNutSlotModel(m: any, o?: {}): {
|
|
210
230
|
thread: string;
|
|
211
231
|
kind: string;
|
|
@@ -223,9 +243,11 @@ export function squareNutSlotModel(m: any, o?: {}): {
|
|
|
223
243
|
findings: object[];
|
|
224
244
|
};
|
|
225
245
|
/**
|
|
226
|
-
* A slot for a thin square nut (DIN 562), to subtract: the nut drops in from the top and the screw comes in from the
|
|
246
|
+
* A slot for a thin square nut (DIN 562), to subtract: the nut drops in from the top and the screw comes in from the
|
|
247
|
+
* side.
|
|
227
248
|
* @param {Fixing | string} m
|
|
228
|
-
* @param {{ axis?: 'x' | 'y' | 'z', into?: string, depth: number, fit?: string | number, printer?: object,
|
|
249
|
+
* @param {{ axis?: 'x' | 'y' | 'z', into?: string, depth: number, fit?: string | number, printer?: object,
|
|
250
|
+
* sets?: object, at?: number[] }} o as nutTrap
|
|
229
251
|
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
230
252
|
*/
|
|
231
253
|
export function squareNutSlot(m: Fixing | string, o?: {
|
|
@@ -242,10 +264,13 @@ export function squareNutSlot(m: Fixing | string, o?: {
|
|
|
242
264
|
* high as the nut and a layer, and a 45° roof over it to the screw's hole. The pause height is where the pocket's
|
|
243
265
|
* walls end: the printer stops there, the nut goes in, and the next layers close the roof.
|
|
244
266
|
* @param {Fixing | string} m
|
|
245
|
-
* @param {{ kind?: string, fit?: string | number, hole?: string, thickness?: number, printer?: object, sets?: object,
|
|
267
|
+
* @param {{ kind?: string, fit?: string | number, hole?: string, thickness?: number, printer?: object, sets?: object,
|
|
268
|
+
* at?: number[] }} [o] at: the middle of the pocket's floor, its z measured from the bed; fit: slip by default;
|
|
246
269
|
* thickness: the part's height there, from the bed (a pocket whose roof would break out of the top is refused)
|
|
247
|
-
* @returns {{ thread: string, kind: string, flats: number, height: number, pause: number, layer: number, roof: number,
|
|
248
|
-
*
|
|
270
|
+
* @returns {{ thread: string, kind: string, flats: number, height: number, pause: number, layer: number, roof: number,
|
|
271
|
+
* top: number, hole: number, rests: object[], findings: object[] }}
|
|
272
|
+
* height: of the pocket's upright walls; pause: the z to pause at; layer: the number of the last layer laid before
|
|
273
|
+
* the pause; top: the z where the roof meets the hole
|
|
249
274
|
*/
|
|
250
275
|
export function captiveNutModel(m: Fixing | string, o?: {
|
|
251
276
|
kind?: string;
|
|
@@ -271,7 +296,8 @@ export function captiveNutModel(m: Fixing | string, o?: {
|
|
|
271
296
|
/**
|
|
272
297
|
* A nut closed inside the part, to subtract: the pocket and its roof, from the floor at `at` upwards. The screw's hole
|
|
273
298
|
* is a hole() of its own, through the floor.
|
|
274
|
-
* @param {Fixing | string} m @param {{ kind?: string, fit?: string | number, hole?: string, printer?: object,
|
|
299
|
+
* @param {Fixing | string} m @param {{ kind?: string, fit?: string | number, hole?: string, printer?: object,
|
|
300
|
+
* sets?: object, at?: number[] }} [o] as captiveNutModel
|
|
275
301
|
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
276
302
|
*/
|
|
277
303
|
export function captiveNut(m: Fixing | string, o?: {
|
|
@@ -287,11 +313,14 @@ export function captiveNut(m: Fixing | string, o?: {
|
|
|
287
313
|
* from the insert's rules. Refused where the wall is thinner than the insert's rule allows, or the part shorter than
|
|
288
314
|
* the insert.
|
|
289
315
|
* @param {Fixing | string} m
|
|
290
|
-
* @param {{ height?: number, outer?: number, wall?: number, through?: boolean, root?: number, printer?: object,
|
|
316
|
+
* @param {{ height?: number, outer?: number, wall?: number, through?: boolean, root?: number, printer?: object,
|
|
317
|
+
* sets?: object }} [o]
|
|
291
318
|
* height: of the boss, or the part's thickness there (default the blind hole's depth, up to a whole layer); outer:
|
|
292
319
|
* the boss's diameter, or wall: the plastic round the hole (default the insert's least wall); through: the hole runs
|
|
293
320
|
* out of the far side; root: the 45° flare where the boss meets what it stands on (default the printer's chamfer)
|
|
294
|
-
* @returns {{ thread: string, hole: number, depth: number, through: boolean, outer: number, wall: number,
|
|
321
|
+
* @returns {{ thread: string, hole: number, depth: number, through: boolean, outer: number, wall: number,
|
|
322
|
+
* least: number, height: number, root: number, lead: number, below: number, insert: { diameter: number,
|
|
323
|
+
* length: number }, rests: object[], findings: object[] }}
|
|
295
324
|
* hole: as drawn; least: the wall the insert's rule asks; below: how far a blind hole runs on under the boss's foot
|
|
296
325
|
*/
|
|
297
326
|
export function insertBossModel(m: Fixing | string, o?: {
|
|
@@ -324,7 +353,8 @@ export function insertBossModel(m: Fixing | string, o?: {
|
|
|
324
353
|
/**
|
|
325
354
|
* A boss for a heat-set insert: the column to add, standing up from `at` (the middle of its foot), and the hole to
|
|
326
355
|
* subtract once the boss is joined to what it stands on.
|
|
327
|
-
* @param {Fixing | string} m @param {{ height?: number, outer?: number, wall?: number, through?: boolean,
|
|
356
|
+
* @param {Fixing | string} m @param {{ height?: number, outer?: number, wall?: number, through?: boolean,
|
|
357
|
+
* root?: number, printer?: object, sets?: object, at?: number[] }} [o] as insertBossModel
|
|
328
358
|
* @returns {{ boss: object, hole: object, model: object }} boss: a JSCAD geom3 to add; hole: one to subtract
|
|
329
359
|
*/
|
|
330
360
|
export function insertBoss(m: Fixing | string, o?: {
|
|
@@ -345,7 +375,8 @@ export function insertBoss(m: Fixing | string, o?: {
|
|
|
345
375
|
* What a printer can make of it, as findings. A fixing is bought, so it fails, and so does a screw, a nut, a washer
|
|
346
376
|
* or an insert drawn as a light solid; a hole's, a seat's or a printed thread's model (or the solid made from one)
|
|
347
377
|
* gives its finding on how it prints in the direction it was drawn for, and so does hardware with its thread drawn.
|
|
348
|
-
* @param {object} x a fixing's model, a model from holeModel, threadModel, a seat's twin or a piece of hardware's, or a
|
|
378
|
+
* @param {object} x a fixing's model, a model from holeModel, threadModel, a seat's twin or a piece of hardware's, or a
|
|
379
|
+
* solid one of them made
|
|
349
380
|
* @returns {object[]} findings
|
|
350
381
|
*/
|
|
351
382
|
export function printable(x: object): object[];
|