@hatiolab/figure-model 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asset-types.d.ts +6 -0
- package/dist/asset-types.d.ts.map +1 -1
- package/dist/asset-types.js.map +1 -1
- package/dist/authoring-actions.d.ts +39 -0
- package/dist/authoring-actions.d.ts.map +1 -1
- package/dist/authoring-actions.js +116 -8
- package/dist/authoring-actions.js.map +1 -1
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +88 -11
- package/dist/capabilities.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/kernel-version.d.ts +1 -1
- package/dist/kernel-version.js +1 -1
- package/dist/proposal.d.ts +1 -1
- package/dist/proposal.d.ts.map +1 -1
- package/dist/proposal.js +8 -0
- package/dist/proposal.js.map +1 -1
- package/dist/release-contract.d.ts +1 -1
- package/dist/release-contract.d.ts.map +1 -1
- package/dist/release-contract.js +76 -4
- package/dist/release-contract.js.map +1 -1
- package/dist/slot-layout.d.ts +257 -0
- package/dist/slot-layout.d.ts.map +1 -0
- package/dist/slot-layout.js +480 -0
- package/dist/slot-layout.js.map +1 -0
- package/dist/slot-places.d.ts +55 -0
- package/dist/slot-places.d.ts.map +1 -0
- package/dist/slot-places.js +45 -0
- package/dist/slot-places.js.map +1 -0
- package/docs/modeller-interaction-performance-2026-10-07.md +60 -0
- package/package.json +2 -1
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Slot layouts (ADR-0118): a holder's anchors, the tiers placed on them, the slots of each tier, how slots are numbered,
|
|
3
|
+
* where an item sits in a slot, and whether it fits. Pure computation; nothing here knows a scene, a graph or a component.
|
|
4
|
+
*
|
|
5
|
+
* holder → anchor → tier → slot → item
|
|
6
|
+
*
|
|
7
|
+
* An anchor is a frame the holder gives: a position and a direction, and whatever moves it (a fork, a lift). The holder
|
|
8
|
+
* decides how many anchors there are; nothing here makes one. A tier is a group of slots placed on one anchor -- a shelf
|
|
9
|
+
* level, the load area of one fork. Several tiers may share an anchor, at the same height or not. A slot is one place an
|
|
10
|
+
* item is put; its address is (tier, slot). Tier numbers are the holder's own and slot numbers the tier's own: positive,
|
|
11
|
+
* unique, kept as they are when tiers or slots are removed or shown in another order -- never renumbered by height or
|
|
12
|
+
* position. ROW and GRID slots are not stored: they are worked out from the rule, so thousands of slots are one rule. A
|
|
13
|
+
* slot's id is `t{tier}_s{slot}` -- a logical id, not the name of a node in any 3D asset.
|
|
14
|
+
*
|
|
15
|
+
* Where an item is, each part said once:
|
|
16
|
+
* item in the world = holder × anchor × tier × slot × seat
|
|
17
|
+
* The anchor's frame is the holder's to give. Here a tier is placed in its anchor's frame (position, turn about the
|
|
18
|
+
* anchor's Y), a slot in its tier's (offset in X and Z, turn about Y), and an item in its slot (stack height, scale).
|
|
19
|
+
* Lengths are in whatever unit the layout is written in; nothing here converts them. Rotations are in degrees about Y.
|
|
20
|
+
*/
|
|
21
|
+
export function layoutIssue(code, path, params) {
|
|
22
|
+
return params ? { code, path, params } : { code, path };
|
|
23
|
+
}
|
|
24
|
+
/** The anchor at the holder's own origin, for a holder that gives no other. */
|
|
25
|
+
export const HOLDER_ANCHOR = 'holder';
|
|
26
|
+
/* ── checking a layout ───────────────────────────────────────────────────── */
|
|
27
|
+
const isFiniteNumber = (v) => typeof v === 'number' && Number.isFinite(v);
|
|
28
|
+
const isPositive = (v) => isFiniteNumber(v) && v > 0;
|
|
29
|
+
const isPositiveInt = (v) => Number.isSafeInteger(v) && v > 0;
|
|
30
|
+
function checkSpec(spec, path, issues) {
|
|
31
|
+
const a = spec?.allowed;
|
|
32
|
+
if (!a || typeof a !== 'object')
|
|
33
|
+
issues.push(layoutIssue('OBJECT_REQUIRED', `${path}.allowed`));
|
|
34
|
+
else
|
|
35
|
+
for (const k of ['width', 'depth', 'height'])
|
|
36
|
+
if (!isPositive(a[k]))
|
|
37
|
+
issues.push(layoutIssue('POSITIVE_NUMBER_REQUIRED', `${path}.allowed.${k}`));
|
|
38
|
+
if (spec?.stackLimit !== undefined && !isPositiveInt(spec.stackLimit) && spec.stackLimit !== Infinity)
|
|
39
|
+
issues.push(layoutIssue('POSITIVE_INTEGER_REQUIRED', `${path}.stackLimit`));
|
|
40
|
+
if (spec?.rotation !== undefined && !isFiniteNumber(spec.rotation))
|
|
41
|
+
issues.push(layoutIssue('FINITE_NUMBER_REQUIRED', `${path}.rotation`));
|
|
42
|
+
if (spec?.accepts !== undefined && !Array.isArray(spec.accepts))
|
|
43
|
+
issues.push(layoutIssue('ARRAY_REQUIRED', `${path}.accepts`));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Everything wrong with a layout; an empty list is a sound one. stackLimit may be Infinity (no limit); a layout that is
|
|
47
|
+
* to be stored as JSON is also checked with `persistenceIssues`.
|
|
48
|
+
*/
|
|
49
|
+
export function validateSlotLayout(layout, options = {}) {
|
|
50
|
+
const issues = [];
|
|
51
|
+
if (!layout || !Array.isArray(layout.tiers) || layout.tiers.length === 0)
|
|
52
|
+
return [layoutIssue('TIERS_REQUIRED', 'tiers')];
|
|
53
|
+
const anchors = options.anchors ? new Set(options.anchors) : null;
|
|
54
|
+
const tierNos = new Set();
|
|
55
|
+
layout.tiers.forEach((tier, i) => {
|
|
56
|
+
const path = `tiers[${i}]`;
|
|
57
|
+
if (!tier || typeof tier !== 'object') {
|
|
58
|
+
issues.push(layoutIssue('OBJECT_REQUIRED', path));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (!isPositiveInt(tier.tierNo))
|
|
62
|
+
issues.push(layoutIssue('POSITIVE_INTEGER_REQUIRED', `${path}.tierNo`));
|
|
63
|
+
else if (tierNos.has(tier.tierNo))
|
|
64
|
+
issues.push(layoutIssue('TIER_NUMBER_DUPLICATE', `${path}.tierNo`, { tierNo: tier.tierNo }));
|
|
65
|
+
else
|
|
66
|
+
tierNos.add(tier.tierNo);
|
|
67
|
+
if (typeof tier.anchorId !== 'string' || !tier.anchorId.trim())
|
|
68
|
+
issues.push(layoutIssue('ANCHOR_REQUIRED', `${path}.anchorId`));
|
|
69
|
+
else if (anchors && !anchors.has(tier.anchorId))
|
|
70
|
+
issues.push(layoutIssue('ANCHOR_UNKNOWN', `${path}.anchorId`, { anchorId: tier.anchorId }));
|
|
71
|
+
if (!['ON', 'IN', 'HANG'].includes(tier.mount))
|
|
72
|
+
issues.push(layoutIssue('MOUNT_INVALID', `${path}.mount`));
|
|
73
|
+
if (!tier.position || typeof tier.position !== 'object')
|
|
74
|
+
issues.push(layoutIssue('OBJECT_REQUIRED', `${path}.position`));
|
|
75
|
+
else
|
|
76
|
+
for (const k of ['x', 'y', 'z'])
|
|
77
|
+
if (!isFiniteNumber(tier.position[k]))
|
|
78
|
+
issues.push(layoutIssue('FINITE_NUMBER_REQUIRED', `${path}.position.${k}`));
|
|
79
|
+
if (!isFiniteNumber(tier.rotation))
|
|
80
|
+
issues.push(layoutIssue('FINITE_NUMBER_REQUIRED', `${path}.rotation`));
|
|
81
|
+
const l = tier.layout;
|
|
82
|
+
switch (l?.pattern) {
|
|
83
|
+
case 'SINGLE':
|
|
84
|
+
checkSpec(l.slot, `${path}.layout.slot`, issues);
|
|
85
|
+
break;
|
|
86
|
+
case 'ROW':
|
|
87
|
+
if (!isPositiveInt(l.count))
|
|
88
|
+
issues.push(layoutIssue('POSITIVE_INTEGER_REQUIRED', `${path}.layout.count`));
|
|
89
|
+
if (!isPositive(l.pitch))
|
|
90
|
+
issues.push(layoutIssue('POSITIVE_NUMBER_REQUIRED', `${path}.layout.pitch`));
|
|
91
|
+
if (l.axis !== 'X' && l.axis !== 'Z')
|
|
92
|
+
issues.push(layoutIssue('AXIS_INVALID', `${path}.layout.axis`));
|
|
93
|
+
checkSpec(l.slot, `${path}.layout.slot`, issues);
|
|
94
|
+
break;
|
|
95
|
+
case 'GRID':
|
|
96
|
+
if (!isPositiveInt(l.rows))
|
|
97
|
+
issues.push(layoutIssue('POSITIVE_INTEGER_REQUIRED', `${path}.layout.rows`));
|
|
98
|
+
if (!isPositiveInt(l.cols))
|
|
99
|
+
issues.push(layoutIssue('POSITIVE_INTEGER_REQUIRED', `${path}.layout.cols`));
|
|
100
|
+
if (!isPositive(l.pitch?.x))
|
|
101
|
+
issues.push(layoutIssue('POSITIVE_NUMBER_REQUIRED', `${path}.layout.pitch.x`));
|
|
102
|
+
if (!isPositive(l.pitch?.z))
|
|
103
|
+
issues.push(layoutIssue('POSITIVE_NUMBER_REQUIRED', `${path}.layout.pitch.z`));
|
|
104
|
+
checkSpec(l.slot, `${path}.layout.slot`, issues);
|
|
105
|
+
break;
|
|
106
|
+
case 'CUSTOM': {
|
|
107
|
+
if (!Array.isArray(l.slots)) {
|
|
108
|
+
issues.push(layoutIssue('ARRAY_REQUIRED', `${path}.layout.slots`));
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
if (!l.slots.length)
|
|
112
|
+
issues.push(layoutIssue('SLOTS_REQUIRED', `${path}.layout.slots`));
|
|
113
|
+
const slotNos = new Set();
|
|
114
|
+
l.slots.forEach((s, k) => {
|
|
115
|
+
const at = `${path}.layout.slots[${k}]`;
|
|
116
|
+
if (!isPositiveInt(s?.slotNo))
|
|
117
|
+
issues.push(layoutIssue('POSITIVE_INTEGER_REQUIRED', `${at}.slotNo`));
|
|
118
|
+
else if (slotNos.has(s.slotNo))
|
|
119
|
+
issues.push(layoutIssue('SLOT_NUMBER_DUPLICATE', `${at}.slotNo`, { slotNo: s.slotNo }));
|
|
120
|
+
else
|
|
121
|
+
slotNos.add(s.slotNo);
|
|
122
|
+
if (!isFiniteNumber(s?.offset?.x) || !isFiniteNumber(s?.offset?.z))
|
|
123
|
+
issues.push(layoutIssue('FINITE_NUMBER_REQUIRED', `${at}.offset`));
|
|
124
|
+
checkSpec(s, at, issues);
|
|
125
|
+
});
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
default:
|
|
129
|
+
issues.push(layoutIssue('PATTERN_INVALID', `${path}.layout.pattern`));
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return issues;
|
|
133
|
+
}
|
|
134
|
+
/** Values JSON turns into null (NaN, Infinity): stored, they would come back as a broken layout. */
|
|
135
|
+
export function persistenceIssues(value, path = '') {
|
|
136
|
+
const issues = [];
|
|
137
|
+
const walk = (v, p) => {
|
|
138
|
+
if (typeof v === 'number' && !Number.isFinite(v))
|
|
139
|
+
issues.push(layoutIssue('NOT_PERSISTABLE', p, { value: String(v) }));
|
|
140
|
+
else if (Array.isArray(v))
|
|
141
|
+
v.forEach((x, i) => walk(x, `${p}[${i}]`));
|
|
142
|
+
else if (v && typeof v === 'object')
|
|
143
|
+
for (const [k, x] of Object.entries(v))
|
|
144
|
+
walk(x, p ? `${p}.${k}` : k);
|
|
145
|
+
};
|
|
146
|
+
walk(value, path);
|
|
147
|
+
return issues;
|
|
148
|
+
}
|
|
149
|
+
/* ── numbering ───────────────────────────────────────────────────────────── */
|
|
150
|
+
export function slotCount(pattern) {
|
|
151
|
+
switch (pattern.pattern) {
|
|
152
|
+
case 'SINGLE':
|
|
153
|
+
return 1;
|
|
154
|
+
case 'ROW':
|
|
155
|
+
return pattern.count;
|
|
156
|
+
case 'GRID':
|
|
157
|
+
return pattern.rows * pattern.cols;
|
|
158
|
+
case 'CUSTOM':
|
|
159
|
+
return pattern.slots.length;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** A tier's slot numbers, in order. ROW and GRID count from 1; CUSTOM has the numbers it was given. */
|
|
163
|
+
export function slotNumbers(pattern) {
|
|
164
|
+
if (pattern.pattern === 'CUSTOM')
|
|
165
|
+
return pattern.slots.map(s => s.slotNo).sort((a, b) => a - b);
|
|
166
|
+
return Array.from({ length: slotCount(pattern) }, (_, i) => i + 1);
|
|
167
|
+
}
|
|
168
|
+
/** A GRID slot's number from its row r and column c (from 1), counted from the origin corner. */
|
|
169
|
+
export function gridSlotNo(rows, cols, r, c, order = 'ROW_MAJOR') {
|
|
170
|
+
switch (order) {
|
|
171
|
+
case 'ROW_MAJOR':
|
|
172
|
+
return (r - 1) * cols + c;
|
|
173
|
+
case 'COL_MAJOR':
|
|
174
|
+
return (c - 1) * rows + r;
|
|
175
|
+
case 'SERPENTINE_ROW':
|
|
176
|
+
return (r - 1) * cols + (r % 2 === 1 ? c : cols - c + 1);
|
|
177
|
+
case 'SERPENTINE_COL':
|
|
178
|
+
return (c - 1) * rows + (c % 2 === 1 ? r : rows - r + 1);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/** The row and column of a GRID slot number -- the inverse of gridSlotNo. */
|
|
182
|
+
export function gridCellOf(rows, cols, slotNo, order = 'ROW_MAJOR') {
|
|
183
|
+
const i = slotNo - 1;
|
|
184
|
+
switch (order) {
|
|
185
|
+
case 'ROW_MAJOR':
|
|
186
|
+
return { r: Math.floor(i / cols) + 1, c: (i % cols) + 1 };
|
|
187
|
+
case 'COL_MAJOR':
|
|
188
|
+
return { r: (i % rows) + 1, c: Math.floor(i / rows) + 1 };
|
|
189
|
+
case 'SERPENTINE_ROW': {
|
|
190
|
+
const r = Math.floor(i / cols) + 1;
|
|
191
|
+
const k = (i % cols) + 1;
|
|
192
|
+
return { r, c: r % 2 === 1 ? k : cols - k + 1 };
|
|
193
|
+
}
|
|
194
|
+
case 'SERPENTINE_COL': {
|
|
195
|
+
const c = Math.floor(i / rows) + 1;
|
|
196
|
+
const k = (i % rows) + 1;
|
|
197
|
+
return { r: c % 2 === 1 ? k : rows - k + 1, c };
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/** Flips a sign without making -0. */
|
|
202
|
+
const flip = (v, max) => (max && v !== 0 ? -v : v);
|
|
203
|
+
/**
|
|
204
|
+
* The slot at an address, or null when the tier or the slot is not there. ROW and GRID slots are worked out:
|
|
205
|
+
* ROW centre = ((n - 1) - (count - 1) / 2) × pitch, negated when origin is MAX
|
|
206
|
+
* GRID centre = the row and column the order gives, x = (c - 1 - (cols - 1)/2) × pitch.x,
|
|
207
|
+
* z = (r - 1 - (rows - 1)/2) × pitch.z, each negated when its origin is MAX
|
|
208
|
+
*/
|
|
209
|
+
export function resolveSlot(layout, address, options = {}) {
|
|
210
|
+
const tier = layout?.tiers?.find(t => t?.tierNo === address?.tier);
|
|
211
|
+
if (!tier || !isPositiveInt(address.slot))
|
|
212
|
+
return null;
|
|
213
|
+
const l = tier.layout;
|
|
214
|
+
let spec;
|
|
215
|
+
let offset;
|
|
216
|
+
let name;
|
|
217
|
+
switch (l.pattern) {
|
|
218
|
+
case 'SINGLE':
|
|
219
|
+
if (address.slot !== 1)
|
|
220
|
+
return null;
|
|
221
|
+
spec = l.slot;
|
|
222
|
+
offset = { x: 0, z: 0 };
|
|
223
|
+
break;
|
|
224
|
+
case 'ROW': {
|
|
225
|
+
if (address.slot > l.count)
|
|
226
|
+
return null;
|
|
227
|
+
const v = flip((address.slot - 1 - (l.count - 1) / 2) * l.pitch, l.origin === 'MAX');
|
|
228
|
+
spec = l.slot;
|
|
229
|
+
offset = l.axis === 'X' ? { x: v, z: 0 } : { x: 0, z: v };
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
case 'GRID': {
|
|
233
|
+
if (address.slot > l.rows * l.cols)
|
|
234
|
+
return null;
|
|
235
|
+
const { r, c } = gridCellOf(l.rows, l.cols, address.slot, l.order);
|
|
236
|
+
const origin = l.origin ?? { x: 'MIN', z: 'MIN' };
|
|
237
|
+
spec = l.slot;
|
|
238
|
+
offset = {
|
|
239
|
+
x: flip((c - 1 - (l.cols - 1) / 2) * l.pitch.x, origin.x === 'MAX'),
|
|
240
|
+
z: flip((r - 1 - (l.rows - 1) / 2) * l.pitch.z, origin.z === 'MAX')
|
|
241
|
+
};
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
case 'CUSTOM': {
|
|
245
|
+
const s = l.slots.find(s => s.slotNo === address.slot);
|
|
246
|
+
if (!s)
|
|
247
|
+
return null;
|
|
248
|
+
spec = s;
|
|
249
|
+
offset = { ...s.offset };
|
|
250
|
+
name = s.name;
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
tier: tier.tierNo,
|
|
256
|
+
slotNo: address.slot,
|
|
257
|
+
name,
|
|
258
|
+
anchorId: tier.anchorId,
|
|
259
|
+
mount: tier.mount,
|
|
260
|
+
tierPosition: { ...tier.position },
|
|
261
|
+
tierRotation: tier.rotation,
|
|
262
|
+
offset,
|
|
263
|
+
allowed: { ...spec.allowed },
|
|
264
|
+
accepts: spec.accepts ? [...spec.accepts] : undefined,
|
|
265
|
+
stackLimit: spec.stackLimit ?? options.defaultStackLimit ?? 1,
|
|
266
|
+
rotation: spec.rotation ?? 0
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/* ── slot ids ────────────────────────────────────────────────────────────── */
|
|
270
|
+
/** A slot's logical id. */
|
|
271
|
+
export function slotIdOf(address) {
|
|
272
|
+
return `t${address.tier}_s${address.slot}`;
|
|
273
|
+
}
|
|
274
|
+
/** The address a slot id names, or null when it is not one. */
|
|
275
|
+
export function addressOfSlotId(slotId) {
|
|
276
|
+
const m = typeof slotId === 'string' ? /^t(\d+)_s(\d+)$/.exec(slotId) : null;
|
|
277
|
+
return m ? { tier: Number(m[1]), slot: Number(m[2]) } : null;
|
|
278
|
+
}
|
|
279
|
+
/** Every address of a layout, tier by tier as written. For a big GRID, resolve only the addresses you need. */
|
|
280
|
+
export function* slotAddresses(layout) {
|
|
281
|
+
for (const tier of layout?.tiers ?? [])
|
|
282
|
+
for (const slot of slotNumbers(tier.layout))
|
|
283
|
+
yield { tier: tier.tierNo, slot };
|
|
284
|
+
}
|
|
285
|
+
/** A point of the tier's X-Z plane turned by the tier's rotation about Y (right-handed: +X turns toward -Z). */
|
|
286
|
+
function turnY(x, z, degrees) {
|
|
287
|
+
if (!degrees)
|
|
288
|
+
return { x, z };
|
|
289
|
+
const a = (degrees * Math.PI) / 180;
|
|
290
|
+
const c = Math.cos(a);
|
|
291
|
+
const s = Math.sin(a);
|
|
292
|
+
// clears the 6e-17 left at multiples of 90°
|
|
293
|
+
const clean = (v) => Math.round(v * 1e9) / 1e9;
|
|
294
|
+
return { x: clean(x * c + z * s), z: clean(-x * s + z * c) };
|
|
295
|
+
}
|
|
296
|
+
/** A slot's frame in its anchor's: the tier's placement, then the slot's offset and turn in the tier. */
|
|
297
|
+
export function slotFrame(slot) {
|
|
298
|
+
const o = turnY(slot.offset.x, slot.offset.z, slot.tierRotation);
|
|
299
|
+
return {
|
|
300
|
+
position: { x: slot.tierPosition.x + o.x, y: slot.tierPosition.y, z: slot.tierPosition.z + o.z },
|
|
301
|
+
rotation: slot.tierRotation + slot.rotation
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
export const DEFAULT_SEAT_MARGIN = 0.05;
|
|
305
|
+
const knownDims = (d) => !!d && isPositive(d.width) && isPositive(d.depth) && isPositive(d.height);
|
|
306
|
+
/** The X and Z extent of an item turned by `rotation` degrees. */
|
|
307
|
+
export function rotatedFootprint(dims, rotation) {
|
|
308
|
+
const rad = (rotation * Math.PI) / 180;
|
|
309
|
+
const c = Math.abs(Math.cos(rad));
|
|
310
|
+
const s = Math.abs(Math.sin(rad));
|
|
311
|
+
// clears the 6e-17 left at multiples of 90°
|
|
312
|
+
const clean = (v) => Math.round(v * 1e9) / 1e9;
|
|
313
|
+
return { width: clean(dims.width * c + dims.depth * s), depth: clean(dims.width * s + dims.depth * c) };
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Where an item sits in its slot's own frame: shrunk to fit the slot's width and depth (by its turned extent, never
|
|
317
|
+
* enlarged), on top of `belowHeight` -- the shown heights (height × scale) of what is stacked under it -- along +Y for ON
|
|
318
|
+
* and IN, -Y for HANG. x and z are 0 and it is not turned: the slot's frame has the offset and the turn. `margin` is room
|
|
319
|
+
* left only for showing (0 ≤ margin < 1); whether it fits is judged elsewhere, at full size. Null when a size or value is
|
|
320
|
+
* unusable -- never NaN or Infinity.
|
|
321
|
+
* slotFrame(slot) then seatInSlot(...) = seatTransform(...)
|
|
322
|
+
*/
|
|
323
|
+
export function seatInSlot(dims, slot, belowHeight = 0, margin = DEFAULT_SEAT_MARGIN) {
|
|
324
|
+
if (!knownDims(dims))
|
|
325
|
+
return null;
|
|
326
|
+
if (!isFiniteNumber(belowHeight) || !isFiniteNumber(margin) || margin < 0 || margin >= 1)
|
|
327
|
+
return null;
|
|
328
|
+
const fp = rotatedFootprint(dims, slot.rotation);
|
|
329
|
+
const scale = Math.min(1, Math.min(slot.allowed.width / fp.width, slot.allowed.depth / fp.depth) * (1 - margin));
|
|
330
|
+
const h = dims.height * scale;
|
|
331
|
+
const dir = slot.mount === 'HANG' ? -1 : 1;
|
|
332
|
+
return { position: { x: 0, y: dir * (belowHeight + h / 2), z: 0 }, rotation: 0, scale };
|
|
333
|
+
}
|
|
334
|
+
/** Where an item sits in its anchor's frame: the slot's frame, then the seat in it. */
|
|
335
|
+
export function seatTransform(dims, slot, belowHeight = 0, margin = DEFAULT_SEAT_MARGIN) {
|
|
336
|
+
const seat = seatInSlot(dims, slot, belowHeight, margin);
|
|
337
|
+
if (!seat)
|
|
338
|
+
return null;
|
|
339
|
+
const f = slotFrame(slot);
|
|
340
|
+
return { position: { x: f.position.x, y: f.position.y + seat.position.y, z: f.position.z }, rotation: f.rotation, scale: seat.scale };
|
|
341
|
+
}
|
|
342
|
+
/** Where each of a slot's stacked items sits in the anchor's frame, bottom first. An item of unknown size is null and adds no height. */
|
|
343
|
+
export function stackSeatTransforms(stack, slot, margin = DEFAULT_SEAT_MARGIN) {
|
|
344
|
+
let below = 0;
|
|
345
|
+
return stack.map(dims => {
|
|
346
|
+
const t = dims ? seatTransform(dims, slot, below, margin) : null;
|
|
347
|
+
if (t)
|
|
348
|
+
below += dims.height * t.scale;
|
|
349
|
+
return t;
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
/** Below this, a shared length is a touch, not an overlap. */
|
|
353
|
+
const TOUCH = 1e-6;
|
|
354
|
+
function roomOf(slot, tierIndex) {
|
|
355
|
+
const f = slotFrame(slot);
|
|
356
|
+
const hw = slot.allowed.width / 2;
|
|
357
|
+
const hd = slot.allowed.depth / 2;
|
|
358
|
+
const corners = [
|
|
359
|
+
[-hw, -hd],
|
|
360
|
+
[hw, -hd],
|
|
361
|
+
[hw, hd],
|
|
362
|
+
[-hw, hd]
|
|
363
|
+
].map(([x, z]) => {
|
|
364
|
+
const p = turnY(x, z, f.rotation);
|
|
365
|
+
return { x: f.position.x + p.x, z: f.position.z + p.z };
|
|
366
|
+
});
|
|
367
|
+
const ax = turnY(1, 0, f.rotation);
|
|
368
|
+
const az = turnY(0, 1, f.rotation);
|
|
369
|
+
const dir = slot.mount === 'HANG' ? -1 : 1;
|
|
370
|
+
const ys = [f.position.y, f.position.y + dir * slot.allowed.height];
|
|
371
|
+
const xs = corners.map(c => c.x);
|
|
372
|
+
return {
|
|
373
|
+
tierIndex,
|
|
374
|
+
tier: slot.tier,
|
|
375
|
+
slot: slot.slotNo,
|
|
376
|
+
corners,
|
|
377
|
+
axes: [ax, az],
|
|
378
|
+
y0: Math.min(...ys),
|
|
379
|
+
y1: Math.max(...ys),
|
|
380
|
+
minX: Math.min(...xs),
|
|
381
|
+
maxX: Math.max(...xs)
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
/** Whether two turned rectangles share area: no axis of either separates them by more than a touch. */
|
|
385
|
+
function footprintsOverlap(a, b) {
|
|
386
|
+
for (const axis of [...a.axes, ...b.axes]) {
|
|
387
|
+
const pa = a.corners.map(c => c.x * axis.x + c.z * axis.z);
|
|
388
|
+
const pb = b.corners.map(c => c.x * axis.x + c.z * axis.z);
|
|
389
|
+
const shared = Math.min(Math.max(...pa), Math.max(...pb)) - Math.max(Math.min(...pa), Math.min(...pb));
|
|
390
|
+
if (shared <= TOUCH)
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
return true;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Where a sound layout's slots crowd each other or leave their anchor's face, as warnings. Only slots on the same anchor
|
|
397
|
+
* are compared: anchors move apart. Rooms are each slot's allowed box, placed by its tier and turned; sharing a face or
|
|
398
|
+
* an edge is not overlapping.
|
|
399
|
+
*/
|
|
400
|
+
export function slotSpaceWarnings(layout, options = {}) {
|
|
401
|
+
const warnings = [];
|
|
402
|
+
const byAnchor = new Map();
|
|
403
|
+
layout.tiers.forEach((tier, i) => {
|
|
404
|
+
const rooms = byAnchor.get(tier.anchorId) ?? [];
|
|
405
|
+
byAnchor.set(tier.anchorId, rooms);
|
|
406
|
+
for (const n of slotNumbers(tier.layout))
|
|
407
|
+
rooms.push(roomOf(resolveSlot(layout, { tier: tier.tierNo, slot: n }), i));
|
|
408
|
+
});
|
|
409
|
+
for (const [anchorId, rooms] of byAnchor) {
|
|
410
|
+
const face = options.anchorFaces?.[anchorId];
|
|
411
|
+
if (!face)
|
|
412
|
+
warnings.push({ code: 'ANCHOR_SPACE_UNKNOWN', path: 'tiers', params: { anchorId } });
|
|
413
|
+
else
|
|
414
|
+
for (const r of rooms)
|
|
415
|
+
if (r.corners.some(c => Math.abs(c.x) - face.width / 2 > TOUCH || Math.abs(c.z) - face.depth / 2 > TOUCH))
|
|
416
|
+
warnings.push({ code: 'SLOT_OUTSIDE_ANCHOR', path: `tiers[${r.tierIndex}]`, params: { tier: r.tier, slot: r.slot } });
|
|
417
|
+
// sweep along X so a big grid is not compared pair by pair
|
|
418
|
+
const sorted = [...rooms].sort((a, b) => a.minX - b.minX);
|
|
419
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
420
|
+
const a = sorted[i];
|
|
421
|
+
for (let j = i + 1; j < sorted.length && sorted[j].minX < a.maxX - TOUCH; j++) {
|
|
422
|
+
const b = sorted[j];
|
|
423
|
+
if (Math.min(a.y1, b.y1) - Math.max(a.y0, b.y0) <= TOUCH)
|
|
424
|
+
continue;
|
|
425
|
+
if (!footprintsOverlap(a, b))
|
|
426
|
+
continue;
|
|
427
|
+
const [first, second] = a.tierIndex < b.tierIndex || (a.tierIndex === b.tierIndex && a.slot < b.slot) ? [a, b] : [b, a];
|
|
428
|
+
warnings.push({
|
|
429
|
+
code: 'SLOT_OVERLAP',
|
|
430
|
+
path: `tiers[${second.tierIndex}]`,
|
|
431
|
+
params: { tier: second.tier, slot: second.slot, otherTier: first.tier, otherSlot: first.slot }
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
return warnings;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Whether one more item fits in a slot that already holds `occupants`, at full size. The count limit and the height
|
|
440
|
+
* limit are separate checks. accepts left out takes any type; an empty list takes none. UNKNOWN when a type or a size
|
|
441
|
+
* needed to judge is not known.
|
|
442
|
+
*/
|
|
443
|
+
export function judgeItemFit(slot, candidate, occupants = [], options = {}) {
|
|
444
|
+
if (!slot)
|
|
445
|
+
return { verdict: 'NG', reasons: ['SLOT_NOT_FOUND'] };
|
|
446
|
+
const norm = options.normalizeType ?? ((t) => (t === undefined || t === null ? '' : String(t)));
|
|
447
|
+
const reasons = [];
|
|
448
|
+
let unknown = false;
|
|
449
|
+
if (slot.accepts) {
|
|
450
|
+
const type = norm(candidate.type);
|
|
451
|
+
if (!type)
|
|
452
|
+
unknown = true;
|
|
453
|
+
else if (!slot.accepts.map(norm).includes(type))
|
|
454
|
+
reasons.push('TYPE_NOT_ACCEPTED');
|
|
455
|
+
}
|
|
456
|
+
if (occupants.length + 1 > slot.stackLimit)
|
|
457
|
+
reasons.push('STACK_LIMIT_EXCEEDED');
|
|
458
|
+
if (!knownDims(candidate.dims))
|
|
459
|
+
unknown = true;
|
|
460
|
+
else {
|
|
461
|
+
const fp = rotatedFootprint(candidate.dims, slot.rotation);
|
|
462
|
+
if (fp.width > slot.allowed.width)
|
|
463
|
+
reasons.push('WIDTH_EXCEEDED');
|
|
464
|
+
if (fp.depth > slot.allowed.depth)
|
|
465
|
+
reasons.push('DEPTH_EXCEEDED');
|
|
466
|
+
if (occupants.every(o => knownDims(o.dims))) {
|
|
467
|
+
const total = occupants.reduce((sum, o) => sum + o.dims.height, candidate.dims.height);
|
|
468
|
+
if (total > slot.allowed.height)
|
|
469
|
+
reasons.push('HEIGHT_EXCEEDED');
|
|
470
|
+
}
|
|
471
|
+
else
|
|
472
|
+
unknown = true;
|
|
473
|
+
}
|
|
474
|
+
if (reasons.length)
|
|
475
|
+
return { verdict: 'NG', reasons: unknown ? [...reasons, 'SPEC_UNKNOWN'] : reasons };
|
|
476
|
+
if (unknown)
|
|
477
|
+
return { verdict: 'UNKNOWN', reasons: ['SPEC_UNKNOWN'] };
|
|
478
|
+
return { verdict: 'OK', reasons: [] };
|
|
479
|
+
}
|
|
480
|
+
//# sourceMappingURL=slot-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-layout.js","sourceRoot":"","sources":["../src/slot-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAiCH,MAAM,UAAU,WAAW,CAAC,IAAqB,EAAE,IAAY,EAAE,MAAwC;IACvG,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;AACzD,CAAC;AAUD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAA;AA+FrC,gFAAgF;AAEhF,MAAM,cAAc,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AAC/F,MAAM,UAAU,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,GA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AC,CAAA;QAC1D,IAAI,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK;YAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QACjE,IAAI,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK;YAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QACjE,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAC5C,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,IAAK,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACvF,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM;gBAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;QAClE,CAAC;;YAAM,OAAO,GAAG,IAAI,CAAA;IACvB,CAAC;IAED,IAAI,OAAO,CAAC,MAAM;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;IACvG,IAAI,OAAO;QAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,cAAc,CAAC,EAAE,CAAA;IACrE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAA;AACvC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { FigureSurfaceReference } from './asset-types.ts';
|
|
2
|
+
import { type SlotLayout, type SlotMount } from './slot-layout.ts';
|
|
3
|
+
import type { Vec3 } from './words.ts';
|
|
4
|
+
/** A frame the figure gives its tiers: a face of one of its parts. */
|
|
5
|
+
export interface FigureSlotAnchor {
|
|
6
|
+
id: string;
|
|
7
|
+
/** The frame of the face -- the same rule as a binding's frame. */
|
|
8
|
+
frame: string;
|
|
9
|
+
/** The face. Its tiers are placed in the part's X and Z; they rise along its Y, away from the face. */
|
|
10
|
+
pose: FigureSurfaceReference;
|
|
11
|
+
}
|
|
12
|
+
export interface FigureSlotLayoutDeclaration {
|
|
13
|
+
label: string;
|
|
14
|
+
role: 'seat' | 'grip';
|
|
15
|
+
anchors: FigureSlotAnchor[];
|
|
16
|
+
/** Every tier stands on one of the anchors; every slot must name the types it takes (ADR-0087 decision 3). */
|
|
17
|
+
layout: SlotLayout;
|
|
18
|
+
}
|
|
19
|
+
/** One slot unfolded from a layout: a place like a binding, plus where it is on its anchor. */
|
|
20
|
+
export interface FigureSlotPlace {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
role: 'seat' | 'grip';
|
|
24
|
+
/** The anchor's face: the frame and the pose a binding would have. */
|
|
25
|
+
frame: string;
|
|
26
|
+
pose: FigureSurfaceReference;
|
|
27
|
+
anchorId: string;
|
|
28
|
+
accepts: string[];
|
|
29
|
+
/** How many it holds at once: the slot's stackLimit. */
|
|
30
|
+
capacity: number;
|
|
31
|
+
tier: number;
|
|
32
|
+
slot: number;
|
|
33
|
+
name?: string;
|
|
34
|
+
/** The tier's centre on the anchor: X and Z in the part's axes, Y away from the face (toward it for a bottom face). */
|
|
35
|
+
tierPosition: Vec3;
|
|
36
|
+
/** The tier's turn about the face's normal, degrees. */
|
|
37
|
+
tierRotation: number;
|
|
38
|
+
/** The slot's centre from the tier's centre, in the tier's axes. */
|
|
39
|
+
offset: {
|
|
40
|
+
x: number;
|
|
41
|
+
z: number;
|
|
42
|
+
};
|
|
43
|
+
/** The slot's turn about Y in the tier, degrees. */
|
|
44
|
+
rotation: number;
|
|
45
|
+
mount: SlotMount;
|
|
46
|
+
/** The room a held thing may take: width along X, height along Y, depth along Z. */
|
|
47
|
+
allowed: {
|
|
48
|
+
width: number;
|
|
49
|
+
depth: number;
|
|
50
|
+
height: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** The places a declaration unfolds into, tier by tier and slot by slot. None when there is no declaration. */
|
|
54
|
+
export declare function figureSlotPlacesOf(declaration: FigureSlotLayoutDeclaration | undefined): FigureSlotPlace[];
|
|
55
|
+
//# sourceMappingURL=slot-places.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-places.d.ts","sourceRoot":"","sources":["../src/slot-places.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC,sEAAsE;AACtE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAA;IACb,uGAAuG;IACvG,IAAI,EAAE,sBAAsB,CAAA;CAC7B;AAED,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,8GAA8G;IAC9G,MAAM,EAAE,UAAU,CAAA;CACnB;AAED,+FAA+F;AAC/F,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,sBAAsB,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uHAAuH;IACvH,YAAY,EAAE,IAAI,CAAA;IAClB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAChC,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,oFAAoF;IACpF,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC1D;AAED,+GAA+G;AAC/G,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,2BAA2B,GAAG,SAAS,GAAG,eAAe,EAAE,CA8B1G"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A figure's slot layout declaration and the places it unfolds into (ADR-0118).
|
|
3
|
+
*
|
|
4
|
+
* A figure gives anchors -- faces of its parts, so an anchor on a moving part (a fork) moves with it -- and a slot layout
|
|
5
|
+
* whose tiers stand on them. Compiling unfolds the layout into one place per slot, each with the id `t{tier}_s{slot}` --
|
|
6
|
+
* a logical id, not the name of a node in the asset. The count and the ids are what the author wrote; resizing the
|
|
7
|
+
* figure does not change them, and neither does the number of anchors. Unfolding reads the declaration only, so the
|
|
8
|
+
* release comparison and the authoring read-back see the same places the compiled figure evaluates.
|
|
9
|
+
*/
|
|
10
|
+
import { resolveSlot, slotAddresses, slotIdOf } from "./slot-layout.js";
|
|
11
|
+
/** The places a declaration unfolds into, tier by tier and slot by slot. None when there is no declaration. */
|
|
12
|
+
export function figureSlotPlacesOf(declaration) {
|
|
13
|
+
if (!declaration?.layout || !Array.isArray(declaration.anchors))
|
|
14
|
+
return [];
|
|
15
|
+
const anchors = new Map(declaration.anchors.map(a => [a.id, a]));
|
|
16
|
+
const places = [];
|
|
17
|
+
for (const address of slotAddresses(declaration.layout)) {
|
|
18
|
+
const s = resolveSlot(declaration.layout, address);
|
|
19
|
+
const anchor = s && anchors.get(s.anchorId);
|
|
20
|
+
if (!s || !anchor)
|
|
21
|
+
continue;
|
|
22
|
+
const id = slotIdOf(address);
|
|
23
|
+
places.push({
|
|
24
|
+
id,
|
|
25
|
+
label: `${declaration.label} ${id}`,
|
|
26
|
+
role: declaration.role,
|
|
27
|
+
frame: anchor.frame,
|
|
28
|
+
pose: { ...anchor.pose },
|
|
29
|
+
anchorId: anchor.id,
|
|
30
|
+
accepts: [...(s.accepts ?? [])],
|
|
31
|
+
capacity: s.stackLimit,
|
|
32
|
+
tier: s.tier,
|
|
33
|
+
slot: s.slotNo,
|
|
34
|
+
...(s.name ? { name: s.name } : {}),
|
|
35
|
+
tierPosition: { ...s.tierPosition },
|
|
36
|
+
tierRotation: s.tierRotation,
|
|
37
|
+
offset: { ...s.offset },
|
|
38
|
+
rotation: s.rotation,
|
|
39
|
+
mount: s.mount,
|
|
40
|
+
allowed: { ...s.allowed }
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return places;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=slot-places.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-places.js","sourceRoot":"","sources":["../src/slot-places.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,WAAW,EACX,aAAa,EACb,QAAQ,EAGT,MAAM,kBAAkB,CAAA;AAgDzB,+GAA+G;AAC/G,MAAM,UAAU,kBAAkB,CAAC,WAAoD;IACrF,IAAI,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAA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