@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/rods.d.mts ADDED
@@ -0,0 +1,195 @@
1
+ /**
2
+ * The layout of a rod guide on a face of a profile, with what its drive adds: the rods' spacing across the face and their
3
+ * height over it, the carriage's size, and the sets each part reads. The spacing leaves room for the lead nut's flange
4
+ * between the bearings (ROD_DEFAULTS.web); the height clears the carriage, the nut's flange, the screw's bearing in a
5
+ * holder, the coupler and the motor's body over the face. Refused by name: a set of the wrong part, a spacing or height
6
+ * that leaves no room. @param {string | object} profile
7
+ * @param {{ face?: string, rod?: string, bearing?: string, spacing?: number, height?: number, screw?: string, nut?: string, support?: string | null, coupler?: string, motor?: string, given?: object }} [o]
8
+ * @returns {object} the layout
9
+ */
10
+ export function rodsLayout(profile: string | object, o?: {
11
+ face?: string;
12
+ rod?: string;
13
+ bearing?: string;
14
+ spacing?: number;
15
+ height?: number;
16
+ screw?: string;
17
+ nut?: string;
18
+ support?: string | null;
19
+ coupler?: string;
20
+ motor?: string;
21
+ given?: object;
22
+ }): object;
23
+ /**
24
+ * A printed holder for two rods at one end of a rod guide: a saddle standing across the beam, its legs screwed into the
25
+ * slots of the faces either side, the rods pressed through it along the beam (their holes the rod's diameter with the
26
+ * printer's hole compensation: a light press), and, where a screw drives the carriage, the screw's bearing pressed in a
27
+ * pocket from its inner face (a bearing block at each end). Sized from a load along the beam at the rods' height to about
28
+ * twice the margin, by beam formulas. It prints on its outer face, the rods' holes upright.
29
+ * @param {string | object} profile
30
+ * @param {{ face?: string, end?: 'a' | 'b', rod?: string, bearing?: string, spacing?: number, height?: number, screw?: string, leadNut?: string, support?: string | null, load?: number, thread?: string, head?: 'cap' | 'button', nut?: string, printer?: object, material?: string | object, given?: object }} [o]
31
+ * end: a (its outer face toward end a, the default) or b (turned to face b); leadNut: the lead screw's nut's set; nut: the slot nuts' kind
32
+ * @returns {object} its model
33
+ */
34
+ export function rodHolderModel(profile: string | object, o?: {
35
+ face?: string;
36
+ end?: "a" | "b";
37
+ rod?: string;
38
+ bearing?: string;
39
+ spacing?: number;
40
+ height?: number;
41
+ screw?: string;
42
+ leadNut?: string;
43
+ support?: string | null;
44
+ load?: number;
45
+ thread?: string;
46
+ head?: "cap" | "button";
47
+ nut?: string;
48
+ printer?: object;
49
+ material?: string | object;
50
+ given?: object;
51
+ }): object;
52
+ /** A rod holder's solid: as it prints (on its outer face) or in its fitted frame. @param {object} m rodHolderModel's @param {{ pose?: 'print' | 'fit', ops?: object }} [o] @returns {object} */
53
+ export function rodHolder(m: object, o?: {
54
+ pose?: "print" | "fit";
55
+ ops?: object;
56
+ }): object;
57
+ /**
58
+ * A printed plate that holds a motor of the catalogue on a beam, its shaft along the beam over a face: a saddle standing
59
+ * across the beam, its legs screwed into the side faces' slots, two screws a leg so the motor's torque is held by shear,
60
+ * and the motor's mount cut from its own rules (its mounting holes, the boss's pocket and the shaft's hole, as
61
+ * @rulecad/motors' mount() cuts them; the screws' clearance holes are @rulecad/fixings'). The motor's mounting face lies on
62
+ * the plate's outer face, its body outside, a geared motor's body offset away from the face. The plate is at least half
63
+ * as thick again as the motor's screws (as @rulecad/motors asks) and sized from a load at the shaft to about twice the
64
+ * margin; where its shaft would reach too little into a coupler past it, a recess in its inner face takes the coupler in.
65
+ * It prints on its outer face: the boss's pocket ends in a 45° cone, the recess opens up.
66
+ * @param {string | object} profile
67
+ * @param {{ motor: string, face?: string, height?: number, coupler?: { length: number, D: number }, load?: number, thread?: string, head?: 'cap' | 'button', nut?: string, printer?: object, material?: string | object, given?: object }} o
68
+ * motor: its rule set (28byj48, nema14, nema17); height: the shaft's over the face (default the least the body clears);
69
+ * coupler: its length and diameter, where one goes on the shaft (default coupler-5-8's figures for a 5 mm shaft)
70
+ * @returns {object} its model, with anchors motor (where the motor's own frame goes) and coupler (where its face is)
71
+ */
72
+ export function motorPlateModel(profile: string | object, o?: {
73
+ motor: string;
74
+ face?: string;
75
+ height?: number;
76
+ coupler?: {
77
+ length: number;
78
+ D: number;
79
+ };
80
+ load?: number;
81
+ thread?: string;
82
+ head?: "cap" | "button";
83
+ nut?: string;
84
+ printer?: object;
85
+ material?: string | object;
86
+ given?: object;
87
+ }): object;
88
+ /** A motor plate's solid: as it prints (on its outer face) or in its fitted frame. @param {object} m motorPlateModel's @param {{ pose?: 'print' | 'fit', ops?: object }} [o] @returns {object} */
89
+ export function motorPlate(m: object, o?: {
90
+ pose?: "print" | "fit";
91
+ ops?: object;
92
+ }): object;
93
+ /**
94
+ * A printed carriage for a rod guide: a block over the face, two linear bearings pressed into pockets along the beam
95
+ * (from its inner end, a floor at the far end), and where a screw drives it the lead nut's body in a bore through its
96
+ * middle with the flange screwed to its far end, into pilots. With an endstop, a flag hangs from its far end beside the
97
+ * beam down past the switch's lever. Sized from a load on its middle, between the bearings, by beam formulas. It prints on
98
+ * its far end, the pockets opening up and the flag on the bed.
99
+ * @param {string | object} profile
100
+ * @param {{ face?: string, rod?: string, bearing?: string, spacing?: number, height?: number, screw?: string, leadNut?: string, flag?: { y: number, z: number }, load?: number, printer?: object, material?: string | object, given?: object }} [o]
101
+ * flag: where its tip reaches, in its frame (y across, z over the face: below 0 is beside the beam)
102
+ * @returns {object} its model, with anchors slide (its joint), lm1 and lm2 (the bearings), nut and top
103
+ */
104
+ export function rodCarriageModel(profile: string | object, o?: {
105
+ face?: string;
106
+ rod?: string;
107
+ bearing?: string;
108
+ spacing?: number;
109
+ height?: number;
110
+ screw?: string;
111
+ leadNut?: string;
112
+ flag?: {
113
+ y: number;
114
+ z: number;
115
+ };
116
+ load?: number;
117
+ printer?: object;
118
+ material?: string | object;
119
+ given?: object;
120
+ }): object;
121
+ /** A rod carriage's solid: as it prints (on its far end) or in its fitted frame. @param {object} m rodCarriageModel's @param {{ pose?: 'print' | 'fit', ops?: object }} [o] @returns {object} */
122
+ export function rodCarriage(m: object, o?: {
123
+ pose?: "print" | "fit";
124
+ ops?: object;
125
+ }): object;
126
+ /**
127
+ * A printed mount for a miniature switch (the catalogue's endstop-10t85) on a beam's slotted side face, where a carriage
128
+ * passes: a block on the face, the switch screwed to it through its own holes into pilots, its lever facing along the
129
+ * beam toward b and reaching across the face in the direction toward (+1 or -1 along the mount's y), and the block's screw
130
+ * into the slot ahead of the lever, its head sunk in a counterbore so the carriage's flag passes over it. It prints on the
131
+ * face side. @param {string | object} profile
132
+ * @param {{ switch?: string, face: string, toward?: 1 | -1, load?: number, thread?: string, nut?: string, printer?: object, material?: string | object, given?: object }} o
133
+ * @returns {object} its model: anchors.switch (the switch's own frame), lever (where its lever's face is, in the mount's frame)
134
+ */
135
+ export function endstopMountModel(profile: string | object, o?: {
136
+ switch?: string;
137
+ face: string;
138
+ toward?: 1 | -1;
139
+ load?: number;
140
+ thread?: string;
141
+ nut?: string;
142
+ printer?: object;
143
+ material?: string | object;
144
+ given?: object;
145
+ }): object;
146
+ /** An endstop mount's solid, in its fitted frame (which is how it prints). @param {object} m endstopMountModel's @param {{ pose?: 'print' | 'fit', ops?: object }} [o] @returns {object} */
147
+ export function endstopMount(m: object, o?: {
148
+ pose?: "print" | "fit";
149
+ ops?: object;
150
+ }): object;
151
+ /**
152
+ * A rod carriage's loads against its linear bearings' static rating: the force and moment on the carriage, in its frame
153
+ * about its slide (on the rods' line between them), shared between its two bearings: the forces across the rods half
154
+ * each, a roll about the rods' line as a couple across their spacing, pitch and yaw as a couple along each bearing
155
+ * (ROD_DEFAULTS.couple: an estimate). Each bearing's radial load over its static rating; the margin is the least.
156
+ * The force along the beam is the drive's. @param {object} m rodCarriageModel's (its bearing named)
157
+ * @param {{ force: number[], moment: number[] }} load N and N m, in the carriage's frame
158
+ * @returns {{ bearings: { name: string, radial: number, ratio: number }[], worst: string, margin: number, level: 'pass' | 'warn' | 'fail', rating: number }}
159
+ */
160
+ export function rodMargin(m: object, load: {
161
+ force: number[];
162
+ moment: number[];
163
+ }): {
164
+ bearings: {
165
+ name: string;
166
+ radial: number;
167
+ ratio: number;
168
+ }[];
169
+ worst: string;
170
+ margin: number;
171
+ level: "pass" | "warn" | "fail";
172
+ rating: number;
173
+ };
174
+ export namespace ROD_DEFAULTS {
175
+ namespace gap {
176
+ export { text as rule };
177
+ export { kind };
178
+ export { source };
179
+ export { CHECKED as checked };
180
+ export { unit };
181
+ export { value };
182
+ }
183
+ namespace wall { }
184
+ namespace web { }
185
+ namespace floor { }
186
+ namespace press { }
187
+ namespace load { }
188
+ namespace switchLoad { }
189
+ namespace relief { }
190
+ namespace couple { }
191
+ namespace flag { }
192
+ namespace lever { }
193
+ }
194
+ declare const CHECKED: "2026-11-17";
195
+ export {};