@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulecad/fixings",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
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,7 +28,7 @@
|
|
|
28
28
|
"cad"
|
|
29
29
|
],
|
|
30
30
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
31
|
+
"node": ">=22.13"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
34
|
"repository": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@jscad/modeling": "^2.12.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@rulecad/rules": "^0.
|
|
51
|
-
"@rulecad/shapes": "^0.
|
|
50
|
+
"@rulecad/rules": "^0.4.0",
|
|
51
|
+
"@rulecad/shapes": "^0.5.0"
|
|
52
52
|
}
|
|
53
53
|
}
|
package/pins.d.mts
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
* chamfer by default, so nothing overhangs past the printer's limit; a square back (back 90) holds for good but
|
|
5
5
|
* overhangs by the lip. The halves are modelled as snap hooks of the slot's length, the peg's half-thickness and
|
|
6
6
|
* four fifths of its diameter wide (a half-round's worth), with the lip as the undercut.
|
|
7
|
-
* @param {{ diameter: number, length: number, lip?: number, slot?: number, gap?: number, lead?: number, back?: number,
|
|
7
|
+
* @param {{ diameter: number, length: number, lip?: number, slot?: number, gap?: number, lead?: number, back?: number,
|
|
8
|
+
* head?: number }} p
|
|
8
9
|
* diameter: the peg's; length: the shaft below the barb; lip: the barb's overhang (default 0.4); slot: the split's
|
|
9
10
|
* length down from the tip (default 3 × diameter); gap: the split's width (default 1); lead: the tip cone's angle
|
|
10
11
|
* from the axis, degrees (default 45); back: the barb's back angle (default 45); head: a flange at the foot, its
|
|
11
12
|
* radius past the peg (default diameter / 2)
|
|
12
|
-
* @param {{ union: Function, subtract: Function }} [ops] the booleans to build it with: a design's v.ops, so a design
|
|
13
|
+
* @param {{ union: Function, subtract: Function }} [ops] the booleans to build it with: a design's v.ops, so a design
|
|
14
|
+
* on
|
|
13
15
|
* Manifold gets a pin Manifold reads as a closed solid (JSCAD's own leave seams it can't)
|
|
14
16
|
* @returns {object} a JSCAD geom3 standing on its foot at z = 0
|
|
15
17
|
*/
|
|
@@ -43,8 +45,10 @@ export function snapSocket({ diameter: d, depth, clearance, wall }: {
|
|
|
43
45
|
/**
|
|
44
46
|
* A snap pin's forces: its two halves as snap hooks (snapHalf), together.
|
|
45
47
|
* @param {{ diameter: number, lip?: number, slot?: number, gap?: number, lead?: number, back?: number }} p
|
|
46
|
-
* @param {{ E: number, friction?: number }} m E: the plastic's modulus, MPa; friction: μ between barb and hole (default
|
|
47
|
-
*
|
|
48
|
+
* @param {{ E: number, friction?: number }} m E: the plastic's modulus, MPa; friction: μ between barb and hole (default
|
|
49
|
+
* 0.3)
|
|
50
|
+
* @returns {{ stiffness: number, strain: (travel: number) => number, travel: (strain: number) => number,
|
|
51
|
+
* stress: (travel: number) => number,
|
|
48
52
|
* force: number, insertion: number, removal: number, holds: boolean, undercut: (strain: number) => number }}
|
|
49
53
|
* force: to close the halves by the lip, N; insertion and removal: along the pin, N (removal Infinity where the
|
|
50
54
|
* barb's back is square: it holds); undercut: the most the halves may close at a strain
|
|
@@ -72,8 +76,10 @@ export function snapPinModel({ diameter: d, lip, slot, gap, lead, back }: {
|
|
|
72
76
|
};
|
|
73
77
|
/**
|
|
74
78
|
* A pin's name read by the grammar.
|
|
75
|
-
* @param {string} name 'snap pin 4x6', 'snap pin 2.5x4 barb 0.3', 'dowel 3x12', 'dowel 3x12 ISO 2338', 'filament pin
|
|
76
|
-
*
|
|
79
|
+
* @param {string} name 'snap pin 4x6', 'snap pin 2.5x4 barb 0.3', 'dowel 3x12', 'dowel 3x12 ISO 2338', 'filament pin
|
|
80
|
+
* 1.75x12', 'printed pin 4x10'
|
|
81
|
+
* @returns {{ kind: 'snap' | 'dowel' | 'filament' | 'printed', diameter: number, length: number, barb: number | null,
|
|
82
|
+
* standard: string | null }}
|
|
77
83
|
*/
|
|
78
84
|
export function parsePin(name: string): {
|
|
79
85
|
kind: "snap" | "dowel" | "filament" | "printed";
|
|
@@ -83,19 +89,22 @@ export function parsePin(name: string): {
|
|
|
83
89
|
standard: string | null;
|
|
84
90
|
};
|
|
85
91
|
/**
|
|
86
|
-
* @typedef {{ kind: 'pin', type: 'snap' | 'dowel' | 'filament' | 'printed', name: string, said: string,
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
92
|
+
* @typedef {{ kind: 'pin', type: 'snap' | 'dowel' | 'filament' | 'printed', name: string, said: string,
|
|
93
|
+
* diameter: number, length: number,
|
|
94
|
+
* made: 'bought' | 'cut' | 'printed', standard: string | null, fit: 'snap' | 'press' | 'slip', material: string,
|
|
95
|
+
* pinMaterial: string, hole:
|
|
96
|
+
* { diameter: number, nominal: number, comp: number, clearance: number, into: string, axis: 'x' | 'y' | 'z',
|
|
97
|
+
* teardrop: boolean, rules: string[] }, snap: { lip: number, slot: number, gap: number, lead: number, back: number,
|
|
98
|
+
* head: number, insertion: number, removal: number, force: number, strain: number, holds: boolean } | null, grams:
|
|
99
|
+
* number, shear: number, bearing: number, pull: number | null, load: number | null, margin: number | null, governs:
|
|
100
|
+
* string | null, thickness: number | null, rests: object[], findings: object[] }} Pin diameter, length: the pin's (a
|
|
101
|
+
* snap pin's length is its shaft, foot to barb); made: bought (a dowel), cut (filament) or printed; fit: how it sits
|
|
102
|
+
* in its hole; material: the part's plastic, which the pin bears on; pinMaterial: the pin's own; hole: what to draw
|
|
103
|
+
* for it (diameter as drawn; nominal: the pin's; comp: hole compensation added; clearance: added across past that,
|
|
104
|
+
* less than 0 for a press); snap: a snap pin's figures and forces (insertion and removal along the pin, N; force: to
|
|
105
|
+
* close the halves; strain: at the halves' roots, closed by the barb); shear: what the pin carries across its shear
|
|
106
|
+
* planes, N; bearing: what the printed hole takes before it crushes, N; pull: what a snap pin holds along its axis,
|
|
107
|
+
* N; load and margin: the load given (across the pin, N) and the least of shear, bearing and pull over it
|
|
99
108
|
*/
|
|
100
109
|
/**
|
|
101
110
|
* A pin as a model by name: its hole's fit from the printer's rules, its mass, what it carries, and for a snap pin the
|
|
@@ -103,9 +112,10 @@ export function parsePin(name: string): {
|
|
|
103
112
|
* thickness it goes in stands proud; a snap pin's shaft shorter than the thickness never lets its barb out, and one
|
|
104
113
|
* more than fixings.snap_play longer rattles.
|
|
105
114
|
* @param {string | Pin} p a pin's name (see PIN_GRAMMAR) or its model
|
|
106
|
-
* @param {{ fit?: 'press' | 'slip', printer?: object, material?: string | object, pinMaterial?: string | object,
|
|
107
|
-
*
|
|
108
|
-
*
|
|
115
|
+
* @param {{ fit?: 'press' | 'slip', printer?: object, material?: string | object, pinMaterial?: string | object,
|
|
116
|
+
* load?: number, pull?: number,
|
|
117
|
+
* thickness?: number, grip?: number, planes?: number, axis?: 'x' | 'y' | 'z', into?: string, anyLength?: boolean,
|
|
118
|
+
* sets?: object, slot?: number, gap?: number, lead?: number, back?: number, head?: number, friction?: number }} [o]
|
|
109
119
|
* fit: a plain pin's, press (the default) or slip; printer: the printer's rule set or values (default the X1C);
|
|
110
120
|
* material: the part's plastic (default PLA); pinMaterial: a printed or filament pin's (default the part's);
|
|
111
121
|
* load: across the pin, N, which its shear and the hole's bearing are held to with fixings.load_margin; pull: along a
|
|
@@ -139,21 +149,24 @@ export function pinModel(p: string | Pin, o?: {
|
|
|
139
149
|
/**
|
|
140
150
|
* The hole for a pin, to subtract: round standing up, a teardrop lying on its side, the diameter pinModel gives it.
|
|
141
151
|
* @param {string | Pin} p @param {object} [o] as pinModel, and at: the point on the face where the hole starts; depth:
|
|
142
|
-
* how deep (default the thickness, else the pin's length); through: out of the far face (default true where depth is
|
|
152
|
+
* how deep (default the thickness, else the pin's length); through: out of the far face (default true where depth is
|
|
153
|
+
* the thickness)
|
|
143
154
|
* @returns {object} a JSCAD geom3 with .model holding pinModel's numbers
|
|
144
155
|
*/
|
|
145
156
|
export function pinHole(p: string | Pin, o?: object): object;
|
|
146
157
|
/**
|
|
147
158
|
* A pin's solid, standing on the bed at z = 0: a snap pin as snapPin draws it from its model's figures, a plain pin a
|
|
148
159
|
* cylinder with its ends eased (a dowel's are rounded, a printed pin's chamfered against the first layer's spread).
|
|
149
|
-
* @param {string | Pin} p @param {object} [o] as pinModel @param {{ union: Function, subtract: Function }} [ops] for a
|
|
160
|
+
* @param {string | Pin} p @param {object} [o] as pinModel @param {{ union: Function, subtract: Function }} [ops] for a
|
|
161
|
+
* snap pin
|
|
150
162
|
* @returns {object} a JSCAD geom3 with .model
|
|
151
163
|
*/
|
|
152
164
|
export function pin(p: string | Pin, o?: object, ops?: {
|
|
153
165
|
union: Function;
|
|
154
166
|
subtract: Function;
|
|
155
167
|
}): object;
|
|
156
|
-
/** The kinds of pin there are: a printed snap pin, a bought steel dowel, a cut length of filament, a printed plain
|
|
168
|
+
/** The kinds of pin there are: a printed snap pin, a bought steel dowel, a cut length of filament, a printed plain
|
|
169
|
+
* pin. */
|
|
157
170
|
export const PIN_KINDS: string[];
|
|
158
171
|
/** The fits a plain pin takes in its hole: press (it grips) and slip (it turns, a hinge pin). */
|
|
159
172
|
export const PIN_FITS: string[];
|
|
@@ -164,13 +177,14 @@ export const PIN_FITS: string[];
|
|
|
164
177
|
export const PIN_GRAMMAR: string;
|
|
165
178
|
export function isPinName(name: unknown): boolean;
|
|
166
179
|
/**
|
|
167
|
-
* diameter, length: the pin's (a
|
|
168
|
-
*
|
|
169
|
-
* hole:
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
180
|
+
* diameter, length: the pin's (a
|
|
181
|
+
* snap pin's length is its shaft, foot to barb); made: bought (a dowel), cut (filament) or printed; fit: how it sits
|
|
182
|
+
* in its hole; material: the part's plastic, which the pin bears on; pinMaterial: the pin's own; hole: what to draw
|
|
183
|
+
* for it (diameter as drawn; nominal: the pin's; comp: hole compensation added; clearance: added across past that,
|
|
184
|
+
* less than 0 for a press); snap: a snap pin's figures and forces (insertion and removal along the pin, N; force: to
|
|
185
|
+
* close the halves; strain: at the halves' roots, closed by the barb); shear: what the pin carries across its shear
|
|
186
|
+
* planes, N; bearing: what the printed hole takes before it crushes, N; pull: what a snap pin holds along its axis,
|
|
187
|
+
* N; load and margin: the load given (across the pin, N) and the least of shear, bearing and pull over it
|
|
174
188
|
*/
|
|
175
189
|
export type Pin = {
|
|
176
190
|
kind: "pin";
|