@rulecad/fixings 0.0.1 → 0.1.3
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 +635 -22
- package/draw.d.mts +46 -0
- package/draw.mjs +85 -0
- package/fixings.d.mts +26 -0
- package/fixings.mjs +48 -4
- package/hardware.d.mts +215 -0
- package/hardware.mjs +181 -0
- package/holes.d.mts +136 -0
- package/holes.mjs +158 -0
- package/model.d.mts +253 -0
- package/model.mjs +383 -0
- package/package.json +37 -6
- package/seats.d.mts +355 -0
- package/seats.mjs +337 -0
- package/strength.d.mts +306 -0
- package/strength.mjs +354 -0
- package/threads.d.mts +216 -0
- package/threads.mjs +411 -0
package/model.mjs
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
// A fixing as a model from its rules: a thread, or a whole screw, nut, washer or insert on that thread, by name. Every
|
|
2
|
+
// thread is one rule set in @rulecad/rules, so its numbers are open data and live there, not here; a workspace's own
|
|
3
|
+
// rule set for a thread is used before the kit's. Also here: the name grammar, the printer's rules as fixings reads
|
|
4
|
+
// them, and the few rules this package adds. Units: mm, degrees, grams.
|
|
5
|
+
import m1_6 from '@rulecad/rules/m1_6.json' with { type: 'json' };
|
|
6
|
+
import m2 from '@rulecad/rules/m2.json' with { type: 'json' };
|
|
7
|
+
import m2_5 from '@rulecad/rules/m2_5.json' with { type: 'json' };
|
|
8
|
+
import m3 from '@rulecad/rules/m3.json' with { type: 'json' };
|
|
9
|
+
import m4 from '@rulecad/rules/m4.json' with { type: 'json' };
|
|
10
|
+
import m5 from '@rulecad/rules/m5.json' with { type: 'json' };
|
|
11
|
+
import m6 from '@rulecad/rules/m6.json' with { type: 'json' };
|
|
12
|
+
import m8 from '@rulecad/rules/m8.json' with { type: 'json' };
|
|
13
|
+
import m10 from '@rulecad/rules/m10.json' with { type: 'json' };
|
|
14
|
+
import m12 from '@rulecad/rules/m12.json' with { type: 'json' };
|
|
15
|
+
import unc_4_40 from '@rulecad/rules/unc_4_40.json' with { type: 'json' };
|
|
16
|
+
import unc_6_32 from '@rulecad/rules/unc_6_32.json' with { type: 'json' };
|
|
17
|
+
import unc_8_32 from '@rulecad/rules/unc_8_32.json' with { type: 'json' };
|
|
18
|
+
import unc_10_24 from '@rulecad/rules/unc_10_24.json' with { type: 'json' };
|
|
19
|
+
import unf_10_32 from '@rulecad/rules/unf_10_32.json' with { type: 'json' };
|
|
20
|
+
import unc_1_4_20 from '@rulecad/rules/unc_1_4_20.json' with { type: 'json' };
|
|
21
|
+
import unc_5_16_18 from '@rulecad/rules/unc_5_16_18.json' with { type: 'json' };
|
|
22
|
+
import unc_3_8_16 from '@rulecad/rules/unc_3_8_16.json' with { type: 'json' };
|
|
23
|
+
import pt_k22 from '@rulecad/rules/pt_k22.json' with { type: 'json' };
|
|
24
|
+
import pt_k25 from '@rulecad/rules/pt_k25.json' with { type: 'json' };
|
|
25
|
+
import pt_k30 from '@rulecad/rules/pt_k30.json' with { type: 'json' };
|
|
26
|
+
import pt_k35 from '@rulecad/rules/pt_k35.json' with { type: 'json' };
|
|
27
|
+
import pt_k40 from '@rulecad/rules/pt_k40.json' with { type: 'json' };
|
|
28
|
+
import pt_k50 from '@rulecad/rules/pt_k50.json' with { type: 'json' };
|
|
29
|
+
import x1c from '@rulecad/rules/x1c.json' with { type: 'json' };
|
|
30
|
+
import engagementSet from '@rulecad/rules/engagement.json' with { type: 'json' };
|
|
31
|
+
import s275 from '@rulecad/rules/s275.json' with { type: 'json' };
|
|
32
|
+
import ss304 from '@rulecad/rules/ss304.json' with { type: 'json' };
|
|
33
|
+
|
|
34
|
+
const KIT = [m1_6, m2, m2_5, m3, m4, m5, m6, m8, m10, m12, unc_4_40, unc_6_32, unc_8_32, unc_10_24, unf_10_32, unc_1_4_20, unc_5_16_18, unc_3_8_16, pt_k22, pt_k25, pt_k30, pt_k35, pt_k40, pt_k50];
|
|
35
|
+
const KIT_BY_NAME = Object.fromEntries(KIT.map((s) => [s.name, s]));
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The rules this package adds to the threads' and the printer's own, each with what it comes from.
|
|
39
|
+
* @type {Record<string, { value: number, unit: string, rule: string, kind: string, source: string, checked: string }>}
|
|
40
|
+
*/
|
|
41
|
+
export const DEFAULTS = {
|
|
42
|
+
nut_sink: { value: 2, unit: 'layers', rule: 'A nut pocket is this many layers deeper than the nut is tall, so the nut sits under the face it went in by', kind: 'community', source: 'How the kit\'s lever bench draws its M4 and M5 nut pockets (examples/bench: nut_height + layer * 2)', checked: '2026-11-15' },
|
|
43
|
+
nut_slack: { value: 1, unit: 'layers', rule: 'A nut dropped in mid-print lies at least this far under the layer printed over it, so the nozzle clears a nut that sits a little high', kind: 'estimate', source: 'A working margin of this package, to be measured on the fixings coupon', checked: '2026-11-15' },
|
|
44
|
+
pitch_diameter: { value: (3 * Math.sqrt(3)) / 8, unit: '× pitch', rule: 'A 60° thread\'s pitch diameter is its major diameter less 0.6495 of its pitch: the diameter a threaded length weighs as', kind: 'spec', source: 'The ISO 68-1 basic profile, as worked at https://en.wikipedia.org/wiki/ISO_metric_screw_thread (D_p = D_maj - 0.649519 P)', checked: '2026-11-15' },
|
|
45
|
+
steel_density: { ...s275.rules.density, rule: 'Density of steel, for a screw\'s, nut\'s or washer\'s mass (the kit\'s S275 figure: carbon steels differ by under 1%)' },
|
|
46
|
+
stainless_density: { ...ss304.rules.density, rule: 'Density of 304 stainless steel (A2), for stainless hardware' },
|
|
47
|
+
thread_layers: { value: 5, unit: 'layers', rule: 'A printed thread needs this many layers to a pitch: a layer or two on each flank and one on the crest. Finer, and the layers no longer draw the tooth', kind: 'estimate', source: 'A working figure of this package: at a 0.2 mm layer it makes M6 (1 mm pitch) the smallest metric thread drawn. To be measured on the fixings coupon', checked: '2026-11-15' },
|
|
48
|
+
thread_lines: { value: 1, unit: 'lines', rule: 'A printed thread\'s tooth is at least this many print lines deep, measured on the standard\'s basic profile: a shallower tooth is lost in the wall\'s outer line', kind: 'estimate', source: 'A working figure of this package, to be measured on the fixings coupon', checked: '2026-11-15' },
|
|
49
|
+
thread_crest: { value: 0.125, unit: '× pitch', rule: 'The least flat left on the crest of a printed tooth whose down-facing flank has been laid back: an eighth of the pitch, the crest flat ISO 68-1 gives an external thread', kind: 'default', source: 'ISO 68-1 basic profile (the outermost eighth of the triangle\'s height is cut off), as worked at https://en.wikipedia.org/wiki/ISO_metric_screw_thread', checked: '2026-11-15' },
|
|
50
|
+
shear_ratio: { value: 1 / Math.sqrt(3), unit: '× strength', rule: 'A material\'s shear strength is taken as its tensile strength (a plastic\'s) or yield strength (a metal\'s) over the square root of 3: an estimate. In a printed part the bond between layers and the walls round the hole decide the real figure', kind: 'estimate', source: 'The von Mises criterion: in pure shear a material yields at its tensile yield stress over √3, https://en.wikipedia.org/wiki/Von_Mises_yield_criterion', checked: '2026-11-15' },
|
|
51
|
+
nut_factor: { value: 0.2, unit: 'T / (d F)', rule: 'The nut factor K in T = K d F, for plain steel threads with a friction of about 0.15: an estimate. Preload from a torque wrench scatters by 25% lubricated and 35% dry, and a lubricated or plated screw has a lower K', kind: 'estimate', source: 'Bolted joint, https://en.wikipedia.org/wiki/Bolted_joint (K about 0.20 at a friction of 0.15; the accuracy of each tightening method)', checked: '2026-11-15' },
|
|
52
|
+
preload_share: { value: 0.75, unit: '× proof load', rule: 'A screw tightened fully carries about three quarters of its proof load: the preload taken where none is given', kind: 'community', source: 'Bolted joint, https://en.wikipedia.org/wiki/Bolted_joint (a preload of at least 75% of the proof load for structural joints, up to 90% for permanent ones)', checked: '2026-11-15' },
|
|
53
|
+
insert_engagement: { value: 1, unit: '× diameter', rule: 'A screw engages a brass heat-set insert by at least its own diameter, or the whole insert where that is shorter: an estimate, the figure the engagement rules give for steel', kind: 'estimate', source: 'A working figure of this package, after engagement.steel in @rulecad/rules; no insert maker\'s figure was found', checked: '2026-11-15' },
|
|
54
|
+
tip_room: { value: 1, unit: 'mm', rule: 'A screw\'s tip stops at least this far short of the bottom of a blind hole, so it tightens on its head and not on its tip: an estimate, the millimetre an insert\'s blind hole is given past the insert', kind: 'estimate', source: 'A working figure of this package, after insert_depth in the thread rule sets (the insert\'s length and 1 mm)', checked: '2026-11-15' },
|
|
55
|
+
load_margin: { value: 2, unit: '× load', rule: 'A printed joint is sized to hold about twice the load it is given', kind: 'default', source: 'The kit\'s standard for printed parts: sized from the load with about twice the margin', checked: '2026-11-15' },
|
|
56
|
+
clamp_friction: { value: 0.3, unit: '× clamp force', rule: 'The friction between two printed parts clamped by screws, for whether a joint slips before its screws bear on their holes: an estimate. No measured figure for PLA on PLA at rest was found; the figures found are for printed PLA sliding on steel, about 0.38 to 0.57, and 0.3 is taken under them', kind: 'estimate', source: 'Sliding friction of printed PLA on steel: Pawlak, kinetic 0.49 (https://yadda.icm.edu.pl/baztech/element/bwmeta1.element.baztech-f7c60c77-2f7e-4c4f-8d4e-f962d0c503e7/c/pawlak.pdf), and Sirin et al., Rapid Prototyping Journal 2023, 0.38 to 0.57 pin on disc (https://www.emerald.com/insight/content/doi/10.1108/RPJ-03-2022-0081/full/html); to be measured on the fixings coupon', checked: '2026-11-15' },
|
|
57
|
+
brass_density: { value: 8.47, unit: 'g/cm³', rule: 'Density of free-machining brass CW614N (CuZn39Pb3), taken for a heat-set insert. The insert maker\'s sheet names no alloy, so the alloy is assumed', kind: 'estimate', source: 'Aalco, CW614N brass rod datasheet, https://www.aalco.co.uk/datasheets/Copper-and-Copper-Alloys-CW614N-Brass-Rod_31.ashx', checked: '2026-11-15' }
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// ---------- small things every module here uses ----------
|
|
61
|
+
export const r3 = (x) => +x.toFixed(3);
|
|
62
|
+
export const mm = (x) => String(+Number(x).toFixed(3));
|
|
63
|
+
export const isNum = (x) => typeof x === 'number' && Number.isFinite(x);
|
|
64
|
+
export const shown = (v) => { const s = v === undefined ? 'nothing' : JSON.stringify(v) ?? String(v); return s.length > 80 ? `${s.slice(0, 77)}...` : s; }; // (a whole rule set handed in by mistake is not printed back)
|
|
65
|
+
export const near = (a, b) => { // edits between two names, to suggest the nearest
|
|
66
|
+
const d = Array.from({ length: a.length + 1 }, (_, i) => [i, ...Array(b.length).fill(0)]);
|
|
67
|
+
for (let j = 1; j <= b.length; j++) d[0][j] = j;
|
|
68
|
+
for (let i = 1; i <= a.length; i++) for (let j = 1; j <= b.length; j++) d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
69
|
+
return d[a.length][b.length];
|
|
70
|
+
};
|
|
71
|
+
export function positive(what, k, v) { if (!(isNum(v) && v > 0)) throw new Error(`${what}: ${k} is a number above 0, in mm (got ${shown(v)})`); return v; }
|
|
72
|
+
export function oneOf(what, k, v, list) { if (!list.includes(v)) throw new Error(`${what}: ${k} is ${list.slice(0, -1).join(', ')} or ${list.at(-1)} (got ${shown(v)})`); return v; }
|
|
73
|
+
/** A finding in the kit's one shape. */
|
|
74
|
+
export const finding = (level, text, code, extra = {}) => ({ level, text, code, ...extra });
|
|
75
|
+
/** What a result rests on: a figure's name, value, kind and source, without its whole rule. */
|
|
76
|
+
export const rest = (name, f) => ({ name, value: f.value, ...(f.unit ? { unit: f.unit } : {}), kind: f.kind, source: f.source });
|
|
77
|
+
const article = (s) => (/^(M|8-)/.test(s) ? 'an' : 'a');
|
|
78
|
+
/** "an M3", "a 1/4-20 UNC", "a PT K30". */
|
|
79
|
+
export const a = (thread) => `${article(thread)} ${thread}`;
|
|
80
|
+
|
|
81
|
+
// ---------- the name grammar ----------
|
|
82
|
+
/**
|
|
83
|
+
* The one grammar a fixing's name is read by. parseName reads it and nothing else does.
|
|
84
|
+
* @type {string}
|
|
85
|
+
*/
|
|
86
|
+
export const GRAMMAR = [
|
|
87
|
+
'name = thread [ "x" length ] { word }',
|
|
88
|
+
'thread = "M" number metric: M3, M2.5',
|
|
89
|
+
' | size "-" count [ "UNC" | "UNF" ] inch: 6-32, #6-32, 1/4-20, 10-32 UNF',
|
|
90
|
+
' | [ "PT" ] "K" number a screw for plastic: K30, PT K30',
|
|
91
|
+
'length = number [ "mm" | "in" ] mm on a metric or plastic thread; inches on an inch thread, where',
|
|
92
|
+
' a fraction is read too: 1/2, 1 1/2',
|
|
93
|
+
'word = "cap" | "button" | "countersunk" | "hex" | "set" | "pan" a screw\'s head form',
|
|
94
|
+
' | [ "hex" | "square" | "lock" ] "nut" a nut (hex if not said)',
|
|
95
|
+
' | "washer" | "insert" a plain washer, a heat-set insert',
|
|
96
|
+
' | a variant of the thread\'s rule set torx, on a PT screw'
|
|
97
|
+
].join('\n');
|
|
98
|
+
|
|
99
|
+
/** The head forms a screw's name can say. */
|
|
100
|
+
export const HEADS = ['cap', 'button', 'countersunk', 'hex', 'set', 'pan'];
|
|
101
|
+
/** The kinds of nut a name can say. */
|
|
102
|
+
export const NUTS = ['hex', 'square', 'lock'];
|
|
103
|
+
const HEAD_WORDS = { cap: 'cap', socket: 'cap', button: 'button', countersunk: 'countersunk', csk: 'countersunk', flat: 'countersunk', hex: 'hex', set: 'set', grub: 'set', pan: 'pan' };
|
|
104
|
+
const NUT_WORDS = { hex: 'hex', square: 'square', lock: 'lock', nyloc: 'lock' };
|
|
105
|
+
const NOISE = ['screw', 'bolt', 'head', 'plain', 'heat-set'];
|
|
106
|
+
const ITEMS = ['nut', 'washer', 'insert'];
|
|
107
|
+
const squash = (s) => String(s).toLowerCase().replace(/[\s#]/g, '');
|
|
108
|
+
const inches = (text) => { const [whole, frac] = /\//.test(text) ? (/\s/.test(text.trim()) ? text.trim().split(/\s+/) : ['0', text]) : [text, '0/1'], [n, d] = frac.split('/').map(Number); return Number(whole) + n / d; };
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* A fixing's name read by the grammar, before any rule set is looked at.
|
|
112
|
+
* @param {string} name 'M3', 'M3x12 cap', '1/4-20 x 1/2 cap', 'M4 lock nut', 'K30x10 pan torx'
|
|
113
|
+
* @returns {{ thread: string, form: 'metric' | 'unified' | 'plastic', length: number | null, unit: 'mm' | 'in' | null, item: 'thread' | 'screw' | 'nut' | 'washer' | 'insert', head: string | null, nut: string | null, extra: string[] }}
|
|
114
|
+
* length: as written, in unit (null: the thread's own, mm or inches); extra: words left for the rule set's variants
|
|
115
|
+
*/
|
|
116
|
+
export function parseName(name) {
|
|
117
|
+
const what = 'fixing name', help = `A name is a thread, then a length and what it is where it has them: 'M3', 'M3x12 cap', '1/4-20 x 1/2 button', 'M4 lock nut', 'M3 insert'`;
|
|
118
|
+
if (typeof name !== 'string' || !name.trim()) throw new Error(`${what}: give a name, not ${shown(name)}. ${help}`);
|
|
119
|
+
const s = name.trim();
|
|
120
|
+
let t, thread, form;
|
|
121
|
+
if ((t = /^m\s*(\d+(?:\.\d+)?)/i.exec(s))) { thread = `M${t[1]}`; form = 'metric'; }
|
|
122
|
+
else if ((t = /^(?:pt\s*)?k\s*(\d+)/i.exec(s))) { thread = `K${t[1]}`; form = 'plastic'; }
|
|
123
|
+
else if ((t = /^#?\s*(\d+\/\d+|\d+)\s*-\s*(\d+)(?:\s*(unc|unf)\b)?/i.exec(s))) { thread = `${t[1]}-${t[2]}${t[3] ? ` ${t[3].toUpperCase()}` : ''}`; form = 'unified'; }
|
|
124
|
+
else throw new Error(`${what}: "${name}" does not start with a thread (M3, M2.5, 6-32, 1/4-20, K30). ${help}`);
|
|
125
|
+
let tail = s.slice(t[0].length), length = null, unit = null;
|
|
126
|
+
const l = /^\s*[x×*]\s*(\d+\s+\d+\/\d+|\d+\/\d+|\d*\.?\d+)\s*(mm\b|in\b|"|”)?/i.exec(tail);
|
|
127
|
+
if (l) { length = inches(l[1]); unit = l[2] ? (/mm/i.test(l[2]) ? 'mm' : 'in') : null; tail = tail.slice(l[0].length); if (!(length > 0)) throw new Error(`${what}: "${name}": a length is above 0 (got ${l[1]})`); }
|
|
128
|
+
else if (/^\s*[x×*]/.test(tail)) throw new Error(`${what}: "${name}": after the x comes a length (M3x12, 1/4-20 x 1/2). ${help}`);
|
|
129
|
+
const words = tail.toLowerCase().split(/[\s,]+/).filter(Boolean).filter((w) => !NOISE.includes(w));
|
|
130
|
+
const items = words.filter((w) => ITEMS.includes(w));
|
|
131
|
+
if (items.length > 1) throw new Error(`${what}: "${name}" names ${items.join(' and ')}: one thing at a time`);
|
|
132
|
+
const item = items[0] ?? null, others = words.filter((w) => !ITEMS.includes(w)), table = item === 'nut' ? NUT_WORDS : item ? {} : HEAD_WORDS;
|
|
133
|
+
const forms = [...new Set(others.filter((w) => w in table).map((w) => table[w]))], extra = others.filter((w) => !(w in table));
|
|
134
|
+
if (forms.length > 1) throw new Error(`${what}: "${name}" says ${forms.join(' and ')}: ${item === 'nut' ? 'a nut is one of' : 'a head is one of'} ${(item === 'nut' ? NUTS : HEADS).join(', ')}`);
|
|
135
|
+
if (item === 'nut' || item === 'washer') { if (length != null) throw new Error(`${what}: "${name}": a ${item} has no length`); }
|
|
136
|
+
return { thread, form, length, unit, item: item ?? (length != null || forms[0] ? 'screw' : 'thread'), head: item ? null : forms[0] ?? null, nut: item === 'nut' ? forms[0] ?? 'hex' : null, extra };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// ---------- rule sets by thread ----------
|
|
140
|
+
// The keys a thread is found by: as written, and an inch thread without its series, a plastic screw without its maker's PT
|
|
141
|
+
const keysOf = (text) => { const k = squash(text); return [...new Set([k, k.replace(/un[cf]$/, ''), k.replace(/^pt/, '')])]; };
|
|
142
|
+
const index = (sets) => { const out = new Map(); for (const s of sets) for (const k of keysOf(s.rules.thread.value)) if (!out.has(k)) out.set(k, s); return out; };
|
|
143
|
+
const KIT_INDEX = index(KIT);
|
|
144
|
+
const isSet = (s) => !!s && typeof s === 'object' && !!s.rules && typeof s.rules === 'object';
|
|
145
|
+
// A workspace's sets, by the thread each is for: the one its `thread` rule names, or (an older set, from before threads
|
|
146
|
+
// said what they were) the kit's set of the same name
|
|
147
|
+
const OWN = new WeakMap();
|
|
148
|
+
function ownIndex(what, sets) {
|
|
149
|
+
if (sets == null) return new Map();
|
|
150
|
+
if (typeof sets !== 'object') throw new Error(`${what}: sets is the workspace's rule sets, by name ({ m3: { name, rules } }) or as a list, not ${shown(sets)}`);
|
|
151
|
+
if (OWN.has(sets)) return OWN.get(sets);
|
|
152
|
+
const out = new Map();
|
|
153
|
+
for (const [n, s] of Array.isArray(sets) ? sets.map((x) => [x?.name, x]) : Object.entries(sets)) {
|
|
154
|
+
if (!isSet(s)) continue;
|
|
155
|
+
const text = typeof s.rules.thread?.value === 'string' ? s.rules.thread.value : KIT_BY_NAME[s.name ?? n]?.rules.thread.value;
|
|
156
|
+
if (text) for (const k of keysOf(text)) if (!out.has(k)) out.set(k, { ...s, name: s.name ?? n });
|
|
157
|
+
}
|
|
158
|
+
OWN.set(sets, out);
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The threads there are rule sets for, as each is written: the kit's, and a workspace's own first.
|
|
164
|
+
* @param {{ sets?: object }} [opts] @returns {string[]}
|
|
165
|
+
*/
|
|
166
|
+
export function threads(opts = {}) {
|
|
167
|
+
const own = [...new Set([...ownIndex('threads', opts?.sets).values()])].map((s) => s.rules.thread?.value ?? KIT_BY_NAME[s.name].rules.thread.value);
|
|
168
|
+
return [...new Set([...own, ...KIT.map((s) => s.rules.thread.value)])];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const HEAD_FIGURES = {
|
|
172
|
+
cap: { diameter: 'head', height: 'head_height', key: 'head_key' },
|
|
173
|
+
button: { diameter: 'button_head', height: 'button_head_height', key: 'button_key' },
|
|
174
|
+
countersunk: { diameter: 'countersunk_head', height: 'countersunk_head_height', key: 'countersunk_key', angle: 'countersunk_angle' },
|
|
175
|
+
hex: { flats: 'hex_head_flats', height: 'hex_head_height' },
|
|
176
|
+
set: { key: 'set_screw_key', point: 'set_screw_point' },
|
|
177
|
+
pan: { diameter: 'pan_head', height: 'pan_head_height', drive: 'pan_head_drive' }
|
|
178
|
+
};
|
|
179
|
+
const NUT_FIGURES = { hex: { flats: 'nut_flats', height: 'nut_height' }, square: { flats: 'square_nut_flats', height: 'square_nut_height' }, lock: { flats: 'lock_nut_flats', height: 'lock_nut_height' } };
|
|
180
|
+
const first = (o) => Object.values(o)[0];
|
|
181
|
+
const madeOf = (figures) => ({
|
|
182
|
+
heads: HEADS.filter((h) => figures[first(HEAD_FIGURES[h])]), nuts: NUTS.filter((n) => figures[first(NUT_FIGURES[n])]),
|
|
183
|
+
washer: !!figures.washer_diameter, insert: !!figures.insert_hole
|
|
184
|
+
});
|
|
185
|
+
const list = (xs) => (xs.length ? xs.join(', ') : 'none');
|
|
186
|
+
|
|
187
|
+
/** @param {Fixing} m @param {string} n a figure's name @returns {string} the name it is cited by: 'm3.clearance' */
|
|
188
|
+
export const cite = (m, n) => `${m.set}.${n}`;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* A figure of a fixing as a number, refused by name where the thread has none or it is not a number.
|
|
192
|
+
* @param {string} what @param {Fixing} m @param {string} n @returns {number}
|
|
193
|
+
*/
|
|
194
|
+
export function figure(what, m, n) {
|
|
195
|
+
const f = m.figures[n];
|
|
196
|
+
if (!f) throw new Error(`${what}: ${m.thread} has no ${n} in its rule set (${m.set})`);
|
|
197
|
+
if (!isNum(f.value)) throw new Error(`${what}: ${cite(m, n)} is written as ${shown(f.value)}: a number is needed here (hand in the rule set with its values worked out)`);
|
|
198
|
+
return f.value;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* A head form of a thread, from its figures: refused by name where that size is not made with it.
|
|
203
|
+
* @param {string} what @param {Fixing} m @param {string} form cap, button, countersunk, hex, set or pan
|
|
204
|
+
* @returns {Head}
|
|
205
|
+
*/
|
|
206
|
+
export function headOf(what, m, form) {
|
|
207
|
+
oneOf(what, 'head', form, HEADS);
|
|
208
|
+
if (!m.made.heads.includes(form)) throw new Error(`${what}: ${m.thread} is not made with a ${form} head, by its rule set (${m.set}): it comes as ${list(m.made.heads)}`);
|
|
209
|
+
const names = HEAD_FIGURES[form], h = { form, diameter: 0, height: 0, across: 0, figures: Object.values(names).filter((n) => m.figures[n]) };
|
|
210
|
+
for (const [k, n] of Object.entries(names)) if (m.figures[n]) h[k] = k === 'drive' ? m.figures[n].value : figure(what, m, n);
|
|
211
|
+
h.across = h.flats ? r3(h.flats / Math.cos(Math.PI / 6)) : h.diameter; // (a hexagon's corners)
|
|
212
|
+
return h;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* A nut on a thread, from its figures: refused by name where that size has none.
|
|
217
|
+
* @param {string} what @param {Fixing} m @param {string} kind hex, square or lock
|
|
218
|
+
* @returns {{ kind: string, flats: number, height: number, across: number, figures: string[] }} across: over the corners
|
|
219
|
+
*/
|
|
220
|
+
export function nutOf(what, m, kind) {
|
|
221
|
+
oneOf(what, 'kind', kind, NUTS);
|
|
222
|
+
if (!m.made.nuts.includes(kind)) throw new Error(`${what}: ${m.thread} has no ${kind} nut in its rule set (${m.set}): its nuts are ${list(m.made.nuts)}`);
|
|
223
|
+
const names = NUT_FIGURES[kind], flats = figure(what, m, names.flats);
|
|
224
|
+
return { kind, flats, height: figure(what, m, names.height), across: r3(kind === 'square' ? flats * Math.SQRT2 : flats / Math.cos(Math.PI / 6)), figures: Object.values(names) };
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const INCH = 25.4, frac = (x) => { // a length in inches as it is said: 1/2, 1 1/2, or a decimal where it is no 64th
|
|
228
|
+
const n = Math.round(x * 64); if (Math.abs(n / 64 - x) > 1e-6) return String(+x.toFixed(4));
|
|
229
|
+
const g = (p, q) => (q ? g(q, p % q) : p), whole = Math.floor(n / 64), rem = n - whole * 64, d = g(rem, 64);
|
|
230
|
+
return rem ? `${whole ? `${whole} ` : ''}${rem / d}/${64 / d}` : String(whole);
|
|
231
|
+
};
|
|
232
|
+
const said = (m, L) => (m.form === 'unified' ? `${frac(L / INCH)} in (${mm(L)} mm)` : `${mm(L)} mm`);
|
|
233
|
+
|
|
234
|
+
/** A screw's name in its one spelling: 'M3x12 cap', '1/4-20 UNC x 1/2 cap'. @param {Fixing} m @param {number | null} length mm @param {string} form @returns {string} */
|
|
235
|
+
export const screwName = (m, length, form) => `${m.thread}${length == null ? '' : m.form === 'unified' ? ` x ${frac(length / INCH)}` : `x${mm(length)}`} ${form}`;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* A screw's length held to the lengths it is sold in: refused, naming the nearest sold, unless the caller allows it.
|
|
239
|
+
* @param {string} what @param {Fixing} m @param {number} length mm @param {boolean} [allow]
|
|
240
|
+
* @returns {{ length: number, sold: boolean | null }} sold: null where the thread's rule set lists no lengths
|
|
241
|
+
*/
|
|
242
|
+
export function lengthOf(what, m, length, allow = false) {
|
|
243
|
+
positive(what, 'length', length);
|
|
244
|
+
const f = m.figures.lengths;
|
|
245
|
+
if (!f) return { length, sold: null };
|
|
246
|
+
if (!Array.isArray(f.value) || !f.value.every(isNum)) throw new Error(`${what}: ${cite(m, 'lengths')} is a list of numbers in mm (got ${shown(f.value)})`);
|
|
247
|
+
const hit = f.value.find((x) => Math.abs(x - length) < 1e-3);
|
|
248
|
+
if (hit != null) return { length: hit, sold: true };
|
|
249
|
+
if (allow) return { length, sold: false };
|
|
250
|
+
const below = f.value.filter((x) => x < length).at(-1), above = f.value.find((x) => x > length), nearest = [below, above].filter((x) => x != null).map((x) => said(m, x));
|
|
251
|
+
throw new Error(`${what}: ${a(m.thread)} screw is not sold ${said(m, length)} long: the nearest ${nearest.length > 1 ? 'are' : 'is'} ${nearest.join(' and ')} (${cite(m, 'lengths')}: ${f.value.map((x) => (m.form === 'unified' ? frac(x / INCH) : mm(x))).join(', ')}${m.form === 'unified' ? ' in' : ' mm'}, the socket cap screw's). For a length you know you can buy, pass { anyLength: true }`);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @typedef {{ value: number | string | number[], unit?: string, kind: string, source: string, rule?: string, checked?: string, from?: 'workspace' | 'kit' }} Figure
|
|
256
|
+
* one figure of a thread: its value, how far to trust it (kind: spec, measured, community, estimate, default, derived or given) and where it comes from
|
|
257
|
+
* @typedef {{ form: string, diameter: number, height: number, across: number, key?: number, flats?: number, angle?: number, point?: number, drive?: string, figures: string[] }} Head
|
|
258
|
+
* a head: its diameter (0 for a hexagon head, which has flats, and for a set screw), its height (0 for a set screw), across: the widest it is; figures: the rules it was read from
|
|
259
|
+
* @typedef {{ kind: 'fixing', item: 'thread' | 'screw' | 'nut' | 'washer' | 'insert', name: string, said: string, set: string, thread: string,
|
|
260
|
+
* form: 'metric' | 'unified' | 'plastic', major: number, pitch: number, length: number | null, sold: boolean | null, head: Head | null,
|
|
261
|
+
* nut: { kind: string, flats: number, height: number, across: number, figures: string[] } | null, variant: string | null,
|
|
262
|
+
* made: { heads: string[], nuts: string[], washer: boolean, insert: boolean }, figures: Record<string, Figure> }} Fixing
|
|
263
|
+
* name: the name in its one spelling; said: as it was asked for; set: the rule set's name; major, pitch: the thread, mm;
|
|
264
|
+
* length: a screw's, from under its head (a countersunk screw's and a set screw's: overall), or an insert's; sold: whether that length
|
|
265
|
+
* is in the thread's list (null: it lists none); made: the head forms, nuts, washer and insert this size has figures for
|
|
266
|
+
*/
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* A fixing by name, from its thread's rule set: a thread ('M3', '1/4-20'), or a whole screw ('M3x12 cap'), nut
|
|
270
|
+
* ('M4 lock nut'), washer or insert on it. See GRAMMAR for what a name may say.
|
|
271
|
+
* @param {string} name
|
|
272
|
+
* @param {Record<string, number | string | number[] | Partial<Figure>>} [change] a different or measured figure, by its rule's name:
|
|
273
|
+
* { clearance: 3.3 } or { pilot: { value: 2.8, kind: 'measured', source: 'my coupon, 2026-11-20' } }
|
|
274
|
+
* @param {{ sets?: object, anyLength?: boolean, variant?: string }} [opts] sets: the workspace's rule sets, by name or as a
|
|
275
|
+
* list, where a set for this thread is used before the kit's (its figures first, the kit's for what it lacks);
|
|
276
|
+
* anyLength: take a length the thread's list does not have; variant: a variant of the rule set, by its name
|
|
277
|
+
* @returns {Fixing}
|
|
278
|
+
*/
|
|
279
|
+
export function fixingModel(name, change = {}, opts = {}) {
|
|
280
|
+
const what = 'fixingModel', p = parseName(name);
|
|
281
|
+
if (change == null || typeof change !== 'object') throw new Error(`${what}: change is figures by their rules' names ({ clearance: 3.3 }), not ${shown(change)}`);
|
|
282
|
+
const key = squash(p.thread), own = ownIndex(what, opts?.sets).get(key), kit = KIT_INDEX.get(key);
|
|
283
|
+
if (!own && !kit) {
|
|
284
|
+
const all = threads(opts), close = all.filter((t) => keysOf(t).some((k) => near(key, k) <= 1)); // (one near miss is a slip: 10-32 UNC; several, as round M7, are no help)
|
|
285
|
+
throw new Error(`${what}: no thread "${p.thread}"${close.length === 1 ? ` (did you mean ${close[0]}?)` : ''}. There are: ${all.join(', ')}. For another thread, hand in its rule set ({ sets })`);
|
|
286
|
+
}
|
|
287
|
+
const set = own ?? kit, figures = {};
|
|
288
|
+
if (own && kit && own !== kit) for (const [n, r] of Object.entries(kit.rules)) figures[n] = { ...r, from: 'kit' };
|
|
289
|
+
for (const [n, r] of Object.entries(set.rules)) figures[n] = own && kit && own !== kit ? { ...r, from: 'workspace' } : { ...r };
|
|
290
|
+
const variants = { ...(own && kit ? kit.variants : {}), ...set.variants }, variantNames = Object.keys(variants);
|
|
291
|
+
const apply = (v) => { for (const [n, value] of Object.entries(variants[v].values ?? {})) figures[n] = { ...figures[n], value, kind: variants[v].kind ?? figures[n]?.kind, source: variants[v].source ?? figures[n]?.source }; return v; };
|
|
292
|
+
const find = (w) => variantNames.find((v) => squash(v) === squash(w));
|
|
293
|
+
let variant = null;
|
|
294
|
+
if (opts?.variant != null) { const v = find(opts.variant); if (!v) throw new Error(`${what}: ${set.name} has no variant "${opts.variant}" (${list(variantNames)})`); variant = apply(v); }
|
|
295
|
+
for (const w of p.extra) {
|
|
296
|
+
const v = find(w);
|
|
297
|
+
if (!v) throw new Error(`${what}: "${name}": nothing is called "${w}". A head form is one of ${HEADS.join(', ')}; a nut is 'hex nut', 'square nut' or 'lock nut'; and there are 'washer' and 'insert'${variantNames.length ? `. ${set.name}'s variants: ${list(variantNames)}` : ''}`);
|
|
298
|
+
variant = apply(v);
|
|
299
|
+
}
|
|
300
|
+
for (const [n, c] of Object.entries(change)) {
|
|
301
|
+
if (!figures[n]) { const guess = Object.keys(figures).map((k) => [near(n, k), k]).sort((x, y) => x[0] - y[0])[0]; throw new Error(`${what}: ${set.name} has no figure "${n}"${guess[0] <= 3 ? ` (did you mean ${guess[1]}?)` : ''}`); }
|
|
302
|
+
figures[n] = typeof c === 'object' && c && !Array.isArray(c) ? { ...figures[n], ...c } : { ...figures[n], value: c, kind: 'given', source: 'given to fixingModel' };
|
|
303
|
+
if (figures[n].value == null) throw new Error(`${what}: ${n} needs a value (got ${shown(c)})`);
|
|
304
|
+
}
|
|
305
|
+
for (const n of ['thread', 'thread_form', 'major_diameter', 'pitch']) if (!figures[n]) throw new Error(`${what}: ${set.name} is no thread's rule set: it has no ${n} (a thread needs thread, thread_form, major_diameter and pitch)`);
|
|
306
|
+
const form = oneOf(`${what}: ${set.name}.thread_form`, 'the form', figures.thread_form.value, ['metric', 'unified', 'plastic']);
|
|
307
|
+
/** @type {Fixing} */
|
|
308
|
+
const m = { kind: 'fixing', item: p.item, name: '', said: name, set: set.name, thread: String(figures.thread.value), form, major: 0, pitch: 0, length: null, sold: null, head: null, nut: null, variant, made: madeOf(figures), figures };
|
|
309
|
+
m.major = positive(`${what}: ${set.name}`, 'major_diameter', figure(what, m, 'major_diameter')); m.pitch = positive(`${what}: ${set.name}`, 'pitch', figure(what, m, 'pitch'));
|
|
310
|
+
const given = p.length == null ? null : p.item === 'insert' ? (p.unit === 'in' ? p.length * INCH : p.length) : (p.unit ?? (form === 'unified' ? 'in' : 'mm')) === 'in' ? p.length * INCH : p.length;
|
|
311
|
+
if (p.item === 'screw') {
|
|
312
|
+
m.head = headOf(what, m, p.head ?? (m.made.heads.includes('cap') ? 'cap' : m.made.heads[0]));
|
|
313
|
+
// (the list of lengths is the socket cap screw's: a set screw is sold shorter, so its length is not held to it)
|
|
314
|
+
if (given != null && m.head.form === 'set') m.length = positive(what, 'length', given);
|
|
315
|
+
else if (given != null) Object.assign(m, lengthOf(what, m, given, !!opts?.anyLength));
|
|
316
|
+
} else if (p.item === 'nut') m.nut = nutOf(what, m, p.nut);
|
|
317
|
+
else if (p.item === 'washer') { if (!m.made.washer) throw new Error(`${what}: ${m.thread} has no washer in its rule set (${set.name})`); }
|
|
318
|
+
else if (p.item === 'insert') {
|
|
319
|
+
if (!m.made.insert) throw new Error(`${what}: ${m.thread} has no heat-set insert in its rule set (${set.name})`);
|
|
320
|
+
if (given != null && Math.abs(given - figure(what, m, 'insert_length')) > 1e-3) {
|
|
321
|
+
const fits = variantNames.filter((v) => Math.abs((variants[v].values?.insert_length ?? NaN) - given) < 1e-3);
|
|
322
|
+
if (!fits.length) throw new Error(`${what}: ${a(m.thread)} insert is not listed ${mm(given)} mm long: its rule set (${set.name}) has ${[set.rules.insert_length?.value ?? kit?.rules.insert_length?.value, ...variantNames.map((v) => variants[v].values?.insert_length)].filter(isNum).map(mm).join(', ')} mm`);
|
|
323
|
+
m.variant = apply(fits[0]);
|
|
324
|
+
}
|
|
325
|
+
m.length = figure(what, m, 'insert_length');
|
|
326
|
+
}
|
|
327
|
+
const also = m.variant ? ` ${m.variant}` : '';
|
|
328
|
+
m.name = m.item === 'thread' ? `${m.thread}${also}` : m.item === 'screw' ? `${screwName(m, m.length, m.head.form)}${also}`
|
|
329
|
+
: m.item === 'nut' ? `${m.thread} ${m.nut.kind} nut` : m.item === 'washer' ? `${m.thread} washer` : form === 'unified' ? `${m.thread} x ${mm(m.length)} mm insert` : `${m.thread}x${mm(m.length)} insert`;
|
|
330
|
+
return m;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* A fixing from what a function was handed: its model as it is, or a name read with the caller's rule sets.
|
|
335
|
+
* @param {string} what the function asking, for its refusals @param {Fixing | string} m @param {{ sets?: object, anyLength?: boolean }} [o]
|
|
336
|
+
* @returns {Fixing}
|
|
337
|
+
*/
|
|
338
|
+
export function fixingOf(what, m, o = {}) {
|
|
339
|
+
if (typeof m === 'string') return fixingModel(m, {}, { sets: o?.sets, anyLength: o?.anyLength });
|
|
340
|
+
if (!m || m.kind !== 'fixing') throw new Error(`${what}: give a fixing's model (fixingModel) or its name ('M3', 'M3x12 cap'), not ${shown(m)}`);
|
|
341
|
+
return m;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// ---------- the printer ----------
|
|
345
|
+
const BASICS = ['hole_comp', 'fit', 'layer', 'line', 'chamfer', 'bridge', 'overhang', 'slip', 'press', 'thread_gap'];
|
|
346
|
+
/**
|
|
347
|
+
* @typedef {{ name: string, figure: (k: string) => (Figure & { name: string, borrowed?: boolean }) | null, n: (k: string) => number, cite: (k: string) => string, rest: (k: string) => object }} Printer
|
|
348
|
+
* figure: a rule of the printer's own (never borrowed); n: a basic clearance as a number, the printer's own or, where it
|
|
349
|
+
* has none, the X1C's; cite: the name that number is cited by
|
|
350
|
+
*/
|
|
351
|
+
/**
|
|
352
|
+
* The printer's rules as fixings reads them. Handed nothing, the kit's X1C. Handed a rule set ({ name, rules }), its
|
|
353
|
+
* figures with their kinds and sources. Handed plain numbers (a design's v.x1c), those, marked as given. A basic
|
|
354
|
+
* clearance the printer lacks (hole_comp, fit, layer, line, chamfer, bridge, overhang, slip, press, thread_gap) is borrowed from the X1C
|
|
355
|
+
* and cited as the X1C's; a measured figure (pilot_m3) is never borrowed, since it was measured on that machine.
|
|
356
|
+
* @param {string} what @param {object} [p] @returns {Printer}
|
|
357
|
+
*/
|
|
358
|
+
export function printerOf(what, p) {
|
|
359
|
+
let name = x1c.name, own = x1c.rules;
|
|
360
|
+
if (p != null) {
|
|
361
|
+
if (typeof p !== 'object' || Array.isArray(p)) throw new Error(`${what}: printer is the printer's rule set ({ name, rules }) or its values ({ hole_comp: 0.1, fit: 0.2, layer: 0.2 }), not ${shown(p)}`);
|
|
362
|
+
if (isSet(p)) { name = p.name ?? 'the printer'; own = p.rules; }
|
|
363
|
+
else { name = typeof p.name === 'string' ? p.name : 'the printer'; own = Object.fromEntries(Object.entries(p).filter(([, v]) => isNum(v)).map(([k, v]) => [k, { value: v, kind: 'given', source: 'the printer\'s values, handed in as plain numbers' }])); }
|
|
364
|
+
}
|
|
365
|
+
const sep = name === 'the printer' ? '\'s ' : '.';
|
|
366
|
+
const figure = (k) => (own[k] ? { ...own[k], name: `${name}${sep}${k}` } : null);
|
|
367
|
+
const basic = (k) => figure(k) ?? (BASICS.includes(k) ? { ...x1c.rules[k], name: `x1c.${k}`, borrowed: true } : null);
|
|
368
|
+
const n = (k) => {
|
|
369
|
+
const f = basic(k);
|
|
370
|
+
if (!f) throw new Error(`${what}: the printer (${name}) has no ${k}`);
|
|
371
|
+
if (!isNum(f.value) || f.value < 0) throw new Error(`${what}: ${f.name} is a number of 0 or more (got ${shown(f.value)}): hand in the printer's values worked out`);
|
|
372
|
+
return f.value;
|
|
373
|
+
};
|
|
374
|
+
return { name, figure, n, cite: (k) => basic(k)?.name ?? `${name}${sep}${k}`, rest: (k) => { const f = basic(k); return { ...rest(f.name, f), ...(f.borrowed ? { borrowed: true } : {}) }; } };
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** How much thread a screw needs in a material, in diameters: the engagement rule set's figures. */
|
|
378
|
+
export const ENGAGEMENT = engagementSet.rules;
|
|
379
|
+
/** Which engagement rule a material reads: steel, aluminium or plastic (anything not named a metal). */
|
|
380
|
+
export const engagementOf = (material) => { const k = String(material ?? 'plastic').toLowerCase(); return /steel|stainless|iron/.test(k) ? 'steel' : /^alu/.test(k) ? 'aluminium' : 'plastic'; };
|
|
381
|
+
|
|
382
|
+
/** A height rounded up to whole layers. */
|
|
383
|
+
export const layers = (h, layer) => r3(Math.ceil(h / layer - 1e-6) * layer);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulecad/fixings",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Screws, nuts, washers and inserts from rule sets, and the holes and seats they need in printed parts
|
|
3
|
+
"version": "0.1.3",
|
|
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": {
|
|
7
7
|
".": {
|
|
@@ -12,16 +12,47 @@
|
|
|
12
12
|
"types": "./fixings.d.mts",
|
|
13
13
|
"files": [
|
|
14
14
|
"fixings.mjs",
|
|
15
|
+
"model.mjs",
|
|
16
|
+
"holes.mjs",
|
|
17
|
+
"seats.mjs",
|
|
18
|
+
"hardware.mjs",
|
|
19
|
+
"threads.mjs",
|
|
20
|
+
"strength.mjs",
|
|
21
|
+
"draw.mjs",
|
|
15
22
|
"fixings.d.mts",
|
|
23
|
+
"model.d.mts",
|
|
24
|
+
"holes.d.mts",
|
|
25
|
+
"seats.d.mts",
|
|
26
|
+
"hardware.d.mts",
|
|
27
|
+
"threads.d.mts",
|
|
28
|
+
"strength.d.mts",
|
|
29
|
+
"draw.d.mts",
|
|
16
30
|
"README.md",
|
|
17
31
|
"LICENSE"
|
|
18
32
|
],
|
|
19
33
|
"license": "MIT",
|
|
20
34
|
"keywords": ["screws", "fasteners", "threads", "3d-printing", "jscad", "cad"],
|
|
21
|
-
"engines": {
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=20.10"
|
|
37
|
+
},
|
|
22
38
|
"sideEffects": false,
|
|
23
|
-
"repository": {
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/JoniBach/rulecad.git",
|
|
42
|
+
"directory": "packages/fixings"
|
|
43
|
+
},
|
|
24
44
|
"homepage": "https://github.com/JoniBach/rulecad/tree/main/packages/fixings#readme",
|
|
25
|
-
"bugs": {
|
|
26
|
-
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/JoniBach/rulecad/issues"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"test": "node --test"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"@jscad/modeling": "^2.12.0"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@rulecad/rules": "^0.3.11",
|
|
56
|
+
"@rulecad/shapes": "^0.4.4"
|
|
57
|
+
}
|
|
27
58
|
}
|