@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/snaps.d.mts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* built on): the tube's wall in ξ = βx, with β⁴ = 3 (1 − ν²) / (R² t²), bends as w'''' + 4 w = 0, and a ring load q
|
|
4
4
|
* per mm round it puts a step of q / (D β³) in w''' (D = E t³ / (12 (1 − ν²))). The load is a from one end and b from
|
|
5
5
|
* the other (each in 1/β), and each end is 'free' (no moment, no shear), 'closed' (held by an end wall: no deflection,
|
|
6
|
-
* no slope, the stiffest an end can be) or 'long' (far enough off not to count). Gives the deflection under the load
|
|
7
|
-
* the curvature w'' at each end, both per q / (D β³). The free-standing checks: a long tube both ways gives w =
|
|
8
|
-
* a free end at the load gives 1/2 (Hetényi, Beams on Elastic Foundation, 1946: w = Pβ / 2k and 2Pβ / k).
|
|
6
|
+
* no slope, the stiffest an end can be) or 'long' (far enough off not to count). Gives the deflection under the load
|
|
7
|
+
* and the curvature w'' at each end, both per q / (D β³). The free-standing checks: a long tube both ways gives w =
|
|
8
|
+
* 1/8, a free end at the load gives 1/2 (Hetényi, Beams on Elastic Foundation, 1946: w = Pβ / 2k and 2Pβ / k).
|
|
9
9
|
* @param {number} a the load's distance from end A, in 1/β @param {number} b from end B
|
|
10
10
|
* @param {{ A?: 'free' | 'closed' | 'long', B?: 'free' | 'closed' | 'long' }} [ends] (default both long)
|
|
11
11
|
* @returns {{ w: number, bendA: number, bendB: number }}
|
|
@@ -29,9 +29,10 @@ export function tubeRing(a: number, b: number, ends?: {
|
|
|
29
29
|
* @param {{ count: number, width: number, reach: number, inside: number, outside: number }} f the finger count, slot
|
|
30
30
|
* width, reach (from the root to where the finger is pushed, its arm L) and the skirt's radii, mm
|
|
31
31
|
* @param {number} E the plastic's modulus, MPa
|
|
32
|
-
* @returns {{ angle: number, width: number, area: number, inertia: number, fibre: number, stiffness: number,
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* @returns {{ angle: number, width: number, area: number, inertia: number, fibre: number, stiffness: number,
|
|
33
|
+
* strainPerY: number }}
|
|
34
|
+
* angle: the finger's whole angle, degrees; width: its arc at the mean radius; inertia, mm⁴; fibre: c; stiffness: N
|
|
35
|
+
* per mm of radial push at reach; strainPerY: the root strain per mm of that push
|
|
35
36
|
*/
|
|
36
37
|
export function skirtFinger({ count: n, width: w, reach: L, inside: ri, outside: ro }: {
|
|
37
38
|
count: number;
|
|
@@ -59,12 +60,14 @@ export function skirtFinger({ count: n, width: w, reach: L, inside: ri, outside:
|
|
|
59
60
|
* tube, angles outside 0° to 90°, a lead friction locks, a groove deeper than the skirt. A closed end near the joint
|
|
60
61
|
* (the box's floor, the lid's top) is a beam on an elastic foundation held round there (Hetényi): the part is stiffer,
|
|
61
62
|
* so its mate takes more of the interference, and the bending at that end's root is held to the same limit.
|
|
62
|
-
* @param {{ diameter: number, wall: number, skirt: number, bead?: number, lead?: number, back?: number, land?: number,
|
|
63
|
+
* @param {{ diameter: number, wall: number, skirt: number, bead?: number, lead?: number, back?: number, land?: number,
|
|
64
|
+
* boxEnd?: number, lidEnd?: number, boxFloor?: number, lidTop?: number, slots?: { count: number, reach: number,
|
|
65
|
+
* width?: number } }} p
|
|
63
66
|
* diameter: the box's wall outside, at the joint, mm; wall: the box's wall thickness there; skirt: the lid's skirt
|
|
64
67
|
* thickness; bead: how far the bead stands off the wall (default sized); lead: the face the lid pushes over, its
|
|
65
68
|
* angle from the axis (default 30); back: the return face's (default 45: the steepest the box prints without support,
|
|
66
|
-
* as it is the underside of the bead); land: the bead's flat top, along the axis (default two layers); boxEnd: from
|
|
67
|
-
* bead to the box's rim, its free end; lidEnd: from the groove to the skirt's mouth (each default 0, at the end);
|
|
69
|
+
* as it is the underside of the bead); land: the bead's flat top, along the axis (default two layers); boxEnd: from
|
|
70
|
+
* the bead to the box's rim, its free end; lidEnd: from the groove to the skirt's mouth (each default 0, at the end);
|
|
68
71
|
* boxFloor: from the bead to the box's floor, its closed end; lidTop: from the groove to the underside of the lid's
|
|
69
72
|
* top (each default none: far enough off not to count; each at least its part's wall, the box's wall or the skirt);
|
|
70
73
|
* slots: the skirt slotted into fingers, count of them (3 or more), each reach mm from the slots' closed end to the
|
|
@@ -73,7 +76,8 @@ export function skirtFinger({ count: n, width: w, reach: L, inside: ri, outside:
|
|
|
73
76
|
* round at the groove. The bead bears on each finger at the groove's bottom edge, both going on (the lip below the
|
|
74
77
|
* groove rides over the bead's crest) and coming off (the groove's lower face rides up the return face), so the
|
|
75
78
|
* finger's arm is reach + the bead's length + twice the clearance (slots.arm in the model)
|
|
76
|
-
* @param {{ material?: string | object, lidMaterial?: string | object, printer?: object, sets?: object,
|
|
79
|
+
* @param {{ material?: string | object, lidMaterial?: string | object, printer?: object, sets?: object,
|
|
80
|
+
* uses?: 'often' | 'once', friction?: number, pull?: number, push?: number }} [o]
|
|
77
81
|
* material: the box's plastic (default PLA); lidMaterial: the lid's (default the box's); printer: the printer's rule
|
|
78
82
|
* set or values (default the X1C: its fit is the clearance, its overhang the steepest return face); uses: often (the
|
|
79
83
|
* default, a lid) or once; friction: μ between the parts (default fixings.snap_friction); pull: the force along the
|
|
@@ -112,7 +116,8 @@ export function annularSnapModel(p: {
|
|
|
112
116
|
* The bead to add to the box: a ring round the wall's outside, its foot (the bottom of the return face) at z = at.
|
|
113
117
|
* Union it with a box whose wall's outside is the model's diameter about the z axis.
|
|
114
118
|
* @param {object | AnnularSnap} p the joint's figures, as annularSnapModel takes them, or its model
|
|
115
|
-
* @param {object} [o] as annularSnapModel, and at: the bead's foot, mm up z (default 0); segments: faces round (default
|
|
119
|
+
* @param {object} [o] as annularSnapModel, and at: the bead's foot, mm up z (default 0); segments: faces round (default
|
|
120
|
+
* 96)
|
|
116
121
|
* @returns {object} a JSCAD geom3 with .model
|
|
117
122
|
*/
|
|
118
123
|
export function annularBead(p: object | AnnularSnap, o?: object): object;
|
|
@@ -132,7 +137,8 @@ export function annularGroove(p: object | AnnularSnap, o?: object): object;
|
|
|
132
137
|
* model's reach above the groove's top edge, and ends in a full round half the slot wide, so the root that takes each
|
|
133
138
|
* finger's bending has no square corner. The first slot is centred on +x.
|
|
134
139
|
* @param {AnnularSnap} m a model from annularSnapModel with slots
|
|
135
|
-
* @param {{ at?: number, mouth: number, segments?: number }} o at: the bead's foot (default 0); mouth: the z of the
|
|
140
|
+
* @param {{ at?: number, mouth: number, segments?: number }} o at: the bead's foot (default 0); mouth: the z of the
|
|
141
|
+
* skirt's
|
|
136
142
|
* open end; segments: faces round the slot's end (default 24)
|
|
137
143
|
* @returns {object} a JSCAD geom3 to subtract, the slots together, with .model
|
|
138
144
|
*/
|
|
@@ -141,16 +147,18 @@ export function snapSlots(m: AnnularSnap, o?: {
|
|
|
141
147
|
mouth: number;
|
|
142
148
|
segments?: number;
|
|
143
149
|
}): object;
|
|
144
|
-
/** The uses an annular snap is sized for: opened often (a lid, the guide's 60% of the brief-snap strain) or snapped
|
|
150
|
+
/** The uses an annular snap is sized for: opened often (a lid, the guide's 60% of the brief-snap strain) or snapped
|
|
151
|
+
* once. */
|
|
145
152
|
export const SNAP_USES: string[];
|
|
146
153
|
export function hubFactor(k: number, nu: number): number;
|
|
147
154
|
export function shaftFactor(k: number, nu: number): number;
|
|
148
155
|
/**
|
|
149
|
-
* one part of the joint: its diameters at the joint, wall, how far
|
|
150
|
-
* "remote" distance, the stiffening that gives (remote), and with a
|
|
151
|
-
*
|
|
152
|
-
* (
|
|
153
|
-
* bends, and the bending strain at the
|
|
156
|
+
* one part of the joint: its diameters at the joint, wall, how far
|
|
157
|
+
* the joint is from its free end and the guide's "remote" distance, the stiffening that gives (remote), and with a
|
|
158
|
+
* closed end's too (factor), the geometric factor, its stiffness (N per mm of diameter), how much of the interference
|
|
159
|
+
* it takes (on the diameter) and the hoop strain that leaves in it; with a closed end (closed, its distance from the
|
|
160
|
+
* joint), how much stiffer that end makes it, the length 1/β over which its wall bends, and the bending strain at the
|
|
161
|
+
* end's root
|
|
154
162
|
*/
|
|
155
163
|
export type SnapPart = {
|
|
156
164
|
diameter: number;
|
|
@@ -171,12 +179,12 @@ export type SnapPart = {
|
|
|
171
179
|
root?: number;
|
|
172
180
|
};
|
|
173
181
|
/**
|
|
174
|
-
* diameter: the box's wall outside at the joint; bead: how far the bead stands off
|
|
175
|
-
* height along the axis, return face, land and lead face; undercut: the
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
182
|
+
* diameter: the box's wall outside at the joint; bead: how far the bead stands off
|
|
183
|
+
* it (radial); length: the bead's height along the axis, return face, land and lead face; undercut: the
|
|
184
|
+
* bead less the clearance, the radial overlap the skirt is spread by; interference: the same on the diameter, shared
|
|
185
|
+
* between the parts; force: the transverse force P that takes; insertion and removal: along the push, N;
|
|
186
|
+
* permissible: the hoop strain each part may see; most: the largest undercut that strain allows and the removal
|
|
187
|
+
* force it would give; groove: the groove's radii and depth in the skirt
|
|
180
188
|
*/
|
|
181
189
|
export type AnnularSnap = {
|
|
182
190
|
kind: "annular snap";
|