@rulecad/frames 0.0.1 → 0.1.8
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 +23 -0
- package/README.md +1182 -21
- package/beam.d.mts +145 -0
- package/beam.mjs +201 -0
- package/bought.d.mts +60 -0
- package/bought.mjs +195 -0
- package/catalogue.d.mts +20 -0
- package/catalogue.mjs +268 -0
- package/cutlist.d.mts +88 -0
- package/cutlist.mjs +199 -0
- package/cutsheet.d.mts +23 -0
- package/cutsheet.mjs +118 -0
- package/door.d.mts +127 -0
- package/door.mjs +254 -0
- package/ends.d.mts +130 -0
- package/ends.mjs +290 -0
- package/fitting.d.mts +262 -0
- package/fitting.mjs +535 -0
- package/frames.d.mts +18 -9
- package/frames.mjs +43 -10
- package/guide.d.mts +140 -0
- package/guide.mjs +269 -0
- package/jig.d.mts +146 -0
- package/jig.mjs +332 -0
- package/join.d.mts +244 -0
- package/join.mjs +257 -0
- package/ops.d.mts +44 -0
- package/ops.mjs +324 -0
- package/package.json +75 -8
- package/panel.d.mts +225 -0
- package/panel.mjs +374 -0
- package/profile.d.mts +268 -0
- package/profile.mjs +462 -0
- package/rods.d.mts +195 -0
- package/rods.mjs +475 -0
- package/section.d.mts +43 -0
- package/section.mjs +140 -0
- package/services.d.mts +335 -0
- package/services.mjs +486 -0
- package/slotnut.d.mts +210 -0
- package/slotnut.mjs +394 -0
- package/square.d.mts +23 -0
- package/square.mjs +42 -0
- package/wheels.d.mts +141 -0
- package/wheels.mjs +337 -0
package/section.mjs
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// What a section is worth as a beam, from its outline alone: area, centroid and second moments by the polygon
|
|
2
|
+
// formulas, and the torsion constant by solving Prandtl's stress function over a raster of the section. Loops are
|
|
3
|
+
// closed outlines as [x, y] points in mm: the outside counter-clockwise, each hole clockwise (signedArea says which).
|
|
4
|
+
|
|
5
|
+
/** Twice-signed area's half: positive for a counter-clockwise loop. @param {number[][]} loop @returns {number} */
|
|
6
|
+
export function signedArea(loop) {
|
|
7
|
+
let a = 0;
|
|
8
|
+
for (let i = 0, n = loop.length; i < n; i++) { const [x0, y0] = loop[i], [x1, y1] = loop[(i + 1) % n]; a += x0 * y1 - x1 * y0; }
|
|
9
|
+
return a / 2;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Area, centroid and second moments of area of a section, by the polygon (Green's theorem) formulas, summed over its
|
|
14
|
+
* loops so that a clockwise hole takes away. The second moments are about axes through the centroid, parallel to x and y.
|
|
15
|
+
* @param {number[][][]} loops
|
|
16
|
+
* @returns {{ area: number, centroid: [number, number], inertiaX: number, inertiaY: number, inertiaXY: number }} mm², mm, mm⁴
|
|
17
|
+
*/
|
|
18
|
+
export function polygonSection(loops) {
|
|
19
|
+
let a = 0, sx = 0, sy = 0, ixx = 0, iyy = 0, ixy = 0;
|
|
20
|
+
for (const loop of loops) for (let i = 0, n = loop.length; i < n; i++) {
|
|
21
|
+
const [x0, y0] = loop[i], [x1, y1] = loop[(i + 1) % n], c = x0 * y1 - x1 * y0;
|
|
22
|
+
a += c; sx += (x0 + x1) * c; sy += (y0 + y1) * c;
|
|
23
|
+
ixx += (y0 * y0 + y0 * y1 + y1 * y1) * c; iyy += (x0 * x0 + x0 * x1 + x1 * x1) * c;
|
|
24
|
+
ixy += (x0 * y1 + 2 * x0 * y0 + 2 * x1 * y1 + x1 * y0) * c;
|
|
25
|
+
}
|
|
26
|
+
const area = a / 2;
|
|
27
|
+
if (!(area > 0)) throw new Error(`polygonSection: the loops enclose no area (${area}): the outside runs counter-clockwise and holes clockwise`);
|
|
28
|
+
const cx = sx / (6 * area), cy = sy / (6 * area);
|
|
29
|
+
return { area, centroid: [cx, cy], inertiaX: ixx / 12 - area * cy * cy, inertiaY: iyy / 12 - area * cx * cx, inertiaXY: ixy / 24 - area * cx * cy };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// The cells of a raster whose centres lie inside a loop, row by row (even-odd along each row)
|
|
33
|
+
function fill(loop, x0, y0, h, nx, ny, mark) {
|
|
34
|
+
for (let j = 0; j < ny; j++) {
|
|
35
|
+
const y = y0 + (j + 0.5) * h, xs = [];
|
|
36
|
+
for (let i = 0, n = loop.length; i < n; i++) {
|
|
37
|
+
const [ax, ay] = loop[i], [bx, by] = loop[(i + 1) % n];
|
|
38
|
+
if ((ay <= y && by > y) || (by <= y && ay > y)) xs.push(ax + ((y - ay) * (bx - ax)) / (by - ay));
|
|
39
|
+
}
|
|
40
|
+
xs.sort((p, q) => p - q);
|
|
41
|
+
for (let k = 0; k + 1 < xs.length; k += 2) {
|
|
42
|
+
const from = Math.max(0, Math.ceil((xs[k] - x0) / h - 0.5)), to = Math.min(nx - 1, Math.floor((xs[k + 1] - x0) / h - 0.5));
|
|
43
|
+
for (let i = from; i <= to; i++) mark(j * nx + i);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The torsion constant of a section (St Venant's J, written It on a maker's sheet): torque = G J × twist per length.
|
|
50
|
+
* Prandtl's stress function φ is solved on a raster of square cells: ∇²φ = −2 in the material, φ = 0 on the outside,
|
|
51
|
+
* and φ one unknown constant over each hole, fixed by the hole's own balance (the flow of φ into a hole is twice its
|
|
52
|
+
* area). Then J = 2 ∫φ dA over material and holes. That is why a closed tube is stiff and a slotted one is not: an
|
|
53
|
+
* open slot is outside (φ = 0 along it), a closed hole carries φ across itself.
|
|
54
|
+
* @param {number[][][]} loops the outside counter-clockwise, holes clockwise
|
|
55
|
+
* @param {{ cells?: number, tolerance?: number }} [o] cells: about how many raster cells cover the section's bounding
|
|
56
|
+
* box (40 000: a 20 mm section in 0.1 mm cells); tolerance: where the solver stops, as a share of the load
|
|
57
|
+
* @returns {{ torsion: number, cell: number, cells: number, iterations: number }} mm⁴, the cell's side in mm
|
|
58
|
+
*/
|
|
59
|
+
export function torsionConstant(loops, o = {}) {
|
|
60
|
+
const { cells = 40000, tolerance = 1e-7 } = o;
|
|
61
|
+
if (!(Number.isFinite(cells) && cells >= 100)) throw new Error(`torsionConstant: cells is a number of at least 100 (got ${JSON.stringify(cells)})`);
|
|
62
|
+
let xa = Infinity, xb = -Infinity, ya = Infinity, yb = -Infinity;
|
|
63
|
+
for (const loop of loops) for (const [x, y] of loop) { xa = Math.min(xa, x); xb = Math.max(xb, x); ya = Math.min(ya, y); yb = Math.max(yb, y); }
|
|
64
|
+
if (!(xb > xa && yb > ya)) throw new Error('torsionConstant: the loops have no extent');
|
|
65
|
+
const h = Math.sqrt(((xb - xa) * (yb - ya)) / cells), nx = Math.ceil((xb - xa) / h), ny = Math.ceil((yb - ya) / h);
|
|
66
|
+
const x0 = (xa + xb) / 2 - (nx * h) / 2, y0 = (ya + yb) / 2 - (ny * h) / 2;
|
|
67
|
+
// what each cell is: 0 outside, 1 material, -(k + 1) hole k. Outer loops first, then holes, then islands inside holes
|
|
68
|
+
const what = new Int32Array(nx * ny), order = loops.map((loop, k) => ({ loop, k, a: signedArea(loop) })).sort((p, q) => Math.abs(q.a) - Math.abs(p.a));
|
|
69
|
+
let holes = 0;
|
|
70
|
+
for (const { loop, a } of order) { const tag = a > 0 ? 1 : -(++holes); fill(loop, x0, y0, h, nx, ny, (c) => { what[c] = tag; }); }
|
|
71
|
+
// one unknown per material cell, one per hole
|
|
72
|
+
const dof = new Int32Array(nx * ny).fill(-1); let n = 0;
|
|
73
|
+
for (let c = 0; c < what.length; c++) if (what[c] === 1) dof[c] = n++;
|
|
74
|
+
const material = n, holeCells = new Float64Array(holes);
|
|
75
|
+
for (let c = 0; c < what.length; c++) if (what[c] < 0) { dof[c] = material + (-what[c] - 1); holeCells[-what[c] - 1] += 1; }
|
|
76
|
+
n = material + holes;
|
|
77
|
+
if (!material) throw new Error('torsionConstant: no raster cell lies in the section: use more cells');
|
|
78
|
+
// The five-point Laplacian with the wall half a cell from a cell's centre (so a wall weighs 2). Each link is listed once
|
|
79
|
+
const la = [], lb = [], lw = [], diag = new Float64Array(n), b = new Float64Array(n);
|
|
80
|
+
const link = (i, j, w) => { la.push(i); lb.push(j); lw.push(w); diag[i] += w; if (j >= 0) diag[j] += w; };
|
|
81
|
+
for (let j = 0; j < ny; j++) for (let i = 0; i < nx; i++) {
|
|
82
|
+
const c = j * nx + i, t = what[c];
|
|
83
|
+
if (t !== 1) continue;
|
|
84
|
+
b[dof[c]] = 2 * h * h;
|
|
85
|
+
for (const [di, dj] of [[1, 0], [0, 1], [-1, 0], [0, -1]]) {
|
|
86
|
+
const ii = i + di, jj = j + dj, inside = ii >= 0 && ii < nx && jj >= 0 && jj < ny, tn = inside ? what[jj * nx + ii] : 0;
|
|
87
|
+
if (tn === 1) { if (di + dj > 0) link(dof[c], dof[jj * nx + ii], 1); } // (material to material: once, from the lower cell)
|
|
88
|
+
else if (tn === 0) link(dof[c], -1, 2);
|
|
89
|
+
else link(dof[c], dof[jj * nx + ii], 2);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
for (let k = 0; k < holes; k++) { b[material + k] = 2 * h * h * holeCells[k]; if (!diag[material + k]) { diag[material + k] = 1; b[material + k] = 0; } } // (a hole no material touches carries nothing)
|
|
93
|
+
const A = Int32Array.from(la), B = Int32Array.from(lb), Wt = Float64Array.from(lw), links = A.length;
|
|
94
|
+
const apply = (x, y) => { y.fill(0); for (let e = 0; e < links; e++) { const i = A[e], j = B[e], w = Wt[e]; if (j < 0) y[i] += w * x[i]; else { const d = w * (x[i] - x[j]); y[i] += d; y[j] -= d; } } };
|
|
95
|
+
// conjugate gradients, each unknown scaled by its own diagonal
|
|
96
|
+
const x = new Float64Array(n), r = Float64Array.from(b), z = new Float64Array(n), p = new Float64Array(n), q = new Float64Array(n);
|
|
97
|
+
let rz = 0, bb = 0;
|
|
98
|
+
for (let i = 0; i < n; i++) { z[i] = r[i] / diag[i]; p[i] = z[i]; rz += r[i] * z[i]; bb += b[i] * b[i]; }
|
|
99
|
+
let it = 0;
|
|
100
|
+
for (const most = 20 * Math.max(nx, ny) + 200; it < most; it++) {
|
|
101
|
+
apply(p, q);
|
|
102
|
+
let pq = 0; for (let i = 0; i < n; i++) pq += p[i] * q[i];
|
|
103
|
+
const alpha = rz / pq; let rr = 0;
|
|
104
|
+
for (let i = 0; i < n; i++) { x[i] += alpha * p[i]; r[i] -= alpha * q[i]; rr += r[i] * r[i]; }
|
|
105
|
+
if (rr <= tolerance * tolerance * bb) { it++; break; }
|
|
106
|
+
let next = 0; for (let i = 0; i < n; i++) { z[i] = r[i] / diag[i]; next += r[i] * z[i]; }
|
|
107
|
+
const beta = next / rz; rz = next;
|
|
108
|
+
for (let i = 0; i < n; i++) p[i] = z[i] + beta * p[i];
|
|
109
|
+
}
|
|
110
|
+
let sum = 0;
|
|
111
|
+
for (let i = 0; i < material; i++) sum += x[i];
|
|
112
|
+
for (let k = 0; k < holes; k++) sum += x[material + k] * holeCells[k];
|
|
113
|
+
return { torsion: 2 * sum * h * h, cell: h, cells: nx * ny, iterations: it };
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ---------- outlines against each other: what a check of a section asks ----------
|
|
117
|
+
const cross = (ax, ay, bx, by) => ax * by - ay * bx;
|
|
118
|
+
/** Whether a point is inside a loop (even-odd). @param {number[]} p @param {number[][]} loop @returns {boolean} */
|
|
119
|
+
export function inside([x, y], loop) {
|
|
120
|
+
let inn = false;
|
|
121
|
+
for (let i = 0, n = loop.length; i < n; i++) { const [ax, ay] = loop[i], [bx, by] = loop[(i + 1) % n]; if ((ay > y) !== (by > y) && x < ax + ((y - ay) * (bx - ax)) / (by - ay)) inn = !inn; }
|
|
122
|
+
return inn;
|
|
123
|
+
}
|
|
124
|
+
function segmentDistance(a, b, c, d) { // the least distance between segments ab and cd (0 where they cross)
|
|
125
|
+
const d1 = cross(b[0] - a[0], b[1] - a[1], c[0] - a[0], c[1] - a[1]), d2 = cross(b[0] - a[0], b[1] - a[1], d[0] - a[0], d[1] - a[1]);
|
|
126
|
+
const d3 = cross(d[0] - c[0], d[1] - c[1], a[0] - c[0], a[1] - c[1]), d4 = cross(d[0] - c[0], d[1] - c[1], b[0] - c[0], b[1] - c[1]);
|
|
127
|
+
if (d1 * d2 < 0 && d3 * d4 < 0) return 0;
|
|
128
|
+
const to = (p, s, e) => { const vx = e[0] - s[0], vy = e[1] - s[1], L = vx * vx + vy * vy, t = L ? Math.max(0, Math.min(1, ((p[0] - s[0]) * vx + (p[1] - s[1]) * vy) / L)) : 0; return Math.hypot(p[0] - s[0] - t * vx, p[1] - s[1] - t * vy); };
|
|
129
|
+
return Math.min(to(a, c, d), to(b, c, d), to(c, a, b), to(d, a, b));
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The gap between two closed outlines: the least distance between them, or a negative number when they overlap (one
|
|
133
|
+
* crossing or inside the other), whose size is not a depth.
|
|
134
|
+
* @param {number[][]} p @param {number[][]} q @returns {number}
|
|
135
|
+
*/
|
|
136
|
+
export function gap(p, q) {
|
|
137
|
+
let least = Infinity;
|
|
138
|
+
for (let i = 0; i < p.length; i++) for (let j = 0; j < q.length; j++) least = Math.min(least, segmentDistance(p[i], p[(i + 1) % p.length], q[j], q[(j + 1) % q.length]));
|
|
139
|
+
return least === 0 || inside(p[0], q) || inside(q[0], p) ? -1 : least;
|
|
140
|
+
}
|
package/services.d.mts
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A printed plate that holds a bought device on a beam's slotted face, its holes read from the device's rule set
|
|
3
|
+
* (mount_holes, x then y for each, with mount_hole_thread and mount_hole_reach for tapped holes, as a supply's; mount_hole_diameter and
|
|
4
|
+
* board_thickness for plain ones, as a board's). A supply is screwed up from under the plate into its own thread, no
|
|
5
|
+
* further than its maker allows; a board is screwed down through its holes into pilots in bosses that stand it off.
|
|
6
|
+
* The plate is screwed into slot nuts past the device's body. Sized from a named load at the farthest hole by beam
|
|
7
|
+
* formulas to about twice the margin, then made thick enough for a sold screw into the slot nut.
|
|
8
|
+
* @param {string | object} profile
|
|
9
|
+
* @param {{ device: object, variant?: string, turn?: 0 | 90 | 180 | 270, offset?: number, standoff?: number, screw?: string, deviceHead?: 'cap' | 'button', load?: number, face?: string, thread?: string, head?: 'cap' | 'button', nut?: string, printer?: object, material?: string | object, given?: object }} o
|
|
10
|
+
* device: its rule set; turn: the device's x from the slot's line, in degrees; offset: its middle across the slot (y), mm; screw: a board's screws, where not the largest its holes pass
|
|
11
|
+
* @returns {object} its model: anchors.device (where the device's own frame goes), screws (into the slot), deviceScrews, findings
|
|
12
|
+
*/
|
|
13
|
+
export function deviceMountModel(profile: string | object, o?: {
|
|
14
|
+
device: object;
|
|
15
|
+
variant?: string;
|
|
16
|
+
turn?: 0 | 90 | 180 | 270;
|
|
17
|
+
offset?: number;
|
|
18
|
+
standoff?: number;
|
|
19
|
+
screw?: string;
|
|
20
|
+
deviceHead?: "cap" | "button";
|
|
21
|
+
load?: number;
|
|
22
|
+
face?: string;
|
|
23
|
+
thread?: string;
|
|
24
|
+
head?: "cap" | "button";
|
|
25
|
+
nut?: string;
|
|
26
|
+
printer?: object;
|
|
27
|
+
material?: string | object;
|
|
28
|
+
given?: object;
|
|
29
|
+
}): object;
|
|
30
|
+
/** A device mount's solid: fitted (pose 'fit'), or laid to print. @param {object} m @param {{ pose?: 'print' | 'fit', printer?: object, ops?: object }} [o] @returns {object} */
|
|
31
|
+
export function deviceMount(m: object, o?: {
|
|
32
|
+
pose?: "print" | "fit";
|
|
33
|
+
printer?: object;
|
|
34
|
+
ops?: object;
|
|
35
|
+
}): object;
|
|
36
|
+
/**
|
|
37
|
+
* A printed plate that holds a fan beside a beam, blowing out of its face: the fan's four holes by its size (FANS),
|
|
38
|
+
* screws through the fan's corners into pilots in the plate, a round opening for the air, screwed into the slot.
|
|
39
|
+
* @param {string | object} profile @param {{ size: 40 | 60 | 80 | 92 | 120, depth?: number, side?: 1 | -1, load?: number, face?: string, thread?: string, head?: 'cap' | 'button', nut?: string, printer?: object, material?: string | object, given?: object }} o
|
|
40
|
+
* depth: the fan's frame depth (default the usual, FANS); side: which side of the slot it stands (+y or -y)
|
|
41
|
+
* @returns {object} its model
|
|
42
|
+
*/
|
|
43
|
+
export function fanMountModel(profile: string | object, o?: {
|
|
44
|
+
size: 40 | 60 | 80 | 92 | 120;
|
|
45
|
+
depth?: number;
|
|
46
|
+
side?: 1 | -1;
|
|
47
|
+
load?: number;
|
|
48
|
+
face?: string;
|
|
49
|
+
thread?: string;
|
|
50
|
+
head?: "cap" | "button";
|
|
51
|
+
nut?: string;
|
|
52
|
+
printer?: object;
|
|
53
|
+
material?: string | object;
|
|
54
|
+
given?: object;
|
|
55
|
+
}): object;
|
|
56
|
+
/** A fan mount's solid. @param {object} m @param {{ pose?: 'print' | 'fit', printer?: object, ops?: object }} [o] @returns {object} */
|
|
57
|
+
export function fanMount(m: object, o?: {
|
|
58
|
+
pose?: "print" | "fit";
|
|
59
|
+
printer?: object;
|
|
60
|
+
ops?: object;
|
|
61
|
+
}): object;
|
|
62
|
+
/**
|
|
63
|
+
* A printed plate for a drag chain's end bracket on a beam's slot: the bracket's holes from its maker's drawing, its
|
|
64
|
+
* screws through the bracket into pilots in the plate, the plate screwed into the slot past it.
|
|
65
|
+
* @param {string | object} profile @param {{ holes: number[][], screw: string, flange?: number, load?: number, face?: string, thread?: string, nut?: string, head?: 'cap' | 'button', printer?: object, material?: string | object, given?: object }} o
|
|
66
|
+
* holes: [[x, y], ...] the end bracket's holes from its middle, x along the slot; screw: their thread; flange: the bracket's thickness at its holes; thread: the screws into the slot's
|
|
67
|
+
* @returns {object} its model
|
|
68
|
+
*/
|
|
69
|
+
export function dragChainEndModel(profile: string | object, o?: {
|
|
70
|
+
holes: number[][];
|
|
71
|
+
screw: string;
|
|
72
|
+
flange?: number;
|
|
73
|
+
load?: number;
|
|
74
|
+
face?: string;
|
|
75
|
+
thread?: string;
|
|
76
|
+
nut?: string;
|
|
77
|
+
head?: "cap" | "button";
|
|
78
|
+
printer?: object;
|
|
79
|
+
material?: string | object;
|
|
80
|
+
given?: object;
|
|
81
|
+
}): object;
|
|
82
|
+
/** A drag chain end plate's solid. @param {object} m @param {{ pose?: 'print' | 'fit', printer?: object, ops?: object }} [o] @returns {object} */
|
|
83
|
+
export function dragChainEnd(m: object, o?: {
|
|
84
|
+
pose?: "print" | "fit";
|
|
85
|
+
printer?: object;
|
|
86
|
+
ops?: object;
|
|
87
|
+
}): object;
|
|
88
|
+
/**
|
|
89
|
+
* A printed block that carries a length of TS35 top-hat rail across a beam: the rail screwed through its middle into a
|
|
90
|
+
* pilot in the block, the block screwed into the slot each side of the rail, clear of its flanges.
|
|
91
|
+
* @param {string | object} profile @param {{ length?: number, load?: number, face?: string, thread?: string, head?: 'cap' | 'button', nut?: string, printer?: object, material?: string | object, given?: object }} [o]
|
|
92
|
+
* length: how far the block reaches along the rail, across the beam (default the beam's cell)
|
|
93
|
+
* @returns {object} its model, with the rail in its hardware
|
|
94
|
+
*/
|
|
95
|
+
export function dinRailAdapterModel(profile: string | object, o?: {
|
|
96
|
+
length?: number;
|
|
97
|
+
load?: number;
|
|
98
|
+
face?: string;
|
|
99
|
+
thread?: string;
|
|
100
|
+
head?: "cap" | "button";
|
|
101
|
+
nut?: string;
|
|
102
|
+
printer?: object;
|
|
103
|
+
material?: string | object;
|
|
104
|
+
given?: object;
|
|
105
|
+
}): object;
|
|
106
|
+
/** A DIN rail adapter's solid. @param {object} m @param {{ pose?: 'print' | 'fit', printer?: object, ops?: object }} [o] @returns {object} */
|
|
107
|
+
export function dinRailAdapter(m: object, o?: {
|
|
108
|
+
pose?: "print" | "fit";
|
|
109
|
+
printer?: object;
|
|
110
|
+
ops?: object;
|
|
111
|
+
}): object;
|
|
112
|
+
/**
|
|
113
|
+
* A printed clip that snaps into a slot and holds a cable bundle along it: a stem through the slot's opening with
|
|
114
|
+
* barbs under its lips (as a slot cover's), a flange on the face, and a ring over it that opens to let the bundle in.
|
|
115
|
+
* It prints on its side, its section the first layer. No screw: it goes in anywhere along the slot.
|
|
116
|
+
* @param {string | object} profile @param {{ cable?: number, width?: number, load?: number, face?: string, printer?: object, material?: string | object, given?: object }} [o]
|
|
117
|
+
* cable: the bundle's diameter; width: the clip along the slot
|
|
118
|
+
* @returns {object} its model: anchors.cable (the bundle's centre line), findings
|
|
119
|
+
*/
|
|
120
|
+
export function cableClipModel(profile: string | object, o?: {
|
|
121
|
+
cable?: number;
|
|
122
|
+
width?: number;
|
|
123
|
+
load?: number;
|
|
124
|
+
face?: string;
|
|
125
|
+
printer?: object;
|
|
126
|
+
material?: string | object;
|
|
127
|
+
given?: object;
|
|
128
|
+
}): object;
|
|
129
|
+
/** A cable clip's solid: on its side to print, or fitted. @param {object} m @param {{ pose?: 'print' | 'fit', tongues?: boolean, printer?: object, ops?: object }} [o] @returns {object} */
|
|
130
|
+
export function cableClip(m: object, o?: {
|
|
131
|
+
pose?: "print" | "fit";
|
|
132
|
+
tongues?: boolean;
|
|
133
|
+
printer?: object;
|
|
134
|
+
ops?: object;
|
|
135
|
+
}): object;
|
|
136
|
+
/**
|
|
137
|
+
* Where cable clips go along a run of slot: one at each end and as many between as keep them no further apart than the
|
|
138
|
+
* pitch, evenly spaced. @param {number} length the run, mm @param {{ pitch?: number }} [o] @returns {{ count: number, pitch: number, at: number[] }}
|
|
139
|
+
*/
|
|
140
|
+
export function runClips(length: number, o?: {
|
|
141
|
+
pitch?: number;
|
|
142
|
+
}): {
|
|
143
|
+
count: number;
|
|
144
|
+
pitch: number;
|
|
145
|
+
at: number[];
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* A printed block screwed into a slot nut, with a tunnel across it beside the screw for a cable tie, so a bundle along
|
|
149
|
+
* the slot is tied down. It prints on its side; the tunnel's roof is pointed, so it needs no bridge.
|
|
150
|
+
* @param {string | object} profile @param {{ tie?: number[], load?: number, face?: string, thread?: string, head?: 'cap' | 'button', nut?: string, printer?: object, material?: string | object, given?: object }} [o]
|
|
151
|
+
* tie: the tie's band [width, thickness]
|
|
152
|
+
* @returns {object} its model
|
|
153
|
+
*/
|
|
154
|
+
export function tieAnchorModel(profile: string | object, o?: {
|
|
155
|
+
tie?: number[];
|
|
156
|
+
load?: number;
|
|
157
|
+
face?: string;
|
|
158
|
+
thread?: string;
|
|
159
|
+
head?: "cap" | "button";
|
|
160
|
+
nut?: string;
|
|
161
|
+
printer?: object;
|
|
162
|
+
material?: string | object;
|
|
163
|
+
given?: object;
|
|
164
|
+
}): object;
|
|
165
|
+
/** A tie anchor's solid: on its side to print, or fitted. @param {object} m @param {{ pose?: 'print' | 'fit', tongues?: boolean, printer?: object, ops?: object }} [o] @returns {object} */
|
|
166
|
+
export function tieAnchor(m: object, o?: {
|
|
167
|
+
pose?: "print" | "fit";
|
|
168
|
+
tongues?: boolean;
|
|
169
|
+
printer?: object;
|
|
170
|
+
ops?: object;
|
|
171
|
+
}): object;
|
|
172
|
+
/**
|
|
173
|
+
* A printed arm that carries a spool of filament off a beam's side: a pad screwed into the slot, an arm out from the
|
|
174
|
+
* face that the spool's bore hangs on, a lip at its tip. The beam lies level with the face looking sideways, so the
|
|
175
|
+
* spool's weight bends the arm in the section's plane. Sized from the full spool's weight times SERVICE_DEFAULTS.pull.
|
|
176
|
+
* It prints on its side, its section the first layer.
|
|
177
|
+
* @param {string | object} profile @param {{ spool?: { bore: number, width: number, mass: number }, width?: number, load?: number, face?: string, thread?: string, head?: 'cap' | 'button', nut?: string, printer?: object, material?: string | object, given?: object }} [o]
|
|
178
|
+
* spool: its bore and width (mm) and mass full (kg); width: the arm along the slot (default the cell)
|
|
179
|
+
* @returns {object} its model
|
|
180
|
+
*/
|
|
181
|
+
export function spoolHolderModel(profile: string | object, o?: {
|
|
182
|
+
spool?: {
|
|
183
|
+
bore: number;
|
|
184
|
+
width: number;
|
|
185
|
+
mass: number;
|
|
186
|
+
};
|
|
187
|
+
width?: number;
|
|
188
|
+
load?: number;
|
|
189
|
+
face?: string;
|
|
190
|
+
thread?: string;
|
|
191
|
+
head?: "cap" | "button";
|
|
192
|
+
nut?: string;
|
|
193
|
+
printer?: object;
|
|
194
|
+
material?: string | object;
|
|
195
|
+
given?: object;
|
|
196
|
+
}): object;
|
|
197
|
+
/** A spool holder's solid: on its side to print, or fitted. @param {object} m @param {{ pose?: 'print' | 'fit', tongues?: boolean, printer?: object, ops?: object }} [o] @returns {object} */
|
|
198
|
+
export function spoolHolder(m: object, o?: {
|
|
199
|
+
pose?: "print" | "fit";
|
|
200
|
+
tongues?: boolean;
|
|
201
|
+
printer?: object;
|
|
202
|
+
ops?: object;
|
|
203
|
+
}): object;
|
|
204
|
+
export namespace SERVICE_DEFAULTS {
|
|
205
|
+
namespace load {
|
|
206
|
+
export { text as rule };
|
|
207
|
+
export { kind };
|
|
208
|
+
export { source };
|
|
209
|
+
export { CHECKED as checked };
|
|
210
|
+
export { unit };
|
|
211
|
+
export { value };
|
|
212
|
+
}
|
|
213
|
+
namespace gap { }
|
|
214
|
+
namespace standoff { }
|
|
215
|
+
namespace walls { }
|
|
216
|
+
namespace head { }
|
|
217
|
+
namespace cable { }
|
|
218
|
+
namespace clipWidth { }
|
|
219
|
+
namespace snap { }
|
|
220
|
+
namespace clipLoad { }
|
|
221
|
+
namespace pitch { }
|
|
222
|
+
namespace barb { }
|
|
223
|
+
namespace tie { }
|
|
224
|
+
namespace tieLoad { }
|
|
225
|
+
namespace spool { }
|
|
226
|
+
namespace pull { }
|
|
227
|
+
namespace chainFlange { }
|
|
228
|
+
}
|
|
229
|
+
/** Fans by size: their hole spacing, the screw that goes through their corners into the mount, and a usual frame depth. */
|
|
230
|
+
export const FANS: {
|
|
231
|
+
40: {
|
|
232
|
+
spacing: {
|
|
233
|
+
rule: any;
|
|
234
|
+
kind: any;
|
|
235
|
+
source: any;
|
|
236
|
+
checked: string;
|
|
237
|
+
unit?: any;
|
|
238
|
+
value: any;
|
|
239
|
+
};
|
|
240
|
+
thread: string;
|
|
241
|
+
depth: {
|
|
242
|
+
rule: any;
|
|
243
|
+
kind: any;
|
|
244
|
+
source: any;
|
|
245
|
+
checked: string;
|
|
246
|
+
unit?: any;
|
|
247
|
+
value: any;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
60: {
|
|
251
|
+
spacing: {
|
|
252
|
+
rule: any;
|
|
253
|
+
kind: any;
|
|
254
|
+
source: any;
|
|
255
|
+
checked: string;
|
|
256
|
+
unit?: any;
|
|
257
|
+
value: any;
|
|
258
|
+
};
|
|
259
|
+
thread: string;
|
|
260
|
+
depth: {
|
|
261
|
+
rule: any;
|
|
262
|
+
kind: any;
|
|
263
|
+
source: any;
|
|
264
|
+
checked: string;
|
|
265
|
+
unit?: any;
|
|
266
|
+
value: any;
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
80: {
|
|
270
|
+
spacing: {
|
|
271
|
+
rule: any;
|
|
272
|
+
kind: any;
|
|
273
|
+
source: any;
|
|
274
|
+
checked: string;
|
|
275
|
+
unit?: any;
|
|
276
|
+
value: any;
|
|
277
|
+
};
|
|
278
|
+
thread: string;
|
|
279
|
+
depth: {
|
|
280
|
+
rule: any;
|
|
281
|
+
kind: any;
|
|
282
|
+
source: any;
|
|
283
|
+
checked: string;
|
|
284
|
+
unit?: any;
|
|
285
|
+
value: any;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
92: {
|
|
289
|
+
spacing: {
|
|
290
|
+
rule: any;
|
|
291
|
+
kind: any;
|
|
292
|
+
source: any;
|
|
293
|
+
checked: string;
|
|
294
|
+
unit?: any;
|
|
295
|
+
value: any;
|
|
296
|
+
};
|
|
297
|
+
thread: string;
|
|
298
|
+
depth: {
|
|
299
|
+
rule: any;
|
|
300
|
+
kind: any;
|
|
301
|
+
source: any;
|
|
302
|
+
checked: string;
|
|
303
|
+
unit?: any;
|
|
304
|
+
value: any;
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
120: {
|
|
308
|
+
spacing: {
|
|
309
|
+
rule: any;
|
|
310
|
+
kind: any;
|
|
311
|
+
source: any;
|
|
312
|
+
checked: string;
|
|
313
|
+
unit?: any;
|
|
314
|
+
value: any;
|
|
315
|
+
};
|
|
316
|
+
thread: string;
|
|
317
|
+
depth: {
|
|
318
|
+
rule: any;
|
|
319
|
+
kind: any;
|
|
320
|
+
source: any;
|
|
321
|
+
checked: string;
|
|
322
|
+
unit?: any;
|
|
323
|
+
value: any;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
export namespace DIN_RAIL {
|
|
328
|
+
namespace width { }
|
|
329
|
+
namespace depth { }
|
|
330
|
+
namespace thickness { }
|
|
331
|
+
namespace hole { }
|
|
332
|
+
namespace thread { }
|
|
333
|
+
}
|
|
334
|
+
declare const CHECKED: "2026-11-17";
|
|
335
|
+
export {};
|