@hatiolab/figure-model 0.5.0 → 0.5.1
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 +129 -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 +3 -3
- 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,77 @@
|
|
|
1
|
+
import { type FigureRefusalDetails } from './contract.ts';
|
|
2
|
+
import type { Axis } from './words.ts';
|
|
3
|
+
import type { FigureAsset } from './asset-types.ts';
|
|
4
|
+
import { type FigureDimensionSource, type FigureMeasure, type FigureMeasureTerm } from './authoring-types.ts';
|
|
5
|
+
type Dynamic = any;
|
|
6
|
+
export declare const fail: (code: string, path: string, message: string, details?: FigureRefusalDetails) => never;
|
|
7
|
+
export declare const clone: (asset: FigureAsset) => Dynamic;
|
|
8
|
+
export declare const nodeById: (m: Dynamic, id: string) => any;
|
|
9
|
+
export declare const writerOf: (m: Dynamic, ref: string) => any;
|
|
10
|
+
/** A part an authoring command can work with, and the pieces of it those commands need. */
|
|
11
|
+
/** The part whose row carries this one -- fastened to it, however far down -- or undefined. */
|
|
12
|
+
export declare function rowHolding(m: Dynamic, id: string): string | undefined;
|
|
13
|
+
export declare function partOf(m: Dynamic, id: string, path: string): {
|
|
14
|
+
place: any;
|
|
15
|
+
shape: any;
|
|
16
|
+
pose: any;
|
|
17
|
+
};
|
|
18
|
+
/** Fresh node ids under a part, so two commands never claim one id. */
|
|
19
|
+
export declare function namer(m: Dynamic, prefix: string): (hint: string) => string;
|
|
20
|
+
/** A constant, reusing one that already holds the same number in the same unit. */
|
|
21
|
+
export declare function constantOf(m: Dynamic, unit: string, value: number, hint: string): string;
|
|
22
|
+
/** value = ref × times + plus, written as nodes, and folded away when there is nothing to do. */
|
|
23
|
+
export declare function scaled(m: Dynamic, name: (hint: string) => string, ref: string, times: number, plus: number, hint: string): string;
|
|
24
|
+
/** A measure as one graph reference: a constant, or the source it follows times a multiple plus a margin. */
|
|
25
|
+
export declare function measureRef(m: Dynamic, asset: Dynamic, name: (hint: string) => string, measure: FigureMeasure | undefined, hint: string, path: string): string;
|
|
26
|
+
/** Each term of a followed length as a graph reference and its multiple, every one checked as a one-term length is. */
|
|
27
|
+
export declare function termRefs(m: Dynamic, asset: Dynamic, terms: FigureMeasureTerm[], plus: number, path: string): Array<{
|
|
28
|
+
ref: string;
|
|
29
|
+
k: number;
|
|
30
|
+
}>;
|
|
31
|
+
/** Σ k·ref, written as nodes, with nothing emitted for a weight of zero and no node for a single term. */
|
|
32
|
+
export declare function sumOf(m: Dynamic, name: (hint: string) => string, terms: Array<{
|
|
33
|
+
ref: string;
|
|
34
|
+
k: number;
|
|
35
|
+
}>, hint: string): string;
|
|
36
|
+
/** The size one axis reads once the figure grows by one ratio: u times its authored size (`scaleUniformly`). */
|
|
37
|
+
export declare function uniformSizeOf(m: Dynamic, axis: Axis, path: string): string;
|
|
38
|
+
export declare function sourceRef(m: Dynamic, asset: Dynamic, source: FigureDimensionSource, path: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* The name of a part's dimension, which stays the same name however that dimension is later worked out.
|
|
41
|
+
*
|
|
42
|
+
* "B is as wide as A" has to keep meaning that when A is told to follow something else. Reading A's shape
|
|
43
|
+
* argument at the moment of linking gave B whatever A happened to read then — A's own control — so relinking A
|
|
44
|
+
* left B on the old value (designer's counterexample 2026-09-23: A went to 300 and B stayed at 100). Every
|
|
45
|
+
* dimension a command touches gets a node of its own, `<part>.dimension.<axis>`, and that is what the shape
|
|
46
|
+
* reads and what anything following it reads. Relinking rewrites what that node computes, and everyone pointing
|
|
47
|
+
* at it comes along — fastenings included, since they measure the same references.
|
|
48
|
+
*/
|
|
49
|
+
export declare function stableDimension(m: Dynamic, part: string, axis: Axis, path: string): string;
|
|
50
|
+
/** What a part's dimension is worked out from right now: the first argument of its own dimension node. */
|
|
51
|
+
export declare const dimensionSource: (m: Dynamic, part: string, axis: Axis) => any;
|
|
52
|
+
/** Whether this side of the part already follows something, rather than reading its own control. */
|
|
53
|
+
/**
|
|
54
|
+
* A part's own number for a dimension: a design input named under the part. `addFigureBox` names it `<part>.size.<axis>`,
|
|
55
|
+
* the editor's shape palette `<part>.dimension.width` (and height, depth); both are the part's own, and a dimension
|
|
56
|
+
* read from one follows nothing. Reading only the first name made a palette box look linked as soon as any command
|
|
57
|
+
* had routed its dimension, and a link was refused as a replacement (2026-09-24, :3300).
|
|
58
|
+
*/
|
|
59
|
+
export declare const ownInput: (m: Dynamic, part: string, ref: string | undefined) => any;
|
|
60
|
+
export declare const followsAlready: (m: Dynamic, part: string, axis: Axis) => boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Remove a value nothing reads any more, and whatever fed only it. An input is removed only when it is the one
|
|
63
|
+
* this command owns — the part's own dimension control. A shared input, such as the instance's size, stays even
|
|
64
|
+
* when the command that stopped reading it was the last reader: it is the author's, not this command's.
|
|
65
|
+
*/
|
|
66
|
+
export declare const declaredIn: (asset: Dynamic) => Set<string>;
|
|
67
|
+
/** Writes the joints again (`write`) with the names the declarations read held for `asset`, and lets them go after. */
|
|
68
|
+
export declare function holdingDeclared(asset: Dynamic, write: () => void): void;
|
|
69
|
+
export declare function dropIfUnused(asset: Dynamic, ref: string, ownedInput?: string): void;
|
|
70
|
+
/** Which part each part is fastened to, read from the frames rather than from a second record of it. */
|
|
71
|
+
export declare function parentOf(m: Dynamic, id: string): string | null;
|
|
72
|
+
export declare const round6: (v: number) => number;
|
|
73
|
+
export declare const sizeInputOf: (m: Dynamic, axis: Axis) => any;
|
|
74
|
+
/** Every string inside a declaration -- the references it may hold, with its names and labels (which name nothing). */
|
|
75
|
+
export declare const stringsIn: (value: unknown) => string[];
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=authoring-nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-nodes.d.ts","sourceRoot":"","sources":["../src/authoring-nodes.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,eAAe,CAAA;AAC9E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAEvB,MAAM,sBAAsB,CAAA;AAE7B,KAAK,OAAO,GAAG,GAAG,CAAA;AAClB,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,SAAS,MAAM,EAAE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;;;;GAIG;AAEH,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,gBACwE,CAAA;AAejH,uHAAuH;AACvH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAQvE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAgCnF;AAED,wGAAwG;AACxG,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO9D;AAED,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,WAA8B,CAAA;AAE9D,eAAO,MAAM,WAAW,GAAI,GAAG,OAAO,EAAE,MAAM,IAAI,QACyB,CAAA;AAE3E,uHAAuH;AACvH,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,MAAM,EAShD,CAAA"}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/*
|
|
5
|
+
* The graph helpers every authoring command shares: finding a node, naming a new one, writing a constant or a sum,
|
|
6
|
+
* and removing what nothing reads any more.
|
|
7
|
+
*/
|
|
8
|
+
import { figureShapeDescriptionOf } from "./shape-ops.js";
|
|
9
|
+
import { FigureContractError } from "./contract.js";
|
|
10
|
+
import { FIGURE_INSTANCE_SIZE_INPUTS } from "./instance-size.js";
|
|
11
|
+
import { followedTermsOf } from "./authoring-types.js";
|
|
12
|
+
export const fail = (code, path, message, details) => {
|
|
13
|
+
throw new FigureContractError(code, path, message, details);
|
|
14
|
+
};
|
|
15
|
+
export const clone = (asset) => structuredClone(asset);
|
|
16
|
+
export const nodeById = (m, id) => m.nodes.find((n) => n.id === id);
|
|
17
|
+
export const writerOf = (m, ref) => m.nodes.find((n) => Object.values(n.outputs).includes(ref));
|
|
18
|
+
/** A part an authoring command can work with, and the pieces of it those commands need. */
|
|
19
|
+
/** The part whose row carries this one -- fastened to it, however far down -- or undefined. */
|
|
20
|
+
export function rowHolding(m, id) {
|
|
21
|
+
const place = nodeById(m, id);
|
|
22
|
+
if (place?.op !== 'member@1' || nodeById(m, `${id}.repeat`))
|
|
23
|
+
return undefined;
|
|
24
|
+
const assembly = m.nodes.find((n) => n.op === 'assembly@1' && n.args.includes(place.outputs.placed));
|
|
25
|
+
return assembly ? String(assembly.id).replace(/\.assembly$/, '') : undefined;
|
|
26
|
+
}
|
|
27
|
+
export function partOf(m, id, path) {
|
|
28
|
+
const place = nodeById(m, id);
|
|
29
|
+
/* A row's template is the part too: it is placed through its row (`repeatPart`). */
|
|
30
|
+
const rowTemplate = place?.op === 'member@1' && (!!nodeById(m, `${id}.repeat`) || rowHolding(m, id) !== undefined);
|
|
31
|
+
if (!place || (place.op !== 'place@1' && !rowTemplate))
|
|
32
|
+
fail('TARGET_ABSENT', path, `${id} is not a placed part`);
|
|
33
|
+
const shape = writerOf(m, place.args[0]);
|
|
34
|
+
if (!shape)
|
|
35
|
+
fail('TARGET_ABSENT', path, `${id} has no shape`);
|
|
36
|
+
const pose = nodeById(m, `${id}.pose`);
|
|
37
|
+
if (!pose || pose.op !== 'rigid@1')
|
|
38
|
+
fail('EDIT_TARGET', path, `${id} is not posed by a rigid@1 this command can read`);
|
|
39
|
+
return { place, shape, pose };
|
|
40
|
+
}
|
|
41
|
+
/** Fresh node ids under a part, so two commands never claim one id. */
|
|
42
|
+
export function namer(m, prefix) {
|
|
43
|
+
const taken = new Set([
|
|
44
|
+
...m.nodes.map((n) => n.id),
|
|
45
|
+
...m.nodes.flatMap((n) => Object.values(n.outputs)),
|
|
46
|
+
...m.constants.map((c) => c.id),
|
|
47
|
+
...m.inputs.map((i) => i.id)
|
|
48
|
+
]);
|
|
49
|
+
return (hint) => {
|
|
50
|
+
let id = `${prefix}.${hint}`;
|
|
51
|
+
for (let k = 2; taken.has(id) || taken.has(`${id}.value`); k++)
|
|
52
|
+
id = `${prefix}.${hint}.${k}`;
|
|
53
|
+
taken.add(id);
|
|
54
|
+
taken.add(`${id}.value`);
|
|
55
|
+
return id;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** A constant, reusing one that already holds the same number in the same unit. */
|
|
59
|
+
export function constantOf(m, unit, value, hint) {
|
|
60
|
+
const found = m.constants.find((c) => c.unit === unit && c.value === value);
|
|
61
|
+
if (found)
|
|
62
|
+
return found.id;
|
|
63
|
+
const id = `${hint}.${unit}.${String(value).replace(/[^0-9a-zA-Z]/g, '_')}`;
|
|
64
|
+
m.constants.push({ id, unit, value });
|
|
65
|
+
return id;
|
|
66
|
+
}
|
|
67
|
+
/** value = ref × times + plus, written as nodes, and folded away when there is nothing to do. */
|
|
68
|
+
export function scaled(m, name, ref, times, plus, hint) {
|
|
69
|
+
let out = ref;
|
|
70
|
+
if (times !== 1) {
|
|
71
|
+
const id = name(`${hint}.times`);
|
|
72
|
+
m.nodes.push({
|
|
73
|
+
id,
|
|
74
|
+
op: 'mul@1',
|
|
75
|
+
args: [out, constantOf(m, 'ratio', times, 'k')],
|
|
76
|
+
outputs: { value: `${id}.value` }
|
|
77
|
+
});
|
|
78
|
+
out = `${id}.value`;
|
|
79
|
+
}
|
|
80
|
+
if (plus !== 0) {
|
|
81
|
+
const id = name(`${hint}.plus`);
|
|
82
|
+
m.nodes.push({ id, op: 'add@1', args: [out, constantOf(m, 'mm', plus, 'd')], outputs: { value: `${id}.value` } });
|
|
83
|
+
out = `${id}.value`;
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
/** A measure as one graph reference: a constant, or the source it follows times a multiple plus a margin. */
|
|
88
|
+
export function measureRef(m, asset, name, measure, hint, path) {
|
|
89
|
+
if (measure === undefined)
|
|
90
|
+
return constantOf(m, 'mm', 0, 'd');
|
|
91
|
+
if (typeof measure === 'number') {
|
|
92
|
+
if (!Number.isFinite(measure))
|
|
93
|
+
fail('SCHEMA', path, 'a finite length is required');
|
|
94
|
+
return constantOf(m, 'mm', measure, 'd');
|
|
95
|
+
}
|
|
96
|
+
if (!measure || typeof measure !== 'object' || !(Object.hasOwn(measure, 'sum') || measure.from))
|
|
97
|
+
fail('SCHEMA', path, 'a length is a number of millimetres, or something to follow');
|
|
98
|
+
const { terms, plus, sum } = followedTermsOf(measure);
|
|
99
|
+
const refs = termRefs(m, asset, terms, plus, path);
|
|
100
|
+
/* One term is written as it always was; a sum adds its terms, then the margin (the same add@1 and mul@1 nodes). */
|
|
101
|
+
if (!sum)
|
|
102
|
+
return scaled(m, name, refs[0].ref, refs[0].k, plus, hint);
|
|
103
|
+
return scaled(m, name, sumOf(m, name, refs, `${hint}.sum`), 1, plus, hint);
|
|
104
|
+
}
|
|
105
|
+
/** Each term of a followed length as a graph reference and its multiple, every one checked as a one-term length is. */
|
|
106
|
+
export function termRefs(m, asset, terms, plus, path) {
|
|
107
|
+
if (!Array.isArray(terms) || !terms.length)
|
|
108
|
+
fail('SCHEMA', path, 'a sum has one term or more');
|
|
109
|
+
if (!Number.isFinite(plus))
|
|
110
|
+
fail('SCHEMA', path, 'finite times and plus required');
|
|
111
|
+
return terms.map((t, i) => {
|
|
112
|
+
const at = terms.length > 1 ? `${path}.sum.${i}` : path;
|
|
113
|
+
if (!t || typeof t !== 'object' || !t.from)
|
|
114
|
+
fail('SCHEMA', at, 'a length is a number of millimetres, or something to follow');
|
|
115
|
+
if (!Number.isFinite(t.times ?? 1))
|
|
116
|
+
fail('SCHEMA', at, 'finite times and plus required');
|
|
117
|
+
return { ref: sourceRef(m, asset, t.from, at), k: t.times ?? 1 };
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/** Σ k·ref, written as nodes, with nothing emitted for a weight of zero and no node for a single term. */
|
|
121
|
+
export function sumOf(m, name, terms, hint) {
|
|
122
|
+
const live = terms.filter(t => t.k !== 0);
|
|
123
|
+
if (!live.length)
|
|
124
|
+
return constantOf(m, 'mm', 0, 'd');
|
|
125
|
+
let out = '';
|
|
126
|
+
for (const [i, t] of live.entries()) {
|
|
127
|
+
const piece = scaled(m, name, t.ref, t.k, 0, `${hint}.${i}`);
|
|
128
|
+
if (!out)
|
|
129
|
+
out = piece;
|
|
130
|
+
else {
|
|
131
|
+
const id = name(`${hint}.${i}.sum`);
|
|
132
|
+
m.nodes.push({ id, op: 'add@1', args: [out, piece], outputs: { value: `${id}.value` } });
|
|
133
|
+
out = `${id}.value`;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return out;
|
|
137
|
+
}
|
|
138
|
+
/** The size one axis reads once the figure grows by one ratio: u times its authored size (`scaleUniformly`). */
|
|
139
|
+
export function uniformSizeOf(m, axis, path) {
|
|
140
|
+
const node = nodeById(m, `sizing.size.${axis}`);
|
|
141
|
+
if (!node)
|
|
142
|
+
fail('TARGET_ABSENT', path, `the figure grows by one ratio but has no sizing.size.${axis}`);
|
|
143
|
+
return node.outputs.value;
|
|
144
|
+
}
|
|
145
|
+
export function sourceRef(m, asset, source, path) {
|
|
146
|
+
if (!source || typeof source !== 'object')
|
|
147
|
+
fail('SCHEMA', path, 'a dimension source is required');
|
|
148
|
+
if (source.of === 'instance') {
|
|
149
|
+
const id = `size.${source.axis}`;
|
|
150
|
+
if (!m.inputs.some((i) => i.id === id))
|
|
151
|
+
fail('TARGET_ABSENT', path, `the instance has no ${id}; declare it before following it`);
|
|
152
|
+
/* A figure that grows by one ratio is read at that ratio's size: a link made after it had read the raw size. */
|
|
153
|
+
return asset.sizing === 'uniform' ? uniformSizeOf(m, source.axis, path) : id;
|
|
154
|
+
}
|
|
155
|
+
if (source.of === 'input') {
|
|
156
|
+
const input = m.inputs.find((i) => i.id === source.input);
|
|
157
|
+
if (!input)
|
|
158
|
+
fail('TARGET_ABSENT', path, `${source.input} is not an input of this asset`);
|
|
159
|
+
if (input.role === 'state')
|
|
160
|
+
fail('EDIT_TARGET', path, `${source.input} is a state input; a dimension that follows state is a different declaration`);
|
|
161
|
+
return source.input;
|
|
162
|
+
}
|
|
163
|
+
if (source.of === 'part')
|
|
164
|
+
return stableDimension(m, source.part, source.axis, path);
|
|
165
|
+
return fail('SCHEMA', path, `${String(source.of)} is not a dimension source`);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The name of a part's dimension, which stays the same name however that dimension is later worked out.
|
|
169
|
+
*
|
|
170
|
+
* "B is as wide as A" has to keep meaning that when A is told to follow something else. Reading A's shape
|
|
171
|
+
* argument at the moment of linking gave B whatever A happened to read then — A's own control — so relinking A
|
|
172
|
+
* left B on the old value (designer's counterexample 2026-09-23: A went to 300 and B stayed at 100). Every
|
|
173
|
+
* dimension a command touches gets a node of its own, `<part>.dimension.<axis>`, and that is what the shape
|
|
174
|
+
* reads and what anything following it reads. Relinking rewrites what that node computes, and everyone pointing
|
|
175
|
+
* at it comes along — fastenings included, since they measure the same references.
|
|
176
|
+
*/
|
|
177
|
+
export function stableDimension(m, part, axis, path) {
|
|
178
|
+
const shape = partOf(m, part, path).shape;
|
|
179
|
+
const described = figureShapeDescriptionOf(shape);
|
|
180
|
+
if (described) {
|
|
181
|
+
const e = described.edit[axis];
|
|
182
|
+
if ('refused' in e)
|
|
183
|
+
return fail('EDIT_TARGET', path, `${part} is a drawn section; its measures are its points, which no measure can follow`);
|
|
184
|
+
/* An axis whose argument is another axis's value (a circle's two radii) is that axis's dimension. */
|
|
185
|
+
if (e.sameAs)
|
|
186
|
+
return stableDimension(m, part, e.sameAs, path);
|
|
187
|
+
const id = `${part}.dimension.${axis}`;
|
|
188
|
+
const ref = `${id}.value`;
|
|
189
|
+
if (nodeById(m, id))
|
|
190
|
+
return ref;
|
|
191
|
+
const was = shape.args[e.arg];
|
|
192
|
+
const one = constantOf(m, 'ratio', 1, 'k');
|
|
193
|
+
m.nodes.push({ id, op: 'mul@1', args: [was, one], outputs: { value: ref } });
|
|
194
|
+
/* Every argument that is this value goes with it, and so does a start written from this length (a centred push). */
|
|
195
|
+
shape.args = shape.args.map((r) => (r === was ? ref : r));
|
|
196
|
+
const start = nodeById(m, `${part}.start`);
|
|
197
|
+
if (start)
|
|
198
|
+
start.args = start.args.map((r) => (r === was ? ref : r));
|
|
199
|
+
return ref;
|
|
200
|
+
}
|
|
201
|
+
return fail('EDIT_TARGET', path, `${part} is a ${shape.op}; it is not a shape with measures`);
|
|
202
|
+
}
|
|
203
|
+
/** What a part's dimension is worked out from right now: the first argument of its own dimension node. */
|
|
204
|
+
export const dimensionSource = (m, part, axis) => nodeById(m, `${part}.dimension.${axis}`)?.args?.[0];
|
|
205
|
+
/** Whether this side of the part already follows something, rather than reading its own control. */
|
|
206
|
+
/**
|
|
207
|
+
* A part's own number for a dimension: a design input named under the part. `addFigureBox` names it `<part>.size.<axis>`,
|
|
208
|
+
* the editor's shape palette `<part>.dimension.width` (and height, depth); both are the part's own, and a dimension
|
|
209
|
+
* read from one follows nothing. Reading only the first name made a palette box look linked as soon as any command
|
|
210
|
+
* had routed its dimension, and a link was refused as a replacement (2026-09-24, :3300).
|
|
211
|
+
*/
|
|
212
|
+
export const ownInput = (m, part, ref) => !!ref && ref.startsWith(`${part}.`) && m.inputs.some((i) => i.id === ref && i.role === 'design');
|
|
213
|
+
export const followsAlready = (m, part, axis) => {
|
|
214
|
+
const from = dimensionSource(m, part, axis);
|
|
215
|
+
return from !== undefined && !ownInput(m, part, from);
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Remove a value nothing reads any more, and whatever fed only it. An input is removed only when it is the one
|
|
219
|
+
* this command owns — the part's own dimension control. A shared input, such as the instance's size, stays even
|
|
220
|
+
* when the command that stopped reading it was the last reader: it is the author's, not this command's.
|
|
221
|
+
*/
|
|
222
|
+
/* The names the declared room, the capabilities and the joint records read. */
|
|
223
|
+
export const declaredIn = (asset) => new Set([...stringsIn(asset.occupancy), ...stringsIn(asset.document.capabilities), ...stringsIn(asset.joints)]);
|
|
224
|
+
/*
|
|
225
|
+
Held while the joints are written again (rewriteJoints): the writing does not change what the declarations read, and
|
|
226
|
+
gathering them for each of its calls here was most of the joint check (2,412 calls for 201 joints, 2026-10-10). Under
|
|
227
|
+
test every use is held against the names gathered afresh.
|
|
228
|
+
*/
|
|
229
|
+
let held;
|
|
230
|
+
const CHECK_HELD = (() => {
|
|
231
|
+
try {
|
|
232
|
+
return process.env.FIGURE_FREEZE_COMPILED === '1';
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
})();
|
|
238
|
+
/** Writes the joints again (`write`) with the names the declarations read held for `asset`, and lets them go after. */
|
|
239
|
+
export function holdingDeclared(asset, write) {
|
|
240
|
+
const before = held;
|
|
241
|
+
held = { asset, declared: declaredIn(asset) };
|
|
242
|
+
try {
|
|
243
|
+
write();
|
|
244
|
+
}
|
|
245
|
+
finally {
|
|
246
|
+
held = before;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
export function dropIfUnused(asset, ref, ownedInput) {
|
|
250
|
+
const m = asset.document.model;
|
|
251
|
+
/* The graph, the declared room, the face it is mounted on and the places things are held all read values. */
|
|
252
|
+
// Joint records are consumers too. Their generated nodes are temporarily removed
|
|
253
|
+
// during a rewrite; alignment inputs must survive until those nodes are rebuilt.
|
|
254
|
+
const kept = held && held.asset === asset ? held.declared : undefined;
|
|
255
|
+
const declared = kept ?? declaredIn(asset);
|
|
256
|
+
if (kept && CHECK_HELD) {
|
|
257
|
+
const fresh = declaredIn(asset);
|
|
258
|
+
if (fresh.size !== kept.size || [...fresh].some(x => !kept.has(x)))
|
|
259
|
+
throw new Error(`the names held for the joint rewrite went stale at ${ref}`);
|
|
260
|
+
}
|
|
261
|
+
const referenced = (r) => m.nodes.some((n) => n.args.includes(r) || Object.values(n.params ?? {}).includes(r)) || declared.has(r);
|
|
262
|
+
if (referenced(ref))
|
|
263
|
+
return;
|
|
264
|
+
const input = m.inputs.findIndex((i) => i.id === ref);
|
|
265
|
+
if (input >= 0) {
|
|
266
|
+
if (ref !== ownedInput)
|
|
267
|
+
return;
|
|
268
|
+
m.inputs.splice(input, 1);
|
|
269
|
+
delete asset.designInputs[ref];
|
|
270
|
+
delete asset.stateDefaults[ref];
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const writer = writerOf(m, ref);
|
|
274
|
+
if (!writer ||
|
|
275
|
+
writer.op === 'place@1' ||
|
|
276
|
+
Object.values(writer.outputs).some((r) => r !== ref && referenced(r)))
|
|
277
|
+
return;
|
|
278
|
+
m.nodes = m.nodes.filter((n) => n !== writer);
|
|
279
|
+
for (const arg of writer.args)
|
|
280
|
+
dropIfUnused(asset, arg);
|
|
281
|
+
}
|
|
282
|
+
/** Which part each part is fastened to, read from the frames rather than from a second record of it. */
|
|
283
|
+
export function parentOf(m, id) {
|
|
284
|
+
/* A row's template has no chain of its own -- its copies are composed by the row -- but it is fastened all the same. */
|
|
285
|
+
if (!nodeById(m, `${id}.chain`) && !nodeById(m, `${id}.repeat`))
|
|
286
|
+
return null;
|
|
287
|
+
// The seat rigid carries the part into the frame it is fastened to, moving or not (an old asset may have only a motion).
|
|
288
|
+
const above = nodeById(m, `${id}.seat.rigid`) ?? nodeById(m, `${id}.motion`);
|
|
289
|
+
const match = /^(.*)\.local$/.exec(String(above?.params?.to));
|
|
290
|
+
return match && match[1] !== id ? match[1] : null;
|
|
291
|
+
}
|
|
292
|
+
export const round6 = (v) => Math.round(v * 1e6) / 1e6;
|
|
293
|
+
export const sizeInputOf = (m, axis) => m.inputs.find((i) => i.id === FIGURE_INSTANCE_SIZE_INPUTS[axis]);
|
|
294
|
+
/** Every string inside a declaration -- the references it may hold, with its names and labels (which name nothing). */
|
|
295
|
+
export const stringsIn = (value) => {
|
|
296
|
+
const out = [];
|
|
297
|
+
const walk = (v) => {
|
|
298
|
+
if (typeof v === 'string')
|
|
299
|
+
out.push(v);
|
|
300
|
+
else if (Array.isArray(v))
|
|
301
|
+
for (const one of v)
|
|
302
|
+
walk(one);
|
|
303
|
+
else if (v && typeof v === 'object')
|
|
304
|
+
for (const one of Object.values(v))
|
|
305
|
+
walk(one);
|
|
306
|
+
};
|
|
307
|
+
walk(value);
|
|
308
|
+
return out;
|
|
309
|
+
};
|
|
310
|
+
//# sourceMappingURL=authoring-nodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-nodes.js","sourceRoot":"","sources":["../src/authoring-nodes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAA6B,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAE9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAEhE,OAAO,EAIL,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAG7B,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,OAAe,EAAE,OAA8B,EAAS,EAAE;IACzG,MAAM,IAAI,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAC7D,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAkB,EAAW,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;AAC5E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAE,EAAU,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AAC7F,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAE,GAAW,EAAE,EAAE,CAClD,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAiC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAA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;IACxB,MAAM,IAAI,GAAG,CAAC,CAAU,EAAQ,EAAE;QAChC,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;aACjC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,KAAK,MAAM,GAAG,IAAI,CAAC;gBAAE,IAAI,CAAC,GAAG,CAAC,CAAA;aACpD,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;gBAAE,IAAI,CAAC,GAAG,CAAC,CAAA;IACpF,CAAC,CAAA;IACD,IAAI,CAAC,KAAK,CAAC,CAAA;IACX,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type FigureAsset, type FigurePlacement } from './asset-types.ts';
|
|
2
|
+
import { type FigureFace, type FigureAuthoringAction, type FigureOccupancyProposal } from './authoring-types.ts';
|
|
3
|
+
type Dynamic = any;
|
|
4
|
+
/** What the parts come to, and what a person is being asked to confirm. Reads the asset; changes nothing. */
|
|
5
|
+
export declare function proposeFigureOccupancy(asset: FigureAsset, options?: {
|
|
6
|
+
over?: 'rest' | 'range';
|
|
7
|
+
}): FigureOccupancyProposal;
|
|
8
|
+
/**
|
|
9
|
+
* The placement says which plane the mounting plane is. A part already fastened to it by a face the new plane does not
|
|
10
|
+
* take -- a bottom on the floor, when the figure is to hang on a wall -- is named, not seated again without a word
|
|
11
|
+
* (chief architect's condition, 2026-09-25): fasten it again by the face the new plane takes.
|
|
12
|
+
*/
|
|
13
|
+
export declare function setPlacement(asset: Dynamic, a: {
|
|
14
|
+
kind: 'set-placement';
|
|
15
|
+
placement: FigurePlacement;
|
|
16
|
+
}): Dynamic;
|
|
17
|
+
export declare function declareOccupancy(asset: Dynamic, a: Extract<FigureAuthoringAction, {
|
|
18
|
+
kind: 'declare-occupancy';
|
|
19
|
+
}>): Dynamic;
|
|
20
|
+
/** "This face is what the figure is mounted on." Kept apart from how much room the figure takes up. */
|
|
21
|
+
export declare function setMountingFace(asset: Dynamic, a: {
|
|
22
|
+
kind: 'set-mounting-face';
|
|
23
|
+
part: string;
|
|
24
|
+
face: FigureFace;
|
|
25
|
+
}): Dynamic;
|
|
26
|
+
export declare function clearMountingFace(asset: Dynamic): Dynamic;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=authoring-occupancy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-occupancy.d.ts","sourceRoot":"","sources":["../src/authoring-occupancy.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAqB,MAAM,kBAAkB,CAAA;AAC5F,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAA;AA6B7B,KAAK,OAAO,GAAG,GAAG,CAAA;AAkmBlB,6GAA6G;AAC7G,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,EAClB,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAO,GACxC,uBAAuB,CA6BzB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAAE,GAAG,OAAO,CAqB9G;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,CAAC,EAAE,OAAO,CAAC,qBAAqB,EAAE;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC,GAC/D,OAAO,CAoFT;AAED,uGAAuG;AACvG,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,CAAC,EAAE;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAC/D,OAAO,CAwBT;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIzD"}
|