@hatiolab/figure-model 0.5.0 → 0.5.2
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/dist/asset-types.d.ts +1 -1
- package/dist/asset-types.d.ts.map +1 -1
- package/dist/asset.d.ts.map +1 -1
- package/dist/asset.js +6 -5
- package/dist/asset.js.map +1 -1
- package/dist/authoring-actions.d.ts +2 -795
- package/dist/authoring-actions.d.ts.map +1 -1
- package/dist/authoring-actions.js +66 -3777
- package/dist/authoring-actions.js.map +1 -1
- package/dist/authoring-bindings.d.ts +35 -0
- package/dist/authoring-bindings.d.ts.map +1 -0
- package/dist/authoring-bindings.js +241 -0
- package/dist/authoring-bindings.js.map +1 -0
- package/dist/authoring-dimensions.d.ts +10 -0
- package/dist/authoring-dimensions.d.ts.map +1 -0
- package/dist/authoring-dimensions.js +88 -0
- package/dist/authoring-dimensions.js.map +1 -0
- package/dist/authoring-fastening.d.ts +24 -0
- package/dist/authoring-fastening.d.ts.map +1 -0
- package/dist/authoring-fastening.js +562 -0
- package/dist/authoring-fastening.js.map +1 -0
- package/dist/authoring-geometry.d.ts +119 -0
- package/dist/authoring-geometry.d.ts.map +1 -0
- package/dist/authoring-geometry.js +419 -0
- package/dist/authoring-geometry.js.map +1 -0
- package/dist/authoring-nodes.d.ts +77 -0
- package/dist/authoring-nodes.d.ts.map +1 -0
- package/dist/authoring-nodes.js +310 -0
- package/dist/authoring-nodes.js.map +1 -0
- package/dist/authoring-occupancy.d.ts +28 -0
- package/dist/authoring-occupancy.d.ts.map +1 -0
- package/dist/authoring-occupancy.js +784 -0
- package/dist/authoring-occupancy.js.map +1 -0
- package/dist/authoring-proportion.d.ts +27 -0
- package/dist/authoring-proportion.d.ts.map +1 -0
- package/dist/authoring-proportion.js +378 -0
- package/dist/authoring-proportion.js.map +1 -0
- package/dist/authoring-size.d.ts +17 -0
- package/dist/authoring-size.d.ts.map +1 -0
- package/dist/authoring-size.js +140 -0
- package/dist/authoring-size.js.map +1 -0
- package/dist/authoring-types.d.ts +753 -0
- package/dist/authoring-types.d.ts.map +1 -0
- package/dist/authoring-types.js +42 -0
- package/dist/authoring-types.js.map +1 -0
- package/dist/command-preview.d.ts +1 -1
- package/dist/command-preview.d.ts.map +1 -1
- package/dist/command-preview.js +1 -0
- package/dist/command-preview.js.map +1 -1
- package/dist/contract.d.ts +142 -3
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +1 -1
- package/dist/contract.js.map +1 -1
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +3 -0
- package/dist/cost.js.map +1 -1
- package/dist/create.d.ts +36 -0
- package/dist/create.d.ts.map +1 -1
- package/dist/create.js +60 -0
- package/dist/create.js.map +1 -1
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +4 -3
- package/dist/document.js.map +1 -1
- package/dist/editor-workspace.d.ts +3 -3
- package/dist/editor-workspace.d.ts.map +1 -1
- package/dist/examples.d.ts.map +1 -1
- package/dist/examples.js +3 -1
- package/dist/examples.js.map +1 -1
- package/dist/gate.d.ts.map +1 -1
- package/dist/gate.js +2 -0
- package/dist/gate.js.map +1 -1
- package/dist/graph-types.d.ts +3 -2
- package/dist/graph-types.d.ts.map +1 -1
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +13 -7
- package/dist/graph.js.map +1 -1
- package/dist/index.d.ts +10 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/joint-list.js +1 -1
- package/dist/joint-list.js.map +1 -1
- package/dist/joint-part-edits.d.ts +40 -0
- package/dist/joint-part-edits.d.ts.map +1 -0
- package/dist/joint-part-edits.js +488 -0
- package/dist/joint-part-edits.js.map +1 -0
- package/dist/joint-writing.d.ts +50 -0
- package/dist/joint-writing.d.ts.map +1 -0
- package/dist/joint-writing.js +847 -0
- package/dist/joint-writing.js.map +1 -0
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js +11 -8
- package/dist/json.js.map +1 -1
- package/dist/kernel-version.d.ts +1 -1
- package/dist/kernel-version.js +1 -1
- package/dist/package.d.ts +15 -3
- package/dist/package.d.ts.map +1 -1
- package/dist/package.js +58 -0
- package/dist/package.js.map +1 -1
- package/dist/part-edit.d.ts +1 -1
- package/dist/part-edit.d.ts.map +1 -1
- package/dist/part-edit.js +7 -4
- package/dist/part-edit.js.map +1 -1
- package/dist/proposal.d.ts +1 -1
- package/dist/proposal.d.ts.map +1 -1
- package/dist/proposal.js +5 -2
- package/dist/proposal.js.map +1 -1
- package/dist/render-batches.d.ts +10 -2
- package/dist/render-batches.d.ts.map +1 -1
- package/dist/render-batches.js +19 -5
- package/dist/render-batches.js.map +1 -1
- package/dist/resize-plan.d.ts +1 -1
- package/dist/resize-plan.d.ts.map +1 -1
- package/dist/robots.d.ts.map +1 -1
- package/dist/robots.js +3 -1
- package/dist/robots.js.map +1 -1
- package/dist/room.d.ts +1 -1
- package/dist/room.d.ts.map +1 -1
- package/dist/room.js +2 -1
- package/dist/room.js.map +1 -1
- package/dist/shape-edit.js +4 -4
- package/dist/shape-edit.js.map +1 -1
- package/dist/shape-ops.d.ts +62 -7
- package/dist/shape-ops.d.ts.map +1 -1
- package/dist/shape-ops.js +117 -8
- package/dist/shape-ops.js.map +1 -1
- package/dist/slot-layout-presets.d.ts +102 -0
- package/dist/slot-layout-presets.d.ts.map +1 -0
- package/dist/slot-layout-presets.js +185 -0
- package/dist/slot-layout-presets.js.map +1 -0
- package/dist/slot-layout.d.ts +16 -1
- package/dist/slot-layout.d.ts.map +1 -1
- package/dist/slot-layout.js.map +1 -1
- package/docs/modeller-interaction-performance-2026-10-07.md +40 -8
- package/docs/shape-contract.md +46 -0
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { FigureAsset } from './asset-types.ts';
|
|
2
|
+
import { type RemovalNotice } from './authoring-types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The records follow a part's new name -- as a joint's parent, as its child, and as the joint a follower follows -- and
|
|
5
|
+
* the nodes are made again from them. Nothing is frozen: a length that followed the part still follows it, and the
|
|
6
|
+
* stored design inputs keep their values under the carried names, so the figure stands as it did at every size.
|
|
7
|
+
*/
|
|
8
|
+
export declare function renameFigurePartInJoints(asset: FigureAsset, from: string, to: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* A copied part is fastened as the original is: its own record, the same faces and place, so it is not held by nodes
|
|
11
|
+
* no record makes. A moving joint gets its own control -- a copy is a second thing, not the original's shadow.
|
|
12
|
+
*/
|
|
13
|
+
export declare function copyFigurePartJoint(asset: FigureAsset, from: string, to: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* Before a part is taken away (chief architect's ruling 2026-09-27, replacing the refusals of 2026-09-25). What hung
|
|
16
|
+
* from it stays where it stood at rest -- every control at zero -- fastened to nothing: its joint, and the motion and
|
|
17
|
+
* control the joint gave it, go. A part that moved with its joint gets a control of its own, named after the part,
|
|
18
|
+
* over the leader's range put through the multiplier and offset, starting where it stood. A value that followed its
|
|
19
|
+
* size or place becomes the number it is now. One thing is refused, by name: a row laid along it, or hanging in it --
|
|
20
|
+
* a row is made from its record, and a record needs the part (ADR-0093).
|
|
21
|
+
*/
|
|
22
|
+
export declare function releaseFigurePartJoints(asset: FigureAsset, part: string, options?: {
|
|
23
|
+
spaceFittedAgain?: boolean;
|
|
24
|
+
}): RemovalNotice;
|
|
25
|
+
/**
|
|
26
|
+
* The nodes that make the declared space and nothing else: reached from what \`occupancy\` names, not from any drawn
|
|
27
|
+
* body, record or binding. Named by what they do, not by their names -- an older fitting named them \`occ.*\`
|
|
28
|
+
* (FORKLIFT), a still older one left some the declaration no longer reaches (WALL_LAMP), and a part's own chain the
|
|
29
|
+
* space also reads is the part's (2026-09-27).
|
|
30
|
+
*/
|
|
31
|
+
export declare function spaceOnlyNodesOf(asset: FigureAsset): Set<string>;
|
|
32
|
+
/**
|
|
33
|
+
* A node no drawn body, declaration or record reaches, reading a value that is gone: an earlier fitting's space left
|
|
34
|
+
* reading a joint's node that went with its part (WALL_LAMP's shade, 2026-09-27). It was read by nothing before, and it
|
|
35
|
+
* goes with what it read. A node something does reach is left, and the figure is refused as broken.
|
|
36
|
+
*/
|
|
37
|
+
export declare function dropDeadDanglers(asset: FigureAsset): void;
|
|
38
|
+
/** Every value a drawn body, a declaration or a record reaches, however far up. */
|
|
39
|
+
export declare function liveRefsOf(asset: FigureAsset): Set<string>;
|
|
40
|
+
//# sourceMappingURL=joint-part-edits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joint-part-edits.d.ts","sourceRoot":"","sources":["../src/joint-part-edits.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAA;AAyB7B;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CA+C3F;AAiCD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAkBtF;AAaD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,aAAa,CAwQf;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAwBhE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAuCzD;AAED,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAuB1D"}
|
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/*
|
|
5
|
+
* What the part edits (part-edit.ts) do to the joints: a part renamed, copied, or removed with what hangs from it.
|
|
6
|
+
*/
|
|
7
|
+
import { compileFigureGraph } from "./graph.js";
|
|
8
|
+
import { AXES } from "./words.js";
|
|
9
|
+
import { figureMimicLeadersOf, followedTermsOf } from "./authoring-types.js";
|
|
10
|
+
import { fail, nodeById, writerOf, partOf, namer, constantOf, stableDimension, ownInput, dropIfUnused, round6, stringsIn } from "./authoring-nodes.js";
|
|
11
|
+
import { eulerXYZ } from "./authoring-geometry.js";
|
|
12
|
+
import { stateIdOf, stripJoint, jointMeasures, mapMeasureSources, rewriteJoints } from "./joint-writing.js";
|
|
13
|
+
/*
|
|
14
|
+
* A part edit that renames or removes a part reads the joint records first: the records are the canon and the joint
|
|
15
|
+
* nodes are made from them (ADR-0093). Renaming or deleting a part in the graph alone left records naming a part that
|
|
16
|
+
* was no longer there, and the author could not save (TARGET_ABSENT on joints.*, 2026-09-25).
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* The records follow a part's new name -- as a joint's parent, as its child, and as the joint a follower follows -- and
|
|
20
|
+
* the nodes are made again from them. Nothing is frozen: a length that followed the part still follows it, and the
|
|
21
|
+
* stored design inputs keep their values under the carried names, so the figure stands as it did at every size.
|
|
22
|
+
*/
|
|
23
|
+
export function renameFigurePartInJoints(asset, from, to) {
|
|
24
|
+
const joints = asset.joints;
|
|
25
|
+
if (!joints?.length)
|
|
26
|
+
return;
|
|
27
|
+
const name = (id) => (id === from ? to : id);
|
|
28
|
+
/*
|
|
29
|
+
A joint's nodes carry its parent's name (`leg-2.on.top.*`); what reads them -- the space declared from the parts,
|
|
30
|
+
a size that follows a fastened place -- follows them to the new name (빈틈 H, 2026-09-25).
|
|
31
|
+
*/
|
|
32
|
+
const infix = `.on.${from}.`;
|
|
33
|
+
const carried = (value) => typeof value === 'string'
|
|
34
|
+
? value.includes(infix)
|
|
35
|
+
? value.split(infix).join(`.on.${to}.`)
|
|
36
|
+
: value
|
|
37
|
+
: Array.isArray(value)
|
|
38
|
+
? value.map(carried)
|
|
39
|
+
: value && typeof value === 'object'
|
|
40
|
+
? Object.fromEntries(Object.entries(value).map(([k, v]) => [k, carried(v)]))
|
|
41
|
+
: value;
|
|
42
|
+
const out = asset;
|
|
43
|
+
out.document = carried(out.document);
|
|
44
|
+
if (out.occupancy)
|
|
45
|
+
out.occupancy = carried(out.occupancy);
|
|
46
|
+
out.designInputs = Object.fromEntries(Object.entries(out.designInputs ?? {}).map(([k, v]) => [carried(k), v]));
|
|
47
|
+
/* A length that follows the part's measure follows it under its new name, in each term of a sum too. */
|
|
48
|
+
const source = (s) => s?.of === 'part' ? { ...s, part: name(s.part) } : s;
|
|
49
|
+
asset.joints = joints.map(was => {
|
|
50
|
+
const j = structuredClone(was);
|
|
51
|
+
for (const { get, set } of jointMeasures(j))
|
|
52
|
+
set(mapMeasureSources(get(), source));
|
|
53
|
+
return {
|
|
54
|
+
...j,
|
|
55
|
+
id: name(j.id),
|
|
56
|
+
body0: 'part' in j.body0 ? { ...j.body0, part: name(j.body0.part) } : j.body0,
|
|
57
|
+
body1: { ...j.body1, part: name(j.body1.part) },
|
|
58
|
+
...(j.mimic
|
|
59
|
+
? {
|
|
60
|
+
mimic: Object.hasOwn(j.mimic, 'sum')
|
|
61
|
+
? { ...j.mimic, sum: figureMimicLeadersOf(j).map(t => ({ ...t, joint: name(t.joint) })) }
|
|
62
|
+
: { ...j.mimic, joint: name(j.mimic.joint) }
|
|
63
|
+
}
|
|
64
|
+
: {}),
|
|
65
|
+
...(j.state?.id !== undefined ? { state: { ...j.state, id: name(j.state.id) } } : {})
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
rewriteJoints(asset);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* What reads a part that is to be taken away, said in the author's words: the space declared from the parts, another
|
|
72
|
+
* part's size or place that follows it. Taking it would leave them reading nothing (빈틈 H, 2026-09-25).
|
|
73
|
+
*/
|
|
74
|
+
/** `spaceFittedAgain`: the space is declared again once the part is gone, so its reading the part is no refusal. */
|
|
75
|
+
function refuseIfRead(asset, part, spaceFittedAgain = false) {
|
|
76
|
+
const m = asset.document.model;
|
|
77
|
+
const own = (id) => id === part || id.startsWith(`${part}.`);
|
|
78
|
+
const mine = new Set([
|
|
79
|
+
...m.nodes
|
|
80
|
+
.filter((n) => own(n.id))
|
|
81
|
+
.flatMap((n) => Object.values(n.outputs)),
|
|
82
|
+
...m.inputs.filter((i) => own(i.id)).map((i) => i.id),
|
|
83
|
+
...m.constants.filter((c) => own(c.id)).map((c) => c.id)
|
|
84
|
+
]);
|
|
85
|
+
const readsOf = (refs) => (n) => [...n.args, ...Object.values(n.params ?? {})].some((r) => typeof r === 'string' && refs.has(r));
|
|
86
|
+
const readers = m.nodes.filter((n) => !own(n.id) && readsOf(mine)(n));
|
|
87
|
+
const space = spaceOnlyNodesOf(asset);
|
|
88
|
+
if (!spaceFittedAgain &&
|
|
89
|
+
(readers.some((n) => space.has(n.id)) || stringsIn(asset.occupancy).some(r => mine.has(r))))
|
|
90
|
+
fail('PART_REFERENCED', part, `${part} is in the space the figure declares; declare the space again, or fit it to the parts, without it first`, { reason: 'in-declared-space', part });
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A copied part is fastened as the original is: its own record, the same faces and place, so it is not held by nodes
|
|
94
|
+
* no record makes. A moving joint gets its own control -- a copy is a second thing, not the original's shadow.
|
|
95
|
+
*/
|
|
96
|
+
export function copyFigurePartJoint(asset, from, to) {
|
|
97
|
+
const joints = (asset.joints ?? []);
|
|
98
|
+
const j = joints.find(o => o.body1.part === from);
|
|
99
|
+
if (!j)
|
|
100
|
+
return;
|
|
101
|
+
const m = asset.document.model;
|
|
102
|
+
const ids = new Set(joints.map(o => o.id));
|
|
103
|
+
const inputs = new Set(m.inputs.map((i) => i.id));
|
|
104
|
+
const fresh = (base, taken) => {
|
|
105
|
+
let id = base;
|
|
106
|
+
for (let n = 2; taken.has(id); n++)
|
|
107
|
+
id = `${base}-${n}`;
|
|
108
|
+
return id;
|
|
109
|
+
};
|
|
110
|
+
const id = fresh(j.id === from ? to : `${j.id}-copy`, ids);
|
|
111
|
+
const copy = { ...structuredClone(j), id, body1: { ...j.body1, part: to } };
|
|
112
|
+
if (j.type !== 'fixed' && !j.mimic)
|
|
113
|
+
copy.state = { ...(j.state ?? {}), id: fresh(j.state?.id ? `${j.state.id}-copy` : id, inputs) };
|
|
114
|
+
asset.joints = [...joints, copy];
|
|
115
|
+
rewriteJoints(asset);
|
|
116
|
+
}
|
|
117
|
+
/** The unit a value of this type is written in, as the graph keeps it (base units), or undefined for a pose and the rest. */
|
|
118
|
+
function baseUnitOf(type) {
|
|
119
|
+
const t = JSON.stringify(type);
|
|
120
|
+
if (t === '[1,0,0]')
|
|
121
|
+
return 'mm';
|
|
122
|
+
if (t === '[0,1,0]')
|
|
123
|
+
return 'rad';
|
|
124
|
+
if (t === '[0,0,1]')
|
|
125
|
+
return 's';
|
|
126
|
+
if (t === '[0,0,0]')
|
|
127
|
+
return 'ratio';
|
|
128
|
+
if (t === '{"kind":"count"}')
|
|
129
|
+
return 'count';
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Before a part is taken away (chief architect's ruling 2026-09-27, replacing the refusals of 2026-09-25). What hung
|
|
134
|
+
* from it stays where it stood at rest -- every control at zero -- fastened to nothing: its joint, and the motion and
|
|
135
|
+
* control the joint gave it, go. A part that moved with its joint gets a control of its own, named after the part,
|
|
136
|
+
* over the leader's range put through the multiplier and offset, starting where it stood. A value that followed its
|
|
137
|
+
* size or place becomes the number it is now. One thing is refused, by name: a row laid along it, or hanging in it --
|
|
138
|
+
* a row is made from its record, and a record needs the part (ADR-0093).
|
|
139
|
+
*/
|
|
140
|
+
export function releaseFigurePartJoints(asset, part, options = {}) {
|
|
141
|
+
const a = asset;
|
|
142
|
+
const m = a.document.model;
|
|
143
|
+
const notice = { released: [], fixed: [], controls: [] };
|
|
144
|
+
refuseIfRead(a, part, options.spaceFittedAgain);
|
|
145
|
+
let joints = (a.joints ?? []);
|
|
146
|
+
const rows = joints.filter(j => 'part' in j.body0 && j.body0.part === part && j.repeat).map(j => j.body1.part);
|
|
147
|
+
if (rows.length)
|
|
148
|
+
fail('PART_ROW', part, `${rows.join(', ')} ${rows.length > 1 ? 'are rows' : 'is a row'} laid along ${part}; fasten ${rows.length > 1 ? 'them' : 'it'} to another part, or make ${rows.length > 1 ? 'them' : 'it'} one part, first`, { reason: 'row-along', part, rows });
|
|
149
|
+
const own = joints.find(j => j.body1.part === part);
|
|
150
|
+
const children = joints.filter(j => 'part' in j.body0 && j.body0.part === part);
|
|
151
|
+
if (own?.repeat && children.length)
|
|
152
|
+
fail('PART_ROW', part, `${children.map(j => j.body1.part).join(', ')} ${children.length > 1 ? 'hang' : 'hangs'} in the row ${part}, on every copy; take ${children.length > 1 ? 'them' : 'it'} off first`, {
|
|
153
|
+
reason: 'hangs-in-row',
|
|
154
|
+
part,
|
|
155
|
+
parts: children.map(j => j.body1.part)
|
|
156
|
+
});
|
|
157
|
+
/*
|
|
158
|
+
Every number frozen below -- a follower's range and start, a measure that followed the part, a value read from it --
|
|
159
|
+
is evaluated at the asset's stored design inputs and state defaults: the figure as it is authored, so its placement
|
|
160
|
+
there is what it was. At another instance size the frozen numbers no longer follow.
|
|
161
|
+
*/
|
|
162
|
+
const inputs = (over = {}) => ({ ...a.designInputs, ...a.stateDefaults, ...over });
|
|
163
|
+
const controls = m.inputs.filter((i) => i.role === 'state');
|
|
164
|
+
const rest = Object.fromEntries(controls.map((i) => [i.id, Math.min(i.max, Math.max(i.min, 0))]));
|
|
165
|
+
const graph = compileFigureGraph(m);
|
|
166
|
+
const atRest = graph.evaluate(inputs(rest)).values;
|
|
167
|
+
const now = graph.evaluate(inputs()).values;
|
|
168
|
+
/* A part moving with a joint that goes: its own control, over what the leader's distance or angle came to. */
|
|
169
|
+
const going = new Set([...(own ? [own.id] : []), ...children.map(j => j.id)]);
|
|
170
|
+
/* A follower has no control of its own, so its own record's nominal id is not taken. */
|
|
171
|
+
const taken = new Set([...m.inputs.map((i) => i.id), ...joints.filter(j => !j.mimic).map(stateIdOf)]);
|
|
172
|
+
for (const f of joints.filter(o => figureMimicLeadersOf(o).some(t => going.has(t.joint)) && !going.has(o.id))) {
|
|
173
|
+
/*
|
|
174
|
+
A sum whose leaders all go is a control of its own over what the sum came to, as one leader's follower is. One
|
|
175
|
+
whose other leaders stay would follow them and stand still by the rest -- what it should then be is not said, so
|
|
176
|
+
it is refused by name rather than made up.
|
|
177
|
+
*/
|
|
178
|
+
const staying = figureMimicLeadersOf(f).filter(t => !going.has(t.joint));
|
|
179
|
+
if (staying.length)
|
|
180
|
+
fail('PART_FOLLOWED', part, `${f.id} follows ${staying.map(t => t.joint).join(', ')} as well as a joint that goes with ${part}; make ${f.id} follow only the joints that stay first`);
|
|
181
|
+
const terms = figureMimicLeadersOf(f).map(t => {
|
|
182
|
+
const leader = joints.find(o => o.id === t.joint);
|
|
183
|
+
const quantity = nodeById(m, `${leader.body1.part}.motion`)?.args[3] ?? stateIdOf(leader);
|
|
184
|
+
const state = m.inputs.find((i) => i.id === stateIdOf(leader));
|
|
185
|
+
const distance = (value) => Number(graph.evaluate(inputs({ [stateIdOf(leader)]: value })).values[quantity]);
|
|
186
|
+
const [a, b] = [distance(state?.min ?? 0) * t.multiplier, distance(state?.max ?? 1) * t.multiplier];
|
|
187
|
+
return { lo: Math.min(a, b), hi: Math.max(a, b), now: Number(now[quantity]) * t.multiplier };
|
|
188
|
+
});
|
|
189
|
+
const turn = f.type === 'revolute';
|
|
190
|
+
const toUnit = (base) => round6(turn ? (base * 180) / Math.PI : base);
|
|
191
|
+
const offset = (f.mimic.offset ?? 0) * (turn ? Math.PI / 180 : 1);
|
|
192
|
+
/*
|
|
193
|
+
Each leader moves on its own control, so the sum's least and greatest are each term's, added (a negative multiplier
|
|
194
|
+
swaps a term's ends, above). When leaders are driven by one upstream input -- not the case today, a leader leads
|
|
195
|
+
itself -- the summed range is conservative: it holds every value the sum can take, not the exact reach.
|
|
196
|
+
*/
|
|
197
|
+
const total = (pick) => toUnit(terms.reduce((sum, t, i) => (i ? sum + pick(t) : pick(t)), 0) + offset);
|
|
198
|
+
const [lo, hi] = [total(t => t.lo), total(t => t.hi)];
|
|
199
|
+
let id = f.body1.part;
|
|
200
|
+
for (let n = 2; taken.has(id); n++)
|
|
201
|
+
id = `${f.body1.part}-${n}`;
|
|
202
|
+
taken.add(id);
|
|
203
|
+
const start = Math.min(hi, Math.max(lo, total(t => t.now)));
|
|
204
|
+
const { mimic: _led, travel: _share, ...alone } = f;
|
|
205
|
+
joints = joints.map(o => o.id === f.id ? { ...alone, lowerLimit: lo, upperLimit: hi, state: { ...(f.state ?? {}), id, start } } : o);
|
|
206
|
+
notice.controls.push({ part: f.body1.part, control: id, min: lo, max: hi });
|
|
207
|
+
}
|
|
208
|
+
/*
|
|
209
|
+
A value in a record that followed the part: the number it is now -- at the stored design inputs (above). In a sum, each term that reads the part becomes
|
|
210
|
+
its number, added to the margin, and the terms that read something else still follow; no term left, the number.
|
|
211
|
+
*/
|
|
212
|
+
const freezeMeasure = (measure, where) => {
|
|
213
|
+
const f = followedTermsOf(measure);
|
|
214
|
+
if (!f || !f.terms.some(t => t.from?.of === 'part' && t.from.part === part))
|
|
215
|
+
return measure;
|
|
216
|
+
const probe = structuredClone(m);
|
|
217
|
+
let frozen = 0;
|
|
218
|
+
const rest = [];
|
|
219
|
+
for (const t of f.terms) {
|
|
220
|
+
if (!(t.from.of === 'part' && t.from.part === part)) {
|
|
221
|
+
rest.push(t);
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
const ref = stableDimension(probe, part, t.from.axis, where);
|
|
225
|
+
frozen += Number(compileFigureGraph(probe).evaluate(inputs()).values[ref]) * (t.times ?? 1);
|
|
226
|
+
}
|
|
227
|
+
if (!rest.length) {
|
|
228
|
+
const value = round6(frozen + f.plus);
|
|
229
|
+
notice.fixed.push({ part: where, value, unit: 'mm' });
|
|
230
|
+
return value;
|
|
231
|
+
}
|
|
232
|
+
notice.fixed.push({ part: where, value: round6(frozen), unit: 'mm' });
|
|
233
|
+
return { sum: rest, ...(round6(frozen + f.plus) ? { plus: round6(frozen + f.plus) } : {}) };
|
|
234
|
+
};
|
|
235
|
+
joints = joints.map(j => {
|
|
236
|
+
if (j.id === own?.id || children.includes(j))
|
|
237
|
+
return j;
|
|
238
|
+
const out = structuredClone(j);
|
|
239
|
+
for (const { get, set } of jointMeasures(out)) {
|
|
240
|
+
const was = get();
|
|
241
|
+
const fixed = freezeMeasure(was, j.body1.part);
|
|
242
|
+
if (fixed !== was)
|
|
243
|
+
set(fixed);
|
|
244
|
+
}
|
|
245
|
+
return out;
|
|
246
|
+
});
|
|
247
|
+
/*
|
|
248
|
+
What reads a value that goes -- where the part, or a part let go of, is fastened (its joint's nodes), or where it is
|
|
249
|
+
drawn -- and is not the space (fitted again, or refused above): the number it is now. Values the part shares with
|
|
250
|
+
another (a shape two placements draw) stay, as before; they do not go.
|
|
251
|
+
*/
|
|
252
|
+
const jointNodes = (p) => (n) => n.id.startsWith(`${p}.on.`) ||
|
|
253
|
+
n.id.startsWith(`${p}.row`) ||
|
|
254
|
+
[
|
|
255
|
+
`${p}.seat.rigid`,
|
|
256
|
+
`${p}.chain`,
|
|
257
|
+
`${p}.world`,
|
|
258
|
+
`${p}.turned`,
|
|
259
|
+
`${p}.motion`,
|
|
260
|
+
`${p}.layout`,
|
|
261
|
+
`${p}.assembly`,
|
|
262
|
+
`${p}.repeat`
|
|
263
|
+
].includes(n.id);
|
|
264
|
+
const leaving = [part, ...children.map(j => j.body1.part)];
|
|
265
|
+
const goingNodes = new Set(m.nodes.filter(n => leaving.some(p => jointNodes(p)(n))).map(n => n.id));
|
|
266
|
+
const goingRefs = new Set(m.nodes
|
|
267
|
+
.filter(n => goingNodes.has(n.id))
|
|
268
|
+
.flatMap(n => Object.values(n.outputs)));
|
|
269
|
+
const types = graph.outputTypes;
|
|
270
|
+
const live = liveRefsOf(a);
|
|
271
|
+
const space = spaceOnlyNodesOf(a);
|
|
272
|
+
const partOf = (id) => String(id).split('.')[0];
|
|
273
|
+
for (const n of m.nodes) {
|
|
274
|
+
/* The parts leaving are released below; a row's copies are gathered again from the records. */
|
|
275
|
+
if (goingNodes.has(n.id) ||
|
|
276
|
+
leaving.includes(partOf(n.id)) ||
|
|
277
|
+
n.op === 'assembly@1' ||
|
|
278
|
+
space.has(n.id) ||
|
|
279
|
+
!Object.values(n.outputs).some(o => live.has(o)))
|
|
280
|
+
continue;
|
|
281
|
+
/* A joint's own nodes are made again from its record, from where its parent stands then. */
|
|
282
|
+
if (joints.some(j => jointNodes(j.body1.part)(n)))
|
|
283
|
+
continue;
|
|
284
|
+
n.args = n.args.map((ref, i) => {
|
|
285
|
+
if (!goingRefs.has(ref))
|
|
286
|
+
return ref;
|
|
287
|
+
const unit = baseUnitOf(types[ref]);
|
|
288
|
+
const value = now[ref];
|
|
289
|
+
if (typeof value === 'number' && unit) {
|
|
290
|
+
notice.fixed.push({
|
|
291
|
+
part: partOf(n.id),
|
|
292
|
+
value: round6(unit === 'rad' ? (value * 180) / Math.PI : value),
|
|
293
|
+
unit: unit === 'rad' ? 'deg' : unit
|
|
294
|
+
});
|
|
295
|
+
return constantOf(m, unit, round6(value) + 0, 'fixed');
|
|
296
|
+
}
|
|
297
|
+
const pose = value;
|
|
298
|
+
const type = types[ref];
|
|
299
|
+
if (pose?.r && pose.t && type?.kind === 'transform') {
|
|
300
|
+
const id = namer(m, `${n.id}.fixed`)(`pose.${i}`);
|
|
301
|
+
const [rx, ry, rz] = eulerXYZ(pose.r);
|
|
302
|
+
m.nodes.push({
|
|
303
|
+
id,
|
|
304
|
+
op: 'rigid@1',
|
|
305
|
+
args: [
|
|
306
|
+
...pose.t.map(v => constantOf(m, 'mm', round6(v) + 0, 'fixed')),
|
|
307
|
+
...[rx, ry, rz].map(v => constantOf(m, 'rad', round6((v * Math.PI) / 180), 'fixed'))
|
|
308
|
+
],
|
|
309
|
+
outputs: { pose: `${id}.value` },
|
|
310
|
+
params: { from: type.from, to: type.to }
|
|
311
|
+
});
|
|
312
|
+
notice.fixed.push({ part: partOf(n.id), value: 0, unit: 'pose' });
|
|
313
|
+
return `${id}.value`;
|
|
314
|
+
}
|
|
315
|
+
fail('PART_REFERENCED', part, `${partOf(n.id)} reads ${part}'s ${ref}, which cannot be written as a number`);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
/* What hung from it: where it stood at rest, fastened to nothing. */
|
|
319
|
+
const standing = new Map(children.map(j => [j.body1.part, atRest[nodeById(m, j.body1.part).args[1]]]));
|
|
320
|
+
a.joints = joints.filter(j => j.id !== own?.id && !children.includes(j));
|
|
321
|
+
if (!a.joints.length)
|
|
322
|
+
delete a.joints;
|
|
323
|
+
for (const j of children) {
|
|
324
|
+
const child = j.body1.part;
|
|
325
|
+
const control = j.type !== 'fixed' && !j.mimic ? stateIdOf(j) : undefined;
|
|
326
|
+
stripJoint(a, j);
|
|
327
|
+
const at = standing.get(child);
|
|
328
|
+
const pose = nodeById(m, `${child}.pose`);
|
|
329
|
+
const turn = eulerXYZ(at.r);
|
|
330
|
+
const values = [...at.t.map(v => round6(v) + 0), ...turn];
|
|
331
|
+
const old = pose.args.slice(0, 6);
|
|
332
|
+
pose.args = [
|
|
333
|
+
...AXES.map(axis => `${child}.position.${axis}`),
|
|
334
|
+
...AXES.map(axis => `${child}.rotation.${axis}`)
|
|
335
|
+
].map((id, i) => {
|
|
336
|
+
if (!m.inputs.some((n) => n.id === id))
|
|
337
|
+
m.inputs.push({ id, unit: i < 3 ? 'mm' : 'deg', min: -Number.MAX_VALUE, max: Number.MAX_VALUE, role: 'design' });
|
|
338
|
+
a.designInputs[id] = values[i];
|
|
339
|
+
return id;
|
|
340
|
+
});
|
|
341
|
+
for (const ref of old)
|
|
342
|
+
if (!pose.args.includes(ref))
|
|
343
|
+
dropIfUnused(a, ref, ownInput(m, child, ref) ? ref : undefined);
|
|
344
|
+
notice.released.push({ part: child, ...(control ? { control } : {}) });
|
|
345
|
+
}
|
|
346
|
+
/*
|
|
347
|
+
A control goes with its joint once nothing reads it -- read only after every part is let go of: a lamp and the shade
|
|
348
|
+
that followed it, both released, left the lamp's control behind while the shade still read it (2026-09-27).
|
|
349
|
+
*/
|
|
350
|
+
const readAnywhere = (id) => m.nodes.some((n) => n.args.includes(id) || stringsIn(n.params).includes(id)) ||
|
|
351
|
+
stringsIn(a.occupancy).includes(id) ||
|
|
352
|
+
stringsIn(a.document.capabilities).includes(id);
|
|
353
|
+
for (const r of notice.released) {
|
|
354
|
+
if (!r.control)
|
|
355
|
+
continue;
|
|
356
|
+
if (readAnywhere(r.control)) {
|
|
357
|
+
delete r.control;
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
const id = r.control;
|
|
361
|
+
m.inputs = m.inputs.filter((i) => i.id !== id);
|
|
362
|
+
delete a.stateDefaults[id];
|
|
363
|
+
delete a.designInputs[id];
|
|
364
|
+
/* Its clip and its label go with it, as a motion's do (removeMotion). */
|
|
365
|
+
if (a.drivers)
|
|
366
|
+
a.drivers = a.drivers.filter((d) => d.state !== id);
|
|
367
|
+
if (a.drivers && !a.drivers.length)
|
|
368
|
+
delete a.drivers;
|
|
369
|
+
if (a.stateInputs?.[id]) {
|
|
370
|
+
const { [id]: _gone, ...rest } = a.stateInputs;
|
|
371
|
+
if (Object.keys(rest).length)
|
|
372
|
+
a.stateInputs = rest;
|
|
373
|
+
else
|
|
374
|
+
delete a.stateInputs;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (own)
|
|
378
|
+
stripJoint(a, own);
|
|
379
|
+
dropDeadDanglers(a);
|
|
380
|
+
if (a.joints?.length)
|
|
381
|
+
rewriteJoints(a);
|
|
382
|
+
return notice;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* The nodes that make the declared space and nothing else: reached from what \`occupancy\` names, not from any drawn
|
|
386
|
+
* body, record or binding. Named by what they do, not by their names -- an older fitting named them \`occ.*\`
|
|
387
|
+
* (FORKLIFT), a still older one left some the declaration no longer reaches (WALL_LAMP), and a part's own chain the
|
|
388
|
+
* space also reads is the part's (2026-09-27).
|
|
389
|
+
*/
|
|
390
|
+
export function spaceOnlyNodesOf(asset) {
|
|
391
|
+
const a = asset;
|
|
392
|
+
const m = a.document.model;
|
|
393
|
+
const reach = (from) => {
|
|
394
|
+
const seen = new Set();
|
|
395
|
+
for (const pending = [...from]; pending.length;) {
|
|
396
|
+
const writer = writerOf(m, pending.pop());
|
|
397
|
+
if (!writer || seen.has(writer.id))
|
|
398
|
+
continue;
|
|
399
|
+
seen.add(writer.id);
|
|
400
|
+
pending.push(...writer.args, ...stringsIn(writer.params));
|
|
401
|
+
}
|
|
402
|
+
return seen;
|
|
403
|
+
};
|
|
404
|
+
const drawn = reach([
|
|
405
|
+
...m.nodes
|
|
406
|
+
.filter((n) => n.op === 'place@1' || n.op === 'repeat@1')
|
|
407
|
+
.flatMap((n) => Object.values(n.outputs)),
|
|
408
|
+
...stringsIn(a.appearance),
|
|
409
|
+
...stringsIn(a.document.capabilities),
|
|
410
|
+
...stringsIn(a.drivers),
|
|
411
|
+
...stringsIn(a.publicInputs),
|
|
412
|
+
...stringsIn(a.joints)
|
|
413
|
+
]);
|
|
414
|
+
return new Set([...reach(stringsIn(a.occupancy))].filter(id => !drawn.has(id)));
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* A node no drawn body, declaration or record reaches, reading a value that is gone: an earlier fitting's space left
|
|
418
|
+
* reading a joint's node that went with its part (WALL_LAMP's shade, 2026-09-27). It was read by nothing before, and it
|
|
419
|
+
* goes with what it read. A node something does reach is left, and the figure is refused as broken.
|
|
420
|
+
*/
|
|
421
|
+
export function dropDeadDanglers(asset) {
|
|
422
|
+
const model = asset.document.model;
|
|
423
|
+
const strings = (v) => typeof v === 'string'
|
|
424
|
+
? [v]
|
|
425
|
+
: Array.isArray(v)
|
|
426
|
+
? v.flatMap(strings)
|
|
427
|
+
: v && typeof v === 'object'
|
|
428
|
+
? Object.values(v).flatMap(strings)
|
|
429
|
+
: [];
|
|
430
|
+
for (;;) {
|
|
431
|
+
const written = new Set([
|
|
432
|
+
...model.nodes.flatMap(n => Object.values(n.outputs)),
|
|
433
|
+
...model.inputs.map(i => i.id),
|
|
434
|
+
...model.constants.map(c => c.id)
|
|
435
|
+
]);
|
|
436
|
+
const live = new Set();
|
|
437
|
+
const pending = [
|
|
438
|
+
...model.nodes.filter(n => n.op === 'place@1' || n.op === 'repeat@1').flatMap(n => Object.values(n.outputs)),
|
|
439
|
+
...strings(asset.appearance),
|
|
440
|
+
...strings(asset.occupancy),
|
|
441
|
+
...strings(asset.document.capabilities),
|
|
442
|
+
...strings(asset.drivers),
|
|
443
|
+
...strings(asset.publicInputs),
|
|
444
|
+
...strings(asset.joints)
|
|
445
|
+
];
|
|
446
|
+
while (pending.length) {
|
|
447
|
+
const ref = pending.pop();
|
|
448
|
+
if (live.has(ref))
|
|
449
|
+
continue;
|
|
450
|
+
live.add(ref);
|
|
451
|
+
const writer = model.nodes.find(n => Object.values(n.outputs).includes(ref));
|
|
452
|
+
if (writer)
|
|
453
|
+
pending.push(...writer.args, ...strings(writer.params));
|
|
454
|
+
}
|
|
455
|
+
const dead = model.nodes.filter(n => n.args.some(a => !written.has(a)) && !Object.values(n.outputs).some(o => live.has(o)));
|
|
456
|
+
if (!dead.length)
|
|
457
|
+
return;
|
|
458
|
+
model.nodes = model.nodes.filter(n => !dead.includes(n));
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
/** Every value a drawn body, a declaration or a record reaches, however far up. */
|
|
462
|
+
export function liveRefsOf(asset) {
|
|
463
|
+
const a = asset;
|
|
464
|
+
const m = a.document.model;
|
|
465
|
+
const live = new Set();
|
|
466
|
+
const pending = [
|
|
467
|
+
...m.nodes
|
|
468
|
+
.filter((n) => n.op === 'place@1' || n.op === 'repeat@1')
|
|
469
|
+
.flatMap((n) => Object.values(n.outputs)),
|
|
470
|
+
...stringsIn(a.appearance),
|
|
471
|
+
...stringsIn(a.occupancy),
|
|
472
|
+
...stringsIn(a.document.capabilities),
|
|
473
|
+
...stringsIn(a.drivers),
|
|
474
|
+
...stringsIn(a.publicInputs),
|
|
475
|
+
...stringsIn(a.joints)
|
|
476
|
+
];
|
|
477
|
+
while (pending.length) {
|
|
478
|
+
const ref = pending.pop();
|
|
479
|
+
if (live.has(ref))
|
|
480
|
+
continue;
|
|
481
|
+
live.add(ref);
|
|
482
|
+
const writer = writerOf(m, ref);
|
|
483
|
+
if (writer)
|
|
484
|
+
pending.push(...writer.args, ...stringsIn(writer.params));
|
|
485
|
+
}
|
|
486
|
+
return live;
|
|
487
|
+
}
|
|
488
|
+
//# sourceMappingURL=joint-part-edits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joint-part-edits.js","sourceRoot":"","sources":["../src/joint-part-edits.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,OAAO,EAKL,oBAAoB,EACpB,eAAe,EAEhB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,UAAU,EACV,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,SAAS,EACV,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM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C,YAAY,CAAC;QAC5B,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;KACvB,CAAA;IACD,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAG,CAAA;QAC1B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAQ;QAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACb,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;QAC/B,IAAI,MAAM;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;IACvE,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { FigureAsset } from './asset-types.ts';
|
|
2
|
+
import { type FigureJoint, type FigureDimensionSource, type FigureMeasure, type FigureFaceRemap, type FigureAuthoringAction } from './authoring-types.ts';
|
|
3
|
+
type Dynamic = any;
|
|
4
|
+
/** What each part is fastened to, for a reader that wants the structure rather than the graph. */
|
|
5
|
+
export declare function figureAttachmentsOf(asset: FigureAsset): Record<string, string | null>;
|
|
6
|
+
/** The joint whose child is this part, if any. */
|
|
7
|
+
export declare function jointAbove(asset: Dynamic, part: string): FigureJoint | undefined;
|
|
8
|
+
export declare const stateIdOf: (j: FigureJoint) => string;
|
|
9
|
+
/** Take a joint's nodes away, leaving its child standing in the asset frame at the origin. */
|
|
10
|
+
export declare function stripJoint(asset: Dynamic, j: FigureJoint): void;
|
|
11
|
+
/**
|
|
12
|
+
* Every length a joint record holds that may follow something, read as a measure, with a way to write it back: the
|
|
13
|
+
* gap, a row's pitch, a slide's travel (its one-term form names the source `source`, and without one is `plus` mm)
|
|
14
|
+
* and each offset across the face. Renaming a part and taking one away read and write them all alike.
|
|
15
|
+
*/
|
|
16
|
+
export declare function jointMeasures(j: FigureJoint): Array<{
|
|
17
|
+
at: string;
|
|
18
|
+
get: () => FigureMeasure | undefined;
|
|
19
|
+
set: (v: FigureMeasure | undefined) => void;
|
|
20
|
+
}>;
|
|
21
|
+
/** The same measure with each term's source put through `to`, in the form it was written. */
|
|
22
|
+
export declare function mapMeasureSources(measure: FigureMeasure | undefined, to: (source: FigureDimensionSource) => FigureDimensionSource): FigureMeasure | undefined;
|
|
23
|
+
/** Every joint's nodes again, from the records: the ones below first away, then all written parents first. */
|
|
24
|
+
export declare function rewriteJoints(asset: Dynamic): void;
|
|
25
|
+
export declare function setJoint(asset: Dynamic, joint: FigureJoint): void;
|
|
26
|
+
/** The joint goes; its child keeps where it stands now, as plain position numbers. */
|
|
27
|
+
/**
|
|
28
|
+
* Where what refers to a face an edit takes away goes instead (ADR-0100 A8): a joint re-pointed to another face of
|
|
29
|
+
* the part, or let go where it stands (`detach`, a joint only); a named face moved to another face -- a capability
|
|
30
|
+
* hangs on it, so it is never let go. Applied before the edit, in the same command: one step of the history. The new
|
|
31
|
+
* faces must be the part's after the edit; `keepReferencedFaces` refuses one that is not.
|
|
32
|
+
*/
|
|
33
|
+
export declare function applyFaceRemap(asset: Dynamic, part: string, remap: FigureFaceRemap[] | undefined): void;
|
|
34
|
+
export declare function removeJoint(asset: Dynamic, id: string): void;
|
|
35
|
+
/** `attach` is the modeller's word for a fixed joint: the record says it, whatever joint was there keeps its id and motion. */
|
|
36
|
+
export declare function fastenAsJoint(asset: Dynamic, a: Extract<FigureAuthoringAction, {
|
|
37
|
+
kind: 'attach';
|
|
38
|
+
}>): void;
|
|
39
|
+
/**
|
|
40
|
+
* The records are the canon: made again from them, the joints' nodes must be the nodes the asset holds. An asset
|
|
41
|
+
* whose nodes or records were edited apart is refused, not quietly rebuilt (ADR-0093, chief architect's condition).
|
|
42
|
+
*/
|
|
43
|
+
export declare function checkFigureJoints(asset: FigureAsset): void;
|
|
44
|
+
export declare function setRepeat(asset: Dynamic, a: {
|
|
45
|
+
kind: 'set-repeat';
|
|
46
|
+
part: string;
|
|
47
|
+
pitch: number | FigureMeasure;
|
|
48
|
+
}): Dynamic;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=joint-writing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joint-writing.d.ts","sourceRoot":"","sources":["../src/joint-writing.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAQlB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAA;AA2C7B,KAAK,OAAO,GAAG,GAAG,CAAA;AAiGlB,kGAAkG;AAClG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAKrF;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEhF;AAED,eAAO,MAAM,SAAS,GAAI,GAAG,WAAW,WAAwB,CAAA;AA6bhE,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,QAexD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,CAAC,EAAE,WAAW,GACb,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAA;CAAE,CAAC,CA2C1G;AAED,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,EAAE,EAAE,CA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