@rulecad/fixings 0.0.1 → 0.1.1
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/README.md +627 -22
- package/draw.d.mts +46 -0
- package/draw.mjs +85 -0
- package/fixings.d.mts +26 -0
- package/fixings.mjs +47 -4
- package/hardware.d.mts +215 -0
- package/hardware.mjs +181 -0
- package/holes.d.mts +135 -0
- package/holes.mjs +157 -0
- package/model.d.mts +253 -0
- package/model.mjs +382 -0
- package/package.json +37 -6
- package/seats.d.mts +353 -0
- package/seats.mjs +334 -0
- package/strength.d.mts +221 -0
- package/strength.mjs +262 -0
- package/threads.d.mts +216 -0
- package/threads.mjs +411 -0
package/seats.d.mts
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
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
|
+
* enough to hide it.
|
|
4
|
+
* @param {Fixing | string} m
|
|
5
|
+
* @param {{ head?: string, depth?: number, diameter?: number, length?: number, thickness?: number, hole?: string, printer?: object, into?: string, axis?: string, sets?: object }} [o]
|
|
6
|
+
* head: cap, button, hex or pan (default the model's, else cap); depth: of the seat (default the head's height, up to
|
|
7
|
+
* 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 or loose
|
|
9
|
+
* @returns {{ thread: string, head: string, diameter: number, depth: number, sunk: number, hole: number, length: number | null, cone: number, into: string, teardrop: boolean, rests: object[], findings: object[] }}
|
|
10
|
+
* sunk: how far the head's top lies under the face (below 0: it stands proud); cone: the height of the 45° cone the seat ends in where it goes up from the bed
|
|
11
|
+
*/
|
|
12
|
+
export function counterboreModel(m: Fixing | string, o?: {
|
|
13
|
+
head?: string;
|
|
14
|
+
depth?: number;
|
|
15
|
+
diameter?: number;
|
|
16
|
+
length?: number;
|
|
17
|
+
thickness?: number;
|
|
18
|
+
hole?: string;
|
|
19
|
+
printer?: object;
|
|
20
|
+
into?: string;
|
|
21
|
+
axis?: string;
|
|
22
|
+
sets?: object;
|
|
23
|
+
}): {
|
|
24
|
+
thread: string;
|
|
25
|
+
head: string;
|
|
26
|
+
diameter: number;
|
|
27
|
+
depth: number;
|
|
28
|
+
sunk: number;
|
|
29
|
+
hole: number;
|
|
30
|
+
length: number | null;
|
|
31
|
+
cone: number;
|
|
32
|
+
into: string;
|
|
33
|
+
teardrop: boolean;
|
|
34
|
+
rests: object[];
|
|
35
|
+
findings: object[];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A counterbore for a screw's head, to subtract, with the screw's hole on through the part where length is given.
|
|
39
|
+
* On its side, the seat and the hole are one teardrop cutter: a 45° roof over each.
|
|
40
|
+
* @param {Fixing | string} m
|
|
41
|
+
* @param {{ head?: string, depth?: number, diameter?: number, length?: number, hole?: string, printer?: object, into?: string, axis?: string, sets?: object, at?: number[] }} [o] as counterboreModel; at: the point on the face
|
|
42
|
+
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
43
|
+
*/
|
|
44
|
+
export function counterbore(m: Fixing | string, o?: {
|
|
45
|
+
head?: string;
|
|
46
|
+
depth?: number;
|
|
47
|
+
diameter?: number;
|
|
48
|
+
length?: number;
|
|
49
|
+
hole?: string;
|
|
50
|
+
printer?: object;
|
|
51
|
+
into?: string;
|
|
52
|
+
axis?: string;
|
|
53
|
+
sets?: object;
|
|
54
|
+
at?: number[];
|
|
55
|
+
}): object;
|
|
56
|
+
/**
|
|
57
|
+
* 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
|
+
* any head sits flush.
|
|
59
|
+
* @param {Fixing | string} m
|
|
60
|
+
* @param {{ length?: number, thickness?: number, hole?: string, printer?: object, into?: string, axis?: string, sets?: object }} [o] length: the whole hole's, from the face (default the cone and no more);
|
|
61
|
+
* 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, into: string, teardrop: boolean, rests: object[], findings: object[] }}
|
|
63
|
+
* diameter: of the cone at the face, as drawn; depth: of the cone
|
|
64
|
+
*/
|
|
65
|
+
export function countersinkModel(m: Fixing | string, o?: {
|
|
66
|
+
length?: number;
|
|
67
|
+
thickness?: number;
|
|
68
|
+
hole?: string;
|
|
69
|
+
printer?: object;
|
|
70
|
+
into?: string;
|
|
71
|
+
axis?: string;
|
|
72
|
+
sets?: object;
|
|
73
|
+
}): {
|
|
74
|
+
thread: string;
|
|
75
|
+
diameter: number;
|
|
76
|
+
angle: number;
|
|
77
|
+
depth: number;
|
|
78
|
+
hole: number;
|
|
79
|
+
length: number;
|
|
80
|
+
into: string;
|
|
81
|
+
teardrop: boolean;
|
|
82
|
+
rests: object[];
|
|
83
|
+
findings: object[];
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* A countersink and its hole, to subtract, the head flush with the face at `at`. A 90° head goes through
|
|
87
|
+
* @rulecad/shapes' countersink; another angle (an inch screw's 82°) is drawn here in the same form.
|
|
88
|
+
* @param {Fixing | string} m
|
|
89
|
+
* @param {{ length?: number, hole?: string, printer?: object, into?: string, axis?: string, sets?: object, at?: number[] }} [o] as countersinkModel
|
|
90
|
+
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
91
|
+
*/
|
|
92
|
+
export function countersink(m: Fixing | string, o?: {
|
|
93
|
+
length?: number;
|
|
94
|
+
hole?: string;
|
|
95
|
+
printer?: object;
|
|
96
|
+
into?: string;
|
|
97
|
+
axis?: string;
|
|
98
|
+
sets?: object;
|
|
99
|
+
at?: number[];
|
|
100
|
+
}): object;
|
|
101
|
+
/**
|
|
102
|
+
* A pocket for a nut, let in from a face along the screw's axis, as numbers.
|
|
103
|
+
* @param {Fixing | string} m
|
|
104
|
+
* @param {{ kind?: string, depth?: number, thickness?: number, fit?: string | number, hole?: string, printer?: object, into?: string, axis?: string, sets?: object }} [o]
|
|
105
|
+
* 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: no clearance once printed, so the nut cannot turn), slip, press, or a clearance in mm
|
|
107
|
+
* @returns {{ thread: string, kind: string, flats: number, nominal: number, corner: number, depth: number, height: number, hole: number, clearance: number, roof: number, into: string, rests: object[], findings: object[] }}
|
|
108
|
+
* flats: across the flats, as drawn; nominal: the nut's; corner: across the pocket's corners; roof: the height of the 45° roof, going up from the bed
|
|
109
|
+
*/
|
|
110
|
+
export function nutPocketModel(m: Fixing | string, o?: {
|
|
111
|
+
kind?: string;
|
|
112
|
+
depth?: number;
|
|
113
|
+
thickness?: number;
|
|
114
|
+
fit?: string | number;
|
|
115
|
+
hole?: string;
|
|
116
|
+
printer?: object;
|
|
117
|
+
into?: string;
|
|
118
|
+
axis?: string;
|
|
119
|
+
sets?: object;
|
|
120
|
+
}): {
|
|
121
|
+
thread: string;
|
|
122
|
+
kind: string;
|
|
123
|
+
flats: number;
|
|
124
|
+
nominal: number;
|
|
125
|
+
corner: number;
|
|
126
|
+
depth: number;
|
|
127
|
+
height: number;
|
|
128
|
+
hole: number;
|
|
129
|
+
clearance: number;
|
|
130
|
+
roof: number;
|
|
131
|
+
into: string;
|
|
132
|
+
rests: object[];
|
|
133
|
+
findings: object[];
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* 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
|
+
* @rulecad/shapes' nutPocket. The screw's hole is a hole() of its own.
|
|
138
|
+
* @param {Fixing | string} m
|
|
139
|
+
* @param {{ kind?: string, depth?: number, fit?: string | number, hole?: string, printer?: object, into?: string, axis?: string, sets?: object, at?: number[] }} [o] as nutPocketModel
|
|
140
|
+
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
141
|
+
*/
|
|
142
|
+
export function nutPocket(m: Fixing | string, o?: {
|
|
143
|
+
kind?: string;
|
|
144
|
+
depth?: number;
|
|
145
|
+
fit?: string | number;
|
|
146
|
+
hole?: string;
|
|
147
|
+
printer?: object;
|
|
148
|
+
into?: string;
|
|
149
|
+
axis?: string;
|
|
150
|
+
sets?: object;
|
|
151
|
+
at?: number[];
|
|
152
|
+
}): object;
|
|
153
|
+
/**
|
|
154
|
+
* A slot a nut slides into from the side, across the screw's axis, as numbers.
|
|
155
|
+
* @param {Fixing | string} m
|
|
156
|
+
* @param {{ kind?: string, axis?: 'x' | 'y' | 'z', into?: string, depth: number, fit?: string | number, hole?: string, printer?: object, sets?: object }} o
|
|
157
|
+
* axis: the screw's (default z, standing up); into: the way the nut slides in, square to the axis (default +x for a
|
|
158
|
+
* 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), snug, press, or a clearance in mm
|
|
160
|
+
* @returns {{ thread: string, kind: string, width: number, gap: number, depth: number, reach: number, hole: number, axis: string, into: string, span: number, rise: number, rests: object[], findings: object[] }}
|
|
161
|
+
* width: across the nut's flats, as drawn; gap: along the screw, for the nut's height; reach: how far the slot goes
|
|
162
|
+
* in from the face; span: what its roof bridges; rise: how far the roof rises at 45° where that is wider than the printer bridges
|
|
163
|
+
*/
|
|
164
|
+
export function nutTrapModel(m: Fixing | string, o?: {
|
|
165
|
+
kind?: string;
|
|
166
|
+
axis?: "x" | "y" | "z";
|
|
167
|
+
into?: string;
|
|
168
|
+
depth: number;
|
|
169
|
+
fit?: string | number;
|
|
170
|
+
hole?: string;
|
|
171
|
+
printer?: object;
|
|
172
|
+
sets?: object;
|
|
173
|
+
}): {
|
|
174
|
+
thread: string;
|
|
175
|
+
kind: string;
|
|
176
|
+
width: number;
|
|
177
|
+
gap: number;
|
|
178
|
+
depth: number;
|
|
179
|
+
reach: number;
|
|
180
|
+
hole: number;
|
|
181
|
+
axis: string;
|
|
182
|
+
into: string;
|
|
183
|
+
span: number;
|
|
184
|
+
rise: number;
|
|
185
|
+
rests: object[];
|
|
186
|
+
findings: object[];
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* A slot a nut slides into from the side, to subtract. `at` is the point on the face in line with the nut's centre.
|
|
190
|
+
* From a side it goes through @rulecad/shapes' wallOpening (a roof that bridges, rising at 45° where it is too wide);
|
|
191
|
+
* dropped in from the top, the slot ends in the nut's own outline, so the nut sits on the screw's axis.
|
|
192
|
+
* @param {Fixing | string} m
|
|
193
|
+
* @param {{ kind?: string, axis?: 'x' | 'y' | 'z', into?: string, depth: number, fit?: string | number, hole?: string, printer?: object, sets?: object, at?: number[] }} o as nutTrapModel
|
|
194
|
+
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
195
|
+
*/
|
|
196
|
+
export function nutTrap(m: Fixing | string, o?: {
|
|
197
|
+
kind?: string;
|
|
198
|
+
axis?: "x" | "y" | "z";
|
|
199
|
+
into?: string;
|
|
200
|
+
depth: number;
|
|
201
|
+
fit?: string | number;
|
|
202
|
+
hole?: string;
|
|
203
|
+
printer?: object;
|
|
204
|
+
sets?: object;
|
|
205
|
+
at?: number[];
|
|
206
|
+
}): object;
|
|
207
|
+
/** A slot for a thin square nut, as numbers: nutTrapModel for a square nut, dropped in from the top across a screw lying along x unless told otherwise. */
|
|
208
|
+
export function squareNutSlotModel(m: any, o?: {}): {
|
|
209
|
+
thread: string;
|
|
210
|
+
kind: string;
|
|
211
|
+
width: number;
|
|
212
|
+
gap: number;
|
|
213
|
+
depth: number;
|
|
214
|
+
reach: number;
|
|
215
|
+
hole: number;
|
|
216
|
+
axis: string;
|
|
217
|
+
into: string;
|
|
218
|
+
span: number;
|
|
219
|
+
rise: number;
|
|
220
|
+
rests: object[];
|
|
221
|
+
findings: object[];
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* 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 side.
|
|
225
|
+
* @param {Fixing | string} m
|
|
226
|
+
* @param {{ axis?: 'x' | 'y' | 'z', into?: string, depth: number, fit?: string | number, printer?: object, sets?: object, at?: number[] }} o as nutTrap
|
|
227
|
+
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
228
|
+
*/
|
|
229
|
+
export function squareNutSlot(m: Fixing | string, o?: {
|
|
230
|
+
axis?: "x" | "y" | "z";
|
|
231
|
+
into?: string;
|
|
232
|
+
depth: number;
|
|
233
|
+
fit?: string | number;
|
|
234
|
+
printer?: object;
|
|
235
|
+
sets?: object;
|
|
236
|
+
at?: number[];
|
|
237
|
+
}): object;
|
|
238
|
+
/**
|
|
239
|
+
* A nut closed inside the part, put in while the print is paused, as numbers: a pocket with a flat floor at `at`, as
|
|
240
|
+
* 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
|
|
241
|
+
* walls end: the printer stops there, the nut goes in, and the next layers close the roof.
|
|
242
|
+
* @param {Fixing | string} m
|
|
243
|
+
* @param {{ kind?: string, fit?: string | number, hole?: string, thickness?: number, printer?: object, sets?: object, at?: number[] }} [o] at: the middle of the pocket's floor, its z measured from the bed; fit: slip by default;
|
|
244
|
+
* thickness: the part's height there, from the bed (a pocket whose roof would break out of the top is refused)
|
|
245
|
+
* @returns {{ thread: string, kind: string, flats: number, height: number, pause: number, layer: number, roof: number, top: number, hole: number, rests: object[], findings: object[] }}
|
|
246
|
+
* height: of the pocket's upright walls; pause: the z to pause at; layer: the number of the last layer laid before the pause; top: the z where the roof meets the hole
|
|
247
|
+
*/
|
|
248
|
+
export function captiveNutModel(m: Fixing | string, o?: {
|
|
249
|
+
kind?: string;
|
|
250
|
+
fit?: string | number;
|
|
251
|
+
hole?: string;
|
|
252
|
+
thickness?: number;
|
|
253
|
+
printer?: object;
|
|
254
|
+
sets?: object;
|
|
255
|
+
at?: number[];
|
|
256
|
+
}): {
|
|
257
|
+
thread: string;
|
|
258
|
+
kind: string;
|
|
259
|
+
flats: number;
|
|
260
|
+
height: number;
|
|
261
|
+
pause: number;
|
|
262
|
+
layer: number;
|
|
263
|
+
roof: number;
|
|
264
|
+
top: number;
|
|
265
|
+
hole: number;
|
|
266
|
+
rests: object[];
|
|
267
|
+
findings: object[];
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* A nut closed inside the part, to subtract: the pocket and its roof, from the floor at `at` upwards. The screw's hole
|
|
271
|
+
* is a hole() of its own, through the floor.
|
|
272
|
+
* @param {Fixing | string} m @param {{ kind?: string, fit?: string | number, hole?: string, printer?: object, sets?: object, at?: number[] }} [o] as captiveNutModel
|
|
273
|
+
* @returns {object} a JSCAD geom3 to subtract, with .model
|
|
274
|
+
*/
|
|
275
|
+
export function captiveNut(m: Fixing | string, o?: {
|
|
276
|
+
kind?: string;
|
|
277
|
+
fit?: string | number;
|
|
278
|
+
hole?: string;
|
|
279
|
+
printer?: object;
|
|
280
|
+
sets?: object;
|
|
281
|
+
at?: number[];
|
|
282
|
+
}): object;
|
|
283
|
+
/**
|
|
284
|
+
* A boss for a heat-set insert, as numbers: the hole the insert melts into, its depth, and the wall round it, each
|
|
285
|
+
* from the insert's rules. Refused where the wall is thinner than the insert's rule allows, or the part shorter than
|
|
286
|
+
* the insert.
|
|
287
|
+
* @param {Fixing | string} m
|
|
288
|
+
* @param {{ height?: number, outer?: number, wall?: number, through?: boolean, root?: number, printer?: object, sets?: object }} [o]
|
|
289
|
+
* height: of the boss, or the part's thickness there (default the blind hole's depth, up to a whole layer); outer:
|
|
290
|
+
* the boss's diameter, or wall: the plastic round the hole (default the insert's least wall); through: the hole runs
|
|
291
|
+
* out of the far side; root: the 45° flare where the boss meets what it stands on (default the printer's chamfer)
|
|
292
|
+
* @returns {{ thread: string, hole: number, depth: number, through: boolean, outer: number, wall: number, least: number, height: number, root: number, lead: number, below: number, insert: { diameter: number, length: number }, rests: object[], findings: object[] }}
|
|
293
|
+
* hole: as drawn; least: the wall the insert's rule asks; below: how far a blind hole runs on under the boss's foot
|
|
294
|
+
*/
|
|
295
|
+
export function insertBossModel(m: Fixing | string, o?: {
|
|
296
|
+
height?: number;
|
|
297
|
+
outer?: number;
|
|
298
|
+
wall?: number;
|
|
299
|
+
through?: boolean;
|
|
300
|
+
root?: number;
|
|
301
|
+
printer?: object;
|
|
302
|
+
sets?: object;
|
|
303
|
+
}): {
|
|
304
|
+
thread: string;
|
|
305
|
+
hole: number;
|
|
306
|
+
depth: number;
|
|
307
|
+
through: boolean;
|
|
308
|
+
outer: number;
|
|
309
|
+
wall: number;
|
|
310
|
+
least: number;
|
|
311
|
+
height: number;
|
|
312
|
+
root: number;
|
|
313
|
+
lead: number;
|
|
314
|
+
below: number;
|
|
315
|
+
insert: {
|
|
316
|
+
diameter: number;
|
|
317
|
+
length: number;
|
|
318
|
+
};
|
|
319
|
+
rests: object[];
|
|
320
|
+
findings: object[];
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* A boss for a heat-set insert: the column to add, standing up from `at` (the middle of its foot), and the hole to
|
|
324
|
+
* subtract once the boss is joined to what it stands on.
|
|
325
|
+
* @param {Fixing | string} m @param {{ height?: number, outer?: number, wall?: number, through?: boolean, root?: number, printer?: object, sets?: object, at?: number[] }} [o] as insertBossModel
|
|
326
|
+
* @returns {{ boss: object, hole: object, model: object }} boss: a JSCAD geom3 to add; hole: one to subtract
|
|
327
|
+
*/
|
|
328
|
+
export function insertBoss(m: Fixing | string, o?: {
|
|
329
|
+
height?: number;
|
|
330
|
+
outer?: number;
|
|
331
|
+
wall?: number;
|
|
332
|
+
through?: boolean;
|
|
333
|
+
root?: number;
|
|
334
|
+
printer?: object;
|
|
335
|
+
sets?: object;
|
|
336
|
+
at?: number[];
|
|
337
|
+
}): {
|
|
338
|
+
boss: object;
|
|
339
|
+
hole: object;
|
|
340
|
+
model: object;
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* 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
|
|
344
|
+
* 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)
|
|
345
|
+
* gives its finding on how it prints in the direction it was drawn for, and so does hardware with its thread drawn.
|
|
346
|
+
* @param {object} x a fixing's model, a model from holeModel, threadModel, a seat's twin or a piece of hardware's, or a solid one of them made
|
|
347
|
+
* @returns {object[]} findings
|
|
348
|
+
*/
|
|
349
|
+
export function printable(x: object): object[];
|
|
350
|
+
/**
|
|
351
|
+
* a fixing's model, as fixingModel gives it
|
|
352
|
+
*/
|
|
353
|
+
export type Fixing = import("./model.mjs").Fixing;
|