@rulecad/cad 0.7.37 → 0.7.40
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/EXAMPLES.md +423 -1
- package/README.md +14 -0
- package/bin/cad.mjs +31 -1
- package/lib/assembly.mjs +40 -11
- package/lib/design.mjs +4 -3
- package/lib/motors.mjs +265 -0
- package/lib/sandbox-hooks.mjs +2 -2
- package/lib/sandbox-run.mjs +2 -1
- package/lib/sandbox.mjs +1 -1
- package/lib/sheet.mjs +136 -0
- package/package.json +5 -4
- package/schemas/assembly.schema.json +6 -0
- package/schemas/rules.schema.json +3 -0
package/lib/sheet.mjs
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// Rule sets looked at: cad rules check holds every set to what makes it traceable, cad rules draw makes a dimension
|
|
2
|
+
// drawing from what a set says a part mounts by (so whoever read a datasheet can compare the two by eye), and cad
|
|
3
|
+
// rules draft pulls the figures out of a datasheet's text for a person to choose from. Nothing here writes a value
|
|
4
|
+
// the kit trusts: a draft is all "estimate" until someone has checked it.
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import zlib from 'node:zlib';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { checkRuleSet } from '@rulecad/variables';
|
|
10
|
+
import { RULE_DIRS } from './workspace.mjs';
|
|
11
|
+
|
|
12
|
+
const vocabularyFile = fileURLToPath(import.meta.resolve('@rulecad/rules/vocabulary.json'));
|
|
13
|
+
const readSet = (f) => JSON.parse(fs.readFileSync(f, 'utf8'));
|
|
14
|
+
export const vocabulary = () => readSet(vocabularyFile);
|
|
15
|
+
|
|
16
|
+
// Every set by name, a workspace's own copy before the published one
|
|
17
|
+
function allSets() {
|
|
18
|
+
const found = new Map();
|
|
19
|
+
for (const d of RULE_DIRS) if (fs.existsSync(d)) for (const f of fs.readdirSync(d).sort()) if (f.endsWith('.json') && !['package.json', 'vocabulary.json'].includes(f)) { const n = f.slice(0, -5); if (!found.has(n)) found.set(n, path.join(d, f)); }
|
|
20
|
+
return found;
|
|
21
|
+
}
|
|
22
|
+
function fileOf(name) {
|
|
23
|
+
const all = allSets(), file = all.get(name);
|
|
24
|
+
if (!file) throw new Error(`no rule set "${name}" (there are: ${[...all.keys()].join(', ')})`);
|
|
25
|
+
return file;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Every named set checked (or all of them): [{ name, file, findings }] */
|
|
29
|
+
export function checkSets(names = []) {
|
|
30
|
+
const v = vocabulary(), all = allSets();
|
|
31
|
+
return (names.length ? names.map((n) => [n, fileOf(n)]) : [...all]).map(([name, file]) => ({ name, file, findings: checkRuleSet(readSet(file), v) }));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// ---------- a dimension drawing ----------
|
|
35
|
+
const fig = (x) => String(+Number(x).toFixed(2));
|
|
36
|
+
const INK = '#1a1a1a', THIN = '#666', FILL = '#eceae4', METAL = '#c4c8cc';
|
|
37
|
+
|
|
38
|
+
/** @param {string} name the rule set's name @returns {string} an SVG drawing of what it says the part mounts by */
|
|
39
|
+
export function drawSet(name) { return drawing(readSet(fileOf(name)), vocabulary()); }
|
|
40
|
+
|
|
41
|
+
export function drawing(set, vocab) {
|
|
42
|
+
const get = (k) => { const r = set.rules[set.interface?.[k] ?? k]; return r?.value; }, n = (k, d = 0) => { const x = get(k); return typeof x === 'number' ? x : d; };
|
|
43
|
+
if (!set.part && !Object.keys(set.interface || {}).some((k) => k.startsWith('body_'))) throw new Error(`rule set "${set.name}" doesn't say what shape it is (no body_ names in it, or "part", or "interface"): there's nothing to draw`);
|
|
44
|
+
const shape = get('body_shape') ?? 'box', round = shape === 'round', w = round ? n('body_diameter') : n('body_width'), d = round ? w : shape === 'square' ? w : n('body_depth', n('body_width'));
|
|
45
|
+
const tabs = n('mount_tab_length'), off = n('boss_offset'), cx = tabs ? -off : 0, cy = tabs ? 0 : -off; // the body's centre, from the shaft
|
|
46
|
+
const spacing = n('mount_hole_spacing'), pattern = get('mount_pattern'), hole = n('mount_hole_diameter') || (parseFloat(String(get('mount_hole_thread') ?? '').slice(1)) || 2);
|
|
47
|
+
const holes = !spacing ? [] : pattern === 'square' ? [[-1, -1], [1, -1], [1, 1], [-1, 1]].map(([a, b]) => [cx + (a * spacing) / 2, cy + (b * spacing) / 2]) : [[cx - spacing / 2, cy], [cx + spacing / 2, cy]];
|
|
48
|
+
const earR = n('mount_ear_radius'), reach = Math.max(w / 2, d / 2, spacing / 2 + (earR || hole), tabs / 2) + 2, shaftD = n('shaft_diameter'), bossD = n('boss_diameter');
|
|
49
|
+
const L = n('body_length'), top = n('body_top'), bossH = n('boss_height'), shaftL = n('shaft_length'), flat = n('shaft_flat_length'), flats = n('shaft_flats'), across = n('shaft_flat_across');
|
|
50
|
+
// scaled so a small part fills the sheet as a large one does
|
|
51
|
+
const scale = 300 / (2 * reach + Math.max(L + top, shaftL + L, 10)) / 1.4, S = Math.max(3, Math.min(12, scale));
|
|
52
|
+
const W = 2 * reach * S + (L + Math.max(shaftL, top + bossH) + 8) * S + 200, H = Math.max(2 * reach * S + 150, 280);
|
|
53
|
+
const fx = reach * S + 70, fy = H / 2 + 8, X = (x) => fx + x * S, Y = (y) => fy - y * S; // the face view, shaft at the origin
|
|
54
|
+
const sx = fx + reach * S + 90 + L * S, SX = (z) => sx + z * S, SY = (y) => fy - y * S; // the side view: z along the sheet, the mounting face at z = 0
|
|
55
|
+
const out = [];
|
|
56
|
+
const line = (a, b, c, e, s = INK, sw = 1.2, dash = '') => out.push(`<line x1="${fig(a)}" y1="${fig(b)}" x2="${fig(c)}" y2="${fig(e)}" stroke="${s}" stroke-width="${sw}"${dash ? ` stroke-dasharray="${dash}"` : ''}/>`);
|
|
57
|
+
const circle = (x, y, r, fill = 'none', s = INK) => out.push(`<circle cx="${fig(x)}" cy="${fig(y)}" r="${fig(r)}" fill="${fill}" stroke="${s}" stroke-width="1.2"/>`);
|
|
58
|
+
const rect = (x, y, a, b, fill = FILL) => out.push(`<rect x="${fig(x)}" y="${fig(y)}" width="${fig(a)}" height="${fig(b)}" fill="${fill}" stroke="${INK}" stroke-width="1.2"/>`);
|
|
59
|
+
const text = (x, y, t, a = 'middle', z = 12) => out.push(`<text x="${fig(x)}" y="${fig(y)}" text-anchor="${a}" font-size="${z}" font-family="system-ui, sans-serif" fill="${INK}">${t}</text>`);
|
|
60
|
+
const span = (x1, y1, x2, y2, t, across_ = 14) => { // a dimension: extension lines, a line with its ticks, the figure
|
|
61
|
+
const horizontal = Math.abs(y2 - y1) < 1e-6, ox = horizontal ? 0 : across_, oy = horizontal ? across_ : 0;
|
|
62
|
+
line(x1, y1, x1 + ox, y1 + oy, THIN, 0.6); line(x2, y2, x2 + ox, y2 + oy, THIN, 0.6); line(x1 + ox, y1 + oy, x2 + ox, y2 + oy, THIN, 0.8);
|
|
63
|
+
for (const [a, b] of [[x1 + ox, y1 + oy], [x2 + ox, y2 + oy]]) line(a - 3, b + 3, a + 3, b - 3, THIN, 0.8);
|
|
64
|
+
if (horizontal) text((x1 + x2) / 2, y1 + oy + (across_ > 0 ? 13 : -4), t); else text(x1 + ox + (across_ > 0 ? 4 : -4), (y1 + y2) / 2 + 4, t, across_ > 0 ? 'start' : 'end');
|
|
65
|
+
};
|
|
66
|
+
// ---- the face, from the shaft's end ----
|
|
67
|
+
if (tabs) rect(X(cx - tabs / 2), Y(cy + d / 2), tabs * S, d * S, '#f6f4ee');
|
|
68
|
+
for (const [hx, hy] of earR ? holes : []) circle(X(hx), Y(hy), earR * S, '#f6f4ee');
|
|
69
|
+
if (shape === 'square') { const c = n('body_corner'), h = w / 2; const p = [[-h + c, -h], [h - c, -h], [h, -h + c], [h, h - c], [h - c, h], [-h + c, h], [-h, h - c], [-h, -h + c]].map(([a, b]) => `${fig(X(cx + a))},${fig(Y(cy + b))}`).join(' '); out.push(`<polygon points="${p}" fill="${FILL}" stroke="${INK}" stroke-width="1.2"/>`); }
|
|
70
|
+
else if (round) circle(X(cx), Y(cy), (w / 2) * S, FILL); else rect(X(cx - w / 2), Y(cy + d / 2), w * S, d * S);
|
|
71
|
+
if (bossD) circle(X(0), Y(0), (bossD / 2) * S, '#ddd9cf');
|
|
72
|
+
if (shaftD) circle(X(0), Y(0), (shaftD / 2) * S, METAL);
|
|
73
|
+
if (flats && across) { const a = flats === 2 ? across / 2 : across - shaftD / 2, c = Math.sqrt(Math.max(0, (shaftD / 2) ** 2 - a ** 2)); line(X(-c), Y(a), X(c), Y(a), INK, 1.4); if (flats === 2) line(X(-c), Y(-a), X(c), Y(-a), INK, 1.4); }
|
|
74
|
+
for (const [hx, hy] of holes) circle(X(hx), Y(hy), (hole / 2) * S, '#fff');
|
|
75
|
+
line(X(-reach), Y(0), X(reach), Y(0), THIN, 0.5, '8 3 2 3'); line(X(0), Y(-reach), X(0), Y(reach), THIN, 0.5, '8 3 2 3');
|
|
76
|
+
const bottom = Y(Math.min(cy - d / 2, -reach + 2)), topY = Y(Math.max(cy + d / 2, 0));
|
|
77
|
+
if (!round && !tabs) span(X(cx - w / 2), bottom, X(cx + w / 2), bottom, `${fig(w)}`, 18);
|
|
78
|
+
if (round) span(X(cx - w / 2), bottom, X(cx + w / 2), bottom, `Ø${fig(w)}`, 18);
|
|
79
|
+
if (tabs) span(X(cx - tabs / 2), bottom, X(cx + tabs / 2), bottom, `tabs ${fig(tabs)}`, 18);
|
|
80
|
+
if (spacing) span(X(holes[0][0]), bottom, X(holes[1][0]), bottom, `holes ${fig(spacing)}`, 40);
|
|
81
|
+
if (bossD) span(X(-bossD / 2), topY, X(bossD / 2), topY, `boss Ø${fig(bossD)}`, -14);
|
|
82
|
+
if (off) { text(X(reach), Y(reach) + 2, `shaft ${fig(off)} from centre`, 'end'); }
|
|
83
|
+
const thread = get('mount_hole_thread'), holeNote = thread ? `${holes.length} × ${thread}${n('mount_hole_depth') ? `, ${fig(n('mount_hole_depth'))} deep` : ''}` : hole ? `${holes.length} × Ø${fig(hole)}` : '';
|
|
84
|
+
if (holeNote) text(fx, bottom + 78, holeNote);
|
|
85
|
+
// ---- the side, shaft to the right ----
|
|
86
|
+
const halfH = (d / 2) * S;
|
|
87
|
+
if (L) rect(SX(-L), SY(cy + d / 2), L * S, d * S);
|
|
88
|
+
if (top) rect(SX(0), SY(cy + d / 2), top * S, d * S);
|
|
89
|
+
const bossAt = top; if (bossH) rect(SX(bossAt), SY(bossD / 2), bossH * S, bossD * S, '#ddd9cf');
|
|
90
|
+
if (shaftL) rect(SX(bossAt), SY(shaftD / 2), (shaftL + (top ? bossH : 0)) * S, shaftD * S, METAL);
|
|
91
|
+
if (flat) { const tip = bossAt + (top ? bossH : 0) + shaftL; const a = flats === 2 ? across / 2 : across - shaftD / 2; line(SX(tip - flat), SY(a), SX(tip), SY(a), INK, 1.2); if (flats === 2) line(SX(tip - flat), SY(-a), SX(tip), SY(-a), INK, 1.2); }
|
|
92
|
+
line(SX(0), SY(reach), SX(0), SY(-reach), THIN, 0.6, '4 3');
|
|
93
|
+
text(SX(0), SY(reach) - 6, 'mounting face', 'middle', 10);
|
|
94
|
+
const under = SY(cy - d / 2) + halfH * 0 + 6;
|
|
95
|
+
if (L) span(SX(-L), under, SX(0), under, `${fig(L)}`, 14);
|
|
96
|
+
if (shaftL) span(SX(top + (top ? bossH : 0)), under, SX(top + (top ? bossH : 0) + shaftL), under, `shaft ${fig(shaftL)}`, 36);
|
|
97
|
+
if (flat) span(SX(top + (top ? bossH : 0) + shaftL - flat), SY(shaftD / 2) - 4, SX(top + (top ? bossH : 0) + shaftL), SY(shaftD / 2) - 4, `flat ${fig(flat)}`, -14);
|
|
98
|
+
if (bossH) text(SX(bossAt + bossH / 2), under + 74, `boss ${fig(bossH)} high`, 'middle', 11);
|
|
99
|
+
// ---- what's trustworthy ----
|
|
100
|
+
const kinds = Object.values(set.rules).reduce((m, r) => ({ ...m, [r.kind]: (m[r.kind] || 0) + 1 }), {});
|
|
101
|
+
text(20, 26, set.name, 'start', 16);
|
|
102
|
+
text(20, 44, `all in mm. ${Object.entries(kinds).map(([k, c]) => `${c} ${k}`).join(', ')}: compare it with the datasheet`, 'start', 11);
|
|
103
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${fig(W)} ${fig(H + 60)}" width="${fig(W)}" height="${fig(H + 60)}"><rect width="100%" height="100%" fill="#fff"/>${out.join('')}</svg>\n`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ---------- a draft from a datasheet's text ----------
|
|
107
|
+
const UNITS = /(-?\d+(?:\.\d+)?)\s*(mm|N\s?m|N\.m|Ncm|N\.cm|kg\s?cm|kgf?\.?cm|V|A|mH|Ω|ohm|rpm|RPM|Hz|g|kg|°)(?![a-zA-Z])/g;
|
|
108
|
+
// Text drawn in a PDF: its streams unpacked, then the strings shown with Tj and TJ. A datasheet that is a picture has none.
|
|
109
|
+
export function pdfText(file) {
|
|
110
|
+
const raw = fs.readFileSync(file), latin = raw.toString('latin1'), lines = [];
|
|
111
|
+
for (const m of latin.matchAll(/stream\r?\n/g)) {
|
|
112
|
+
const start = m.index + m[0].length, end = latin.indexOf('endstream', start);
|
|
113
|
+
if (end < 0) continue;
|
|
114
|
+
const body = raw.subarray(start, end);
|
|
115
|
+
let s; try { s = zlib.inflateSync(body).toString('latin1'); } catch { s = body.toString('latin1'); }
|
|
116
|
+
if (!/\b(Tj|TJ)\b/.test(s)) continue;
|
|
117
|
+
for (const block of s.matchAll(/BT([\s\S]*?)ET/g)) {
|
|
118
|
+
const words = [...block[1].matchAll(/\[((?:[^\]\\]|\\.)*)\]\s*TJ|\(((?:[^()\\]|\\.)*)\)\s*Tj/g)].map((x) => (x[1] != null ? [...x[1].matchAll(/\(((?:[^()\\]|\\.)*)\)/g)].map((y) => y[1]).join('') : x[2]));
|
|
119
|
+
const t = words.join(' ').replace(/\\([()\\])/g, '$1').trim();
|
|
120
|
+
if (t) lines.push(t);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return lines;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Every figure a datasheet's text gives, as a rule set of estimates for a person to name and check. @returns {{ set: object, found: number }} */
|
|
127
|
+
export function draftSet(name, file) {
|
|
128
|
+
if (!fs.existsSync(file)) throw new Error(`no file ${file}`);
|
|
129
|
+
const lines = pdfText(file), rules = {}, stamp = new Date().toISOString().slice(0, 10), source = path.basename(file);
|
|
130
|
+
let i = 0;
|
|
131
|
+
for (const line of lines) for (const m of line.matchAll(UNITS)) {
|
|
132
|
+
i += 1;
|
|
133
|
+
rules[`figure_${String(i).padStart(3, '0')}`] = { value: Number(m[1]), unit: m[2], rule: `DRAFT: name and check me. From: "${line.slice(0, 120)}"`, kind: 'estimate', source, checked: stamp };
|
|
134
|
+
}
|
|
135
|
+
return { set: { _doc: `A draft from ${source}: rename each figure from vocabulary.json, delete the ones you don't want, and only then change its kind to spec.`, name, rules }, found: i };
|
|
136
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulecad/cad",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.40",
|
|
4
4
|
"description": "The cad command: JSCAD designs from traceable rules, checked for printing and fit, versioned by what fits, shared as links and exported as Bambu 3MF.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -57,20 +57,21 @@
|
|
|
57
57
|
"url": "https://github.com/JoniBach/rulecad/issues"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@rulecad/variables": "^0.3.
|
|
60
|
+
"@rulecad/variables": "^0.3.2",
|
|
61
61
|
"@rulecad/keyboard-layout": "^0.1.2",
|
|
62
62
|
"@rulecad/printcheck": "^0.3.0",
|
|
63
63
|
"@rulecad/fit": "^0.4.0",
|
|
64
64
|
"@rulecad/model-link": "^0.3.0",
|
|
65
65
|
"@rulecad/versions": "^0.1.0",
|
|
66
66
|
"@rulecad/shapes": "^0.4.1",
|
|
67
|
-
"@rulecad/rules": "^0.3.
|
|
67
|
+
"@rulecad/rules": "^0.3.6",
|
|
68
68
|
"@jscad/modeling": "^2.12.0",
|
|
69
69
|
"three": "^0.186.1",
|
|
70
70
|
"@rulecad/fea": "^0.2.1",
|
|
71
71
|
"@rulecad/topopt": "^0.3.0",
|
|
72
72
|
"@rulecad/flexures": "^0.5.0",
|
|
73
|
-
"@rulecad/gears": "^0.3.
|
|
73
|
+
"@rulecad/gears": "^0.3.2",
|
|
74
|
+
"@rulecad/motors": "^0.1.2"
|
|
74
75
|
},
|
|
75
76
|
"peerDependencies": {
|
|
76
77
|
"@rulecad/pcb": "^0.1.0 || ^0.2.0 || ^0.3.0 || ^0.4.0 || ^0.5.0"
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
"joints": { "type": "array", "items": { "$ref": "#/$defs/joint" } },
|
|
20
20
|
"loops": { "type": "array", "items": { "$ref": "#/$defs/loop" } },
|
|
21
21
|
"planetary": { "type": "array", "items": { "$ref": "#/$defs/planetary" } },
|
|
22
|
+
"gravity": { "$ref": "#/$defs/vec3", "description": "Which way down is, for masses in loads (default [0, 0, -1])" },
|
|
23
|
+
"loads": { "type": "array", "description": "What the assembly has to do: a torque (N m) or force (N) on a joint, or a mass (kg) carried at an anchor", "items": { "type": "object", "additionalProperties": false, "properties": { "joint": { "type": "string" }, "torque": { "$ref": "#/$defs/expr" }, "force": { "$ref": "#/$defs/expr" }, "mass": { "$ref": "#/$defs/expr" }, "at": { "$ref": "#/$defs/anchorRef" }, "note": { "type": "string" } } } },
|
|
22
24
|
"poses": { "type": "object", "description": "Named sets of joint values ({ \"hinge\": 90 }), and of items' variables (\"action.travel\": 25: a flexure drawn bent in that pose, printed as drawn)", "additionalProperties": { "type": "object", "additionalProperties": { "$ref": "#/$defs/values" } } },
|
|
23
25
|
"pose": { "type": "string" }
|
|
24
26
|
},
|
|
@@ -35,6 +37,7 @@
|
|
|
35
37
|
"id": { "type": "string" },
|
|
36
38
|
"object": { "type": "string" },
|
|
37
39
|
"assembly": { "type": "string" },
|
|
40
|
+
"motor": { "type": "object", "required": ["model"], "additionalProperties": false, "description": "A motor from @rulecad/motors: bought, not printed; its shaft turns the joint it drives", "properties": { "model": { "type": "string" }, "drives": { "type": "string" }, "set": { "type": "object", "description": "Figures that differ from the catalogue's, by name" }, "speed": { "$ref": "#/$defs/expr", "description": "The motor's speed, rpm (default: what it does comfortably)" }, "margin": { "$ref": "#/$defs/expr", "description": "How many times over the torque must be (default 2)" }, "duty": { "$ref": "#/$defs/expr", "description": "The share of the time it runs, 0 to 1 (default 1), for its heat" }, "screw": { "type": "string", "description": "The screws through a motor's plain holes, if not the size they take: M3" } } },
|
|
38
41
|
"variant": { "type": "string" },
|
|
39
42
|
"set": { "type": "object" },
|
|
40
43
|
"at": { "$ref": "#/$defs/vec3" },
|
|
@@ -66,6 +69,7 @@
|
|
|
66
69
|
"b": { "$ref": "#/$defs/names" },
|
|
67
70
|
"engage": { "$ref": "#/$defs/expr", "description": "a goes at least this far (mm) onto b along the joint between them: a part slid onto a shaft or a pin, not resting on its end" },
|
|
68
71
|
"radius": { "$ref": "#/$defs/expr", "description": "With engage: how near the joint's axis to look (mm, default 10)" },
|
|
72
|
+
"shaft": { "anyOf": [{ "type": "boolean" }, { "enum": ["slide", "press"] }], "description": "a or b is a motor, and the other takes its shaft: reads the bore from the part as drawn" },
|
|
69
73
|
"fastens": { "type": "boolean", "description": "a and b are fastened together (pins, screws, a press): what holds a part that has no joint" },
|
|
70
74
|
"min": { "$ref": "#/$defs/expr" },
|
|
71
75
|
"max": { "$ref": "#/$defs/expr" },
|
|
@@ -100,6 +104,7 @@
|
|
|
100
104
|
"min": { "$ref": "#/$defs/values" },
|
|
101
105
|
"max": { "$ref": "#/$defs/values" },
|
|
102
106
|
"value": { "$ref": "#/$defs/values" },
|
|
107
|
+
"brake": { "type": "string", "description": "What holds this joint with the power off (a ratchet, a detent): counted by motor.holds" },
|
|
103
108
|
"follow": { "type": "string" },
|
|
104
109
|
"ratio": { "$ref": "#/$defs/expr" },
|
|
105
110
|
"offset": { "$ref": "#/$defs/values" },
|
|
@@ -130,6 +135,7 @@
|
|
|
130
135
|
"required": ["sun", "carrier", "ring", "planets", "module", "teeth"],
|
|
131
136
|
"additionalProperties": false,
|
|
132
137
|
"properties": {
|
|
138
|
+
"output": { "type": "object", "required": ["ring", "planet", "teeth"], "additionalProperties": false, "description": "A compound planetary: a second ring, on the planets' second step", "properties": { "ring": { "type": "string" }, "planet": { "$ref": "#/$defs/expr" }, "teeth": { "$ref": "#/$defs/expr" } } },
|
|
133
139
|
"sun": { "type": "string" }, "carrier": { "type": "string" }, "ring": { "type": "string" },
|
|
134
140
|
"planets": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
135
141
|
"drive": { "enum": ["sun", "carrier", "ring"] },
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"description": { "type": "string" },
|
|
14
14
|
"licence": { "type": "string" },
|
|
15
15
|
"private": { "type": "boolean" },
|
|
16
|
+
"part": { "type": "string", "description": "What sort of part it describes (motor): its names come from vocabulary.json, and cad rules check holds it to them" },
|
|
17
|
+
"interface": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Which rule is which shared name in vocabulary.json, for a set that keeps its own names" },
|
|
18
|
+
"variants": { "type": "object", "description": "A maker's part numbers for this part, each the rules that differ: { \"17HS4401\": { \"kind\", \"source\", \"values\": { \"body_length\": 40 } } }" },
|
|
16
19
|
"footprints": { "type": "object" },
|
|
17
20
|
"circuit": { "type": "object", "description": "A published board's circuit (parts, pads, nets, planes, outline), read by cad clone, for @rulecad/pcb's clone()" },
|
|
18
21
|
"rules": {
|