@floless/app 0.111.2 → 0.111.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/floless-server.cjs +7175 -6314
- package/dist/schemas/steel.model.v2.schema.json +12 -2
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +40 -4
- package/dist/web/aware.js +18 -0
- package/dist/web/grid-core.js +41 -16
- package/dist/web/renderers.js +11 -0
- package/dist/web/steel-3d-view.js +79 -36
- package/dist/web/steel-editor.html +677 -114
- package/package.json +1 -1
|
@@ -77,6 +77,16 @@
|
|
|
77
77
|
},
|
|
78
78
|
"point2": { "type": "array", "items": { "type": "number" }, "minItems": 2, "maxItems": 2, "description": "An [x,y] pair. Frame stated per use site — display px on a plan, world mm on the model grid." },
|
|
79
79
|
"point3": { "type": "array", "items": { "type": "number" }, "minItems": 3, "maxItems": 3, "description": "An [x,y,z] point in world mm (Z-up)." },
|
|
80
|
+
"intersectionRef": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"required": ["axis_x", "axis_y"],
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"description": "A labelled grid intersection, naming each axis BY DIRECTION — `axis_x` is the label of the line running in X (from the grid's labels_x), `axis_y` the Y-direction line. Never inferred from whether a label looks like a letter or a number: real sets invert the convention — this project's own demo labels X `K J H G F.2 F D C B A` and Y `1.1 2 3 4 5 5.1 6`, letters running in X and numbers in Y, the opposite of the editor default. This object is the ONE spelling stored v2 holds. v1 documents may also carry the legacy positional string \"<x-label>-<y-label>\", which migration and the pre-read verb canonicalise on the way in; it is refused here because that form cannot express a label containing a hyphen, and because two spellings of one fact would make a re-read propose a change that changes nothing.",
|
|
85
|
+
"properties": {
|
|
86
|
+
"axis_x": { "type": "string", "minLength": 1, "description": "Label of the X-direction grid line." },
|
|
87
|
+
"axis_y": { "type": "string", "minLength": 1, "description": "Label of the Y-direction grid line." }
|
|
88
|
+
}
|
|
89
|
+
},
|
|
80
90
|
"member": {
|
|
81
91
|
"type": "object",
|
|
82
92
|
"required": ["id", "profile", "from", "to", "provenance"],
|
|
@@ -153,9 +163,9 @@
|
|
|
153
163
|
"elevation_in": { "type": "number", "description": "This sheet's CUT elevation, inches. NOT v1's `default_tos` — that was the fallback top-of-steel for blank ends, which happens to carry the same number on a typical framing plan. Conflating them is easy and wrong, so v1's default_tos is materialized into explicit member elevations at migration and does not survive here." },
|
|
154
164
|
"pt_per_ft": { "type": "number", "description": "Display points per foot (the drawing scale). Still needed: observations record local geometry in display px." },
|
|
155
165
|
"datum_at": { "$ref": "#/$defs/point2", "description": "Display-space point of the grid intersection that is the model origin on this sheet (authored by the takeoff skill — never chosen by it)." },
|
|
156
|
-
"datum_ref": { "
|
|
166
|
+
"datum_ref": { "$ref": "#/$defs/intersectionRef", "description": "Which labelled intersection `datum_at` is, when the sheet cannot print the model origin. ABSENT is a statement, not a gap: the takeoff skill omits it precisely when the sheet's datum IS the model origin." },
|
|
157
167
|
"control2_at": { "$ref": "#/$defs/point2", "description": "A SECOND, non-coincident control point, display space. One point fixes only WHERE a sheet sits; the vector between two carries rotation, mirroring and scale (epic §6.2)." },
|
|
158
|
-
"control2_ref": { "
|
|
168
|
+
"control2_ref": { "$ref": "#/$defs/intersectionRef", "description": "Which labelled intersection `control2_at` is. Required alongside `control2_at` — unlike `datum_ref` it is never omitted, because a second control is never the model origin, so its labels always have to be stated. NOT expressible here (this repo's validator implements no `dependentRequired`), so it is enforced by `checkModelReferences` as `control-pair-incomplete` rather than by this schema." },
|
|
159
169
|
"clip": { "type": "array", "items": { "type": "number" }, "minItems": 4, "maxItems": 4, "description": "[x0,y0,x1,y1] display-space crop of the framing area." },
|
|
160
170
|
"raster_b64": { "type": "string", "description": "Base64 raster of the framing area. CONFIDENTIAL — never committed." },
|
|
161
171
|
"segments": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
|
|
@@ -261,8 +261,22 @@ native/display coords):
|
|
|
261
261
|
refused, because this verb patches the document you read and `*` cannot detect a write that landed
|
|
262
262
|
since your GET. On a re-read, preserve any existing per-facet `on` flags.
|
|
263
263
|
|
|
264
|
+
**On a `steel.model/v2` model it takes less — `filter` plus per-sheet `{ datum_at, datum_ref,
|
|
265
|
+
control2_at, control2_ref, elevation_in }`, and no grid or datum at all.** Check the `type` in the
|
|
266
|
+
document you just GET-ed. A v2 model keeps ONE grid for the whole model instead of one per sheet, and
|
|
267
|
+
that grid is not writable from a read: the human moves it in the editor's Grid panel. Sending a
|
|
268
|
+
`grid` or a `datum` earns a `400` that says so. So on v2: **skip §1c entirely, and in §1d skip only
|
|
269
|
+
the root `datum` block — the per-sheet registration in §1d is still yours to write**, and a migrated
|
|
270
|
+
model usually has none of it yet. Everything else in this section is unchanged.
|
|
271
|
+
|
|
264
272
|
### 1c. Grid lines — read the printed grid (quick, per sheet)
|
|
265
273
|
|
|
274
|
+
> **`steel.model/v2` models: SKIP this section.** A v2 model already has its grid — one grid for the
|
|
275
|
+
> whole model, worked out when the model was migrated — and it is not something a read may change. If
|
|
276
|
+
> you send one you will get a `400` explaining that the grid belongs to the human, who moves it in the
|
|
277
|
+
> editor's Grid panel. If a revised set genuinely shows the grid in a new place, say so in your summary
|
|
278
|
+
> so the user can move it; do not try to write it.
|
|
279
|
+
|
|
266
280
|
With the filter elements in hand, populate each plan's **`plan.grid`** (Tekla-style grid lines the
|
|
267
281
|
editor renders in 2D + 3D and snaps to). The geometry is deterministic — the editor's Grid panel has
|
|
268
282
|
a "From drawing" button running the same detector (`web/grid-core.js` `gridFromDrawing`: grid lines
|
|
@@ -291,6 +305,14 @@ Skip silently only when the sheet genuinely has no grid bubbles (rare for framin
|
|
|
291
305
|
|
|
292
306
|
### 1d. Model datum — ASK which grid intersection is global 0,0,0
|
|
293
307
|
|
|
308
|
+
> **`steel.model/v2` models: the root `datum` part is SKIPPED, the per-sheet part is not.** A v2 model
|
|
309
|
+
> has no root `datum`: the "which intersection is 0,0,0" question was answered when the model was
|
|
310
|
+
> migrated, and the answer lives in the model grid's origin, which a read may not move. **The per-sheet
|
|
311
|
+
> registration below is still yours to write** — `datum_at`, `datum_ref`, `control2_at`, `control2_ref`
|
|
312
|
+
> — because those say something different: where that already-chosen origin falls on THIS sheet. A
|
|
313
|
+
> migrated model usually has none of them yet, so this is real work, not a no-op. Send them under
|
|
314
|
+
> `sheets`, exactly as below, and just omit the root `"datum"` block.
|
|
315
|
+
|
|
294
316
|
Every sheet is traced in its **own** display space, and nothing ties two sheets to a common frame. The
|
|
295
317
|
same physical grid read from three sheets therefore lands in three different places — measured on a real
|
|
296
318
|
project: **443 mm apart**. That silently mis-registers every member read from those sheets — columns that
|
|
@@ -383,9 +405,19 @@ PUT /api/projects/<projectId>/steel-prepass If-Match: <the current ETag>
|
|
|
383
405
|
"control2_at": [x, y], "control2_ref": …, "elevation_in": 144 } } }
|
|
384
406
|
```
|
|
385
407
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
408
|
+
**On a `steel.model/v2` model, the same call without the two the verb refuses** — no root `datum`, no
|
|
409
|
+
per-sheet `grid`:
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
PUT /api/projects/<projectId>/steel-prepass If-Match: <the current ETag>
|
|
413
|
+
{ "sheets": { "<sheet>": { "datum_at": [x, y], "datum_ref": …,
|
|
414
|
+
"control2_at": [x, y], "control2_ref": …, "elevation_in": 144 } } }
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
Those six per-sheet keys and `datum` are the complete set the verb accepts alongside `filter` **on
|
|
418
|
+
`steel.takeoff/v1`**; on `steel.model/v2` it is the five per-sheet registration keys and `filter`.
|
|
419
|
+
Anything else — `members`, `memberRefs`, `title`, `raster_b64` — is refused **by name** with a `400`, so
|
|
420
|
+
a write that thinks it saved the model will hear about it rather than silently succeeding.
|
|
389
421
|
|
|
390
422
|
**Then STOP and hand off — checkpoint before the member read.** Tell the user to open the **Filter**
|
|
391
423
|
node, flip through the sheets, narrow to the steel, and **Save**. The saved `on` flags + `mode` are
|
|
@@ -998,6 +1030,7 @@ Key field rules:
|
|
|
998
1030
|
| you are writing | route |
|
|
999
1031
|
|---|---|
|
|
1000
1032
|
| the pre-read blocks — §1b `filter`, §1c `grid`, §1d `datum` + the per-sheet registration keys | **`PUT /api/projects/<projectId>/steel-prepass`** |
|
|
1033
|
+
| the same, on a **`steel.model/v2`** model — `filter` + the per-sheet registration keys ONLY, no `grid`, no `datum` | the same verb; it refuses the other two by name |
|
|
1001
1034
|
| the finished takeoff (§4's whole document: `members`, profiles, elevations) | `PUT /api/contract/steel-model` |
|
|
1002
1035
|
| a project's FIRST document, when the `GET` returned nothing at all | `PUT /api/contract/steel-model` with `If-None-Match: *` |
|
|
1003
1036
|
|
|
@@ -1005,7 +1038,10 @@ The prepass verb exists because the pre-read pass used to GET the contract and P
|
|
|
1005
1038
|
back. That is a full-document replacement: it can overwrite members, joints and connections that the
|
|
1006
1039
|
user has already reviewed, and an ETag does not stop it — an ETag makes a write not *stale*, not not
|
|
1007
1040
|
*canonical*. The verb accepts `filter`, `datum` and per-sheet `{ grid, datum_at, datum_ref, control2_at,
|
|
1008
|
-
control2_ref, elevation_in }`, and refuses everything else **by name** with a `400`.
|
|
1041
|
+
control2_ref, elevation_in }`, and refuses everything else **by name** with a `400`. **On a
|
|
1042
|
+
`steel.model/v2` model the accepted set is narrower** — `filter` plus the per-sheet registration keys,
|
|
1043
|
+
with `grid` and `datum` refused (§1c, §1d), because a v2 grid is model-global canonical structure rather
|
|
1044
|
+
than a pre-read block. It cannot create a
|
|
1009
1045
|
document and it cannot add a sheet (an unknown sheet is a `400`, never a new plan), so the create case
|
|
1010
1046
|
above genuinely does belong to the contract route.
|
|
1011
1047
|
|
package/dist/web/aware.js
CHANGED
|
@@ -5905,6 +5905,24 @@
|
|
|
5905
5905
|
}
|
|
5906
5906
|
return `In floless project "${req.project}" (app "${req.appId}"), a REVISED drawing was attached — re-read (vectorize) it into the SAME project as a new version (do NOT create a new project). Vectorize the drawing per the floless-app-vectorize skill into a drawing.vector/v1 contract: emit clean, editable 2D vector geometry (sheets → elements: lines / polylines / curves / text, each on its layer), NOT steel members or a takeoff. A vector PDF is read deterministically (exact geometry, no guessing); a photo, scan or hand sketch is traced by a fenced vision extraction that flags every uncertain stroke (low confidence) for the user's review. ${post}${snaps}${note}`;
|
|
5907
5907
|
}
|
|
5908
|
+
// A MIGRATED project holds steel.model/v2, and that changes the document the AI must compose —
|
|
5909
|
+
// not merely its wording. The store only accepts v2, so asking for a v1 take-off would have the
|
|
5910
|
+
// whole read refused at the gateway AFTER it was done, which is the most expensive place to find
|
|
5911
|
+
// out. `contractType` is what the store actually holds today (see requestContractType); it is
|
|
5912
|
+
// absent on an older server, and absent falls through to the v1 branches below, unchanged.
|
|
5913
|
+
//
|
|
5914
|
+
// A revision-read against a v2 project is always a RE-read: v2 is reached by migrating a project
|
|
5915
|
+
// that already held a model, so there is no "initial" case to distinguish. What differs from v1 is
|
|
5916
|
+
// structural and is spelled out rather than left to be inferred, because every one of these is a
|
|
5917
|
+
// place a v1-shaped answer would look plausible: members live at the document ROOT in world
|
|
5918
|
+
// millimetres rather than per sheet in display pixels; ids are model-global, so the v1 rule
|
|
5919
|
+
// "preserve the id AND its sheet label" does not apply and a bare id is the identity; an elevation
|
|
5920
|
+
// the drawing does not give is `{ unknown: true }`, never a substituted default, because a
|
|
5921
|
+
// fabricated elevation silently relocates steel; and what each SHEET showed is recorded as
|
|
5922
|
+
// evidence on that plan's `memberObservations` instead of by owning the member.
|
|
5923
|
+
if (req.contractType === 'steel.model/v2') {
|
|
5924
|
+
return `In floless project "${req.project}" (app "${req.appId}"), a REVISED drawing set was attached — re-read it into the SAME project as a new version (do NOT create a new project). This project holds a steel.model/v2 model, so compose a steel.model/v2 document, NOT a steel.takeoff/v1: members live in ONE root \`members[]\` array in WORLD MILLIMETRES (each with \`from\`/\`to\` as { x, y, z }), not per sheet in display pixels. Member ids are MODEL-GLOBAL — preserve the id of every member the revision still shows and mint a new one only for a genuinely new member; there is no sheet label to preserve alongside it. Where the drawing does not give an elevation, write \`{ unknown: true }\` for that z — never a substituted default, because a fabricated elevation moves steel. Record what each SHEET actually showed as evidence on that plan's \`memberObservations\` (with its \`binding.memberIds\`), and use \`plans[].memberRefs\` for members a sheet displays but never observed. Follow the floless-app-steel-takeoff skill's mandatory two-phase gate exactly as for v1: FIRST GET /api/contract/${req.appId}?project=${req.project} to read the CURRENT model and KEEP its ETag, do the deterministic PyMuPDF steel-filter pass only, send ONLY the pre-read blocks to PUT /api/projects/${req.project}/steel-prepass with { filter } and If-Match: <that ETag> — never the whole contract — then STOP and tell me to open Drawings → Steel Filter, review the facets, and Save. Do NOT read members, build the model, open 3D, or POST /revision-read until I explicitly come back after saving the filter. ${post}${snaps}${note}`;
|
|
5925
|
+
}
|
|
5908
5926
|
if (isInitialRead) {
|
|
5909
5927
|
return `In floless project "${req.project}" (app "${req.appId}"), an initial drawing set was attached — read it into this project as its first steel model version (do NOT create a new project). Follow the floless-app-steel-takeoff skill's mandatory two-phase gate. FIRST, GET /api/contract/${req.appId}?project=${req.project} and KEEP its ETag response header. A 404 "no contract for this app yet" here is NORMAL and not an error — a project created by dropping a drawing starts empty; it simply means this is the create case, so you will send If-None-Match: * instead of an ETag. (A project seeded from an existing model does return a contract and an ETag.) Then do the deterministic PyMuPDF steel-filter pass only: identify the framing-plan sheets, enumerate the drawing elements by layer/thickness/color into contract.filter.sheets/facets, write it back — if that GET returned NO contract this is the create case, so PUT the whole document to /api/contract/${req.appId}?project=${req.project} with If-None-Match: * ; if it DID return one, send only the pre-read blocks to PUT /api/projects/${req.project}/steel-prepass with { filter } and If-Match: <that ETag>. The prepass verb takes filter, datum and per-sheet { grid, datum_at, datum_ref, control2_at, control2_ref, elevation_in } and REFUSES members, connections and joints by name, so it cannot replace the model you are about to read. Either write is refused with 428 if it carries no precondition, and If-Match must be the exact ETag — If-Match: * is refused, because this verb patches the document you read. On 412 re-GET, re-apply your changes to the new document, and retry rather than repeating the same body. Then STOP and tell me to open Drawings → Steel Filter, review/narrow the steel facets, and Save. Do NOT read members, build the model, open 3D, or POST /revision-read until I explicitly come back after saving the filter. AFTER that saved-filter checkpoint, read members from the saved filter selection and compose the steel.takeoff/v1 contract. ${post}${snaps}${note}`;
|
|
5910
5928
|
}
|
package/dist/web/grid-core.js
CHANGED
|
@@ -288,15 +288,26 @@ export function gridLines(g) {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
/**
|
|
291
|
-
* The grid resolved to
|
|
291
|
+
* The grid resolved to plan geometry.
|
|
292
292
|
* v = vertical lines (spaced along +X, labels 1,2,3…): { x, label }
|
|
293
|
-
* h = horizontal lines (spaced
|
|
293
|
+
* h = horizontal lines (spaced along the Y axis, labels A,B,C…): { y, label }
|
|
294
294
|
* lines = standalone free-angle lines: { id, label, a, b }
|
|
295
|
-
* zs = levels: { mm, label, sourceIndex } (sorted, deduped). ext/extents
|
|
295
|
+
* zs = levels: { mm, label, sourceIndex } (sorted, deduped). ext/extents share the output's units.
|
|
296
296
|
* errX/errY/errZ carry per-axis parse errors; warningsZ reports duplicate/orphan level labels;
|
|
297
297
|
* lines of a failed axis are [].
|
|
298
|
+
*
|
|
299
|
+
* `opts.yUp` — WHICH GRID THIS IS, and it is the only structural difference between the two (unit 5, P7d).
|
|
300
|
+
* Default false is v1: the grid lives in one sheet's DISPLAY space, so Y grows DOWN the page and the
|
|
301
|
+
* spacings run UP it (`oy - off`). True is `steel.model/v2`'s ONE model grid, already in world mm with Y
|
|
302
|
+
* up, so the spacings run along +Y and `ptPerFt` should be FT_MM (k = 1, the identity). Passing a v2 grid
|
|
303
|
+
* without this does not throw — it draws the whole grid mirrored about the origin's Y, plausibly, which is
|
|
304
|
+
* the silent-wrong-space failure this epic exists to prevent.
|
|
305
|
+
*
|
|
306
|
+
* It also selects which per-line EXTENT vocabulary is read: v1's index-keyed `ends_x`/`ends_y` in display
|
|
307
|
+
* px, or v2's single `ends` map keyed by stable AXIS ID in world mm — see the block at the end.
|
|
298
308
|
*/
|
|
299
|
-
export function gridGeometry(g, ptPerFt) {
|
|
309
|
+
export function gridGeometry(g, ptPerFt, opts = {}) {
|
|
310
|
+
const yUp = !!opts.yUp;
|
|
300
311
|
const k = mmPerPx(ptPerFt);
|
|
301
312
|
const px = (mm) => mm / k;
|
|
302
313
|
const X = parseSpacings(g && g.x), Y = parseSpacings(g && g.y);
|
|
@@ -305,7 +316,7 @@ export function gridGeometry(g, ptPerFt) {
|
|
|
305
316
|
const lx = labelsFor(g && g.labels_x, 'num', X.offsets.length);
|
|
306
317
|
const ly = labelsFor(g && g.labels_y, 'alpha', Y.offsets.length);
|
|
307
318
|
const v = X.offsets.map((off, i) => ({ x: ox + px(off), label: lx[i] }));
|
|
308
|
-
const h = Y.offsets.map((off, i) => ({ y: oy - px(off), label: ly[i] })); // up the sheet = -Y (scene +Y)
|
|
319
|
+
const h = Y.offsets.map((off, i) => ({ y: yUp ? oy + px(off) : oy - px(off), label: ly[i] })); // v1: up the sheet = -Y (scene +Y). v2: world mm, already Y-up.
|
|
309
320
|
// Z levels are absolute, sorted/deduped, and retain their authored label source index.
|
|
310
321
|
const resolvedZ = parseLevels(g && g.z, g && g.labels_z);
|
|
311
322
|
const levelsZ = resolvedZ.err ? [] : resolvedZ.levels;
|
|
@@ -325,16 +336,27 @@ export function gridGeometry(g, ptPerFt) {
|
|
|
325
336
|
y0: Math.min((ys.length ? Math.min(...ys) : oy), ly0) - ext,
|
|
326
337
|
y1: Math.max((ys.length ? Math.max(...ys) : oy), ly1) + ext,
|
|
327
338
|
};
|
|
328
|
-
// per-line extent overrides (g.ends_x / g.ends_y: { "<index>": [lo|null, hi|null] }
|
|
329
|
-
// the line — a real sheet has partial lines like a 5.1 covering one wing).
|
|
330
|
-
//
|
|
339
|
+
// per-line extent overrides. v1 keys them by INDEX (g.ends_x / g.ends_y: { "<index>": [lo|null, hi|null] }
|
|
340
|
+
// in display px along the line — a real sheet has partial lines like a 5.1 covering one wing). v2
|
|
341
|
+
// replaced BOTH with one `ends` map keyed by stable AXIS ID in world mm, precisely because index keys
|
|
342
|
+
// meant "an insert or re-space changed what a reference meant" ($defs.modelGrid). null / absent = the
|
|
343
|
+
// auto full span. Every consumer (2D render, snapping, 3D) reads l.lo / l.hi.
|
|
344
|
+
//
|
|
345
|
+
// Reading the v2 map is not optional politeness: a line the model says covers one wing, drawn full
|
|
346
|
+
// span, is a WRONG drawing rather than an absent one.
|
|
347
|
+
const axisIds = (dir) => (yUp && g && Array.isArray(g.axes)) ? g.axes.filter((a) => a && a.dir === dir).map((a) => a.id) : [];
|
|
348
|
+
const override = (dir, i, legacy) => {
|
|
349
|
+
if (!yUp) return (g && g[legacy] && g[legacy][i]) || [];
|
|
350
|
+
const id = axisIds(dir)[i];
|
|
351
|
+
return (id != null && g && g.ends && g.ends[id]) || [];
|
|
352
|
+
};
|
|
331
353
|
for (const [i, l] of v.entries()) {
|
|
332
|
-
const o = (
|
|
354
|
+
const o = override('x', i, 'ends_x');
|
|
333
355
|
l.lo = o[0] != null && isFinite(o[0]) ? +o[0] : geo.y0;
|
|
334
356
|
l.hi = o[1] != null && isFinite(o[1]) ? +o[1] : geo.y1;
|
|
335
357
|
}
|
|
336
358
|
for (const [i, l] of h.entries()) {
|
|
337
|
-
const o = (
|
|
359
|
+
const o = override('y', i, 'ends_y');
|
|
338
360
|
l.lo = o[0] != null && isFinite(o[0]) ? +o[0] : geo.x0;
|
|
339
361
|
l.hi = o[1] != null && isFinite(o[1]) ? +o[1] : geo.x1;
|
|
340
362
|
}
|
|
@@ -394,16 +416,19 @@ export function gridSnapGeom(geo) {
|
|
|
394
416
|
* Emitted PLAN-ONLY on purpose: 'grid-line' / 'grid-int' snap X/Y and keep the dragged Z, so a grid
|
|
395
417
|
* can never yank a member off its elevation (candidatePoint in steel-3d-core honors that).
|
|
396
418
|
*/
|
|
397
|
-
export function gridCandidates3d(g, ptPerFt) {
|
|
419
|
+
export function gridCandidates3d(g, ptPerFt, opts = {}) {
|
|
398
420
|
if (!g || !g.on) return [];
|
|
399
|
-
const geo = gridGeometry(g, ptPerFt);
|
|
421
|
+
const geo = gridGeometry(g, ptPerFt, opts);
|
|
400
422
|
const k = mmPerPx(ptPerFt);
|
|
423
|
+
// The SAME reflection the 3D view applies to the drawn grid, and it must stay the same one or the snap
|
|
424
|
+
// targets sit mirrored away from the lines the user is aiming at. `yUp` (v2, world mm) means none.
|
|
425
|
+
const sy = opts.yUp ? k : -k;
|
|
401
426
|
const out = [];
|
|
402
|
-
for (const l of geo.v) out.push({ type: 'grid-line', a: [l.x * k,
|
|
403
|
-
for (const l of geo.h) out.push({ type: 'grid-line', a: [l.lo * k,
|
|
404
|
-
for (const l of geo.lines || []) out.push({ type: 'grid-line', a: [l.a[0] * k,
|
|
427
|
+
for (const l of geo.v) out.push({ type: 'grid-line', a: [l.x * k, l.hi * sy, 0], b: [l.x * k, l.lo * sy, 0], fromId: 'grid-' + l.label });
|
|
428
|
+
for (const l of geo.h) out.push({ type: 'grid-line', a: [l.lo * k, l.y * sy, 0], b: [l.hi * k, l.y * sy, 0], fromId: 'grid-' + l.label });
|
|
429
|
+
for (const l of geo.lines || []) out.push({ type: 'grid-line', a: [l.a[0] * k, l.a[1] * sy, 0], b: [l.b[0] * k, l.b[1] * sy, 0], fromId: 'grid-line-' + l.id });
|
|
405
430
|
for (const a of geo.v) for (const b of geo.h) {
|
|
406
|
-
if (b.y >= a.lo && b.y <= a.hi && a.x >= b.lo && a.x <= b.hi) out.push({ type: 'grid-int', p: [a.x * k,
|
|
431
|
+
if (b.y >= a.lo && b.y <= a.hi && a.x >= b.lo && a.x <= b.hi) out.push({ type: 'grid-int', p: [a.x * k, b.y * sy, 0], fromId: 'grid-' + a.label + '/' + b.label });
|
|
407
432
|
}
|
|
408
433
|
return out;
|
|
409
434
|
}
|
package/dist/web/renderers.js
CHANGED
|
@@ -17,6 +17,17 @@ window.CONTRACT_RENDERERS = {
|
|
|
17
17
|
editorUrl: (appId) => '/steel-editor.html?app=' + encodeURIComponent(appId),
|
|
18
18
|
scene: true,
|
|
19
19
|
},
|
|
20
|
+
// The SAME editor page, deliberately — a migrated project is the same project, and sending its owner
|
|
21
|
+
// to a different URL would say otherwise. What the editor then offers is narrower (P7d opens v2 for
|
|
22
|
+
// viewing plus the model-grid edit); that is the editor's business, not the registry's.
|
|
23
|
+
//
|
|
24
|
+
// `scene: true` because the whole export chain reads v2: `contractToScene`, `contractToAwareScene` and
|
|
25
|
+
// `contractToBom` all have v2 arms, and P7b wired the routes behind View 3D / Export IFC / Export BOM /
|
|
26
|
+
// Send to Tekla to accept an activated store's v2. Marking it false would hide a group that works.
|
|
27
|
+
'steel.model/v2': {
|
|
28
|
+
editorUrl: (appId) => '/steel-editor.html?app=' + encodeURIComponent(appId),
|
|
29
|
+
scene: true,
|
|
30
|
+
},
|
|
20
31
|
'drawing.vector/v1': {
|
|
21
32
|
editorUrl: (appId) => '/vector-editor.html?app=' + encodeURIComponent(appId),
|
|
22
33
|
// Local read-only 3D reconstruction viewer (views-to-scene) — NOT the AWARE exporter chain
|
|
@@ -19,8 +19,10 @@ import { OrbitControls } from 'three/addons/OrbitControls.js';
|
|
|
19
19
|
import { RoomEnvironment } from 'three/addons/RoomEnvironment.js';
|
|
20
20
|
import { surfaceTextures, applyTriplanar, TILE_MM, DIRECTIONAL } from './steel-materials.js';
|
|
21
21
|
import { Brush, Evaluator, SUBTRACTION } from 'three-bvh-csg';
|
|
22
|
-
import {
|
|
23
|
-
|
|
22
|
+
import { snapPoint, planPointToWp, memberGeometry, snapElevation, dim3dGeom, dominantAxis3d, planeBasis, planeFrom3Points, vecToPlane, frameFrom3Points, frameFromAngle, worldToLocal, identityFrame, resolvePointEntry, offsetsFor, candidateOnPlane, snapGridPoint, clipSegmentToPlanes, pointSegmentDistance2d, perspectiveSegmentParameter, gridDepthWins, segmentHitsRect2d, projectedFootprintHitsRect2d, pickGridLevel } from './steel-3d-core.js';
|
|
23
|
+
// `gridGeometry`, `gridCandidates3d` and `mmPerPx` moved behind the host's model read half (unit 5, P7d):
|
|
24
|
+
// each takes a `ptPerFt`, which is a v1 PLAN default and meaningless on a world-mm model grid.
|
|
25
|
+
import { visibleGridLevels } from './grid-core.js';
|
|
24
26
|
|
|
25
27
|
let renderer, scene, perspCam, orthoCam, camera, controls, root, api, canvasEl, ro, rafId, grid, raycaster, downXY, lastPick = '(none)';
|
|
26
28
|
let lightAmb, lightKey, lightFill; // dimmed in Realistic, where the environment lights the scene
|
|
@@ -749,7 +751,7 @@ function applyCopes(mesh, cuts) {
|
|
|
749
751
|
|
|
750
752
|
function buildFromScene(sc) {
|
|
751
753
|
clearRoot();
|
|
752
|
-
clipCandidates = null; clipLevels = null;
|
|
754
|
+
clipCandidates = null; clipLevels = null; invalidateModelCache(); // the model changed (edit/undo/redo) — drop the clip-draw snap cache so a draw in progress re-snaps against the CURRENT members/grid/levels, never stale ones
|
|
753
755
|
resetConnState(); // a fresh scene rebuilds selection from scratch — drop any stale connection envelope/context
|
|
754
756
|
for (const mat of baseMat.values()) mat.dispose(); // shared per-profile materials from the prior build
|
|
755
757
|
groupColor.clear(); baseMat.clear();
|
|
@@ -846,8 +848,11 @@ function buildRefLines() {
|
|
|
846
848
|
if (!refLineOn || !api) return;
|
|
847
849
|
const pts = [];
|
|
848
850
|
for (const m of members()) {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
+
// Ask the READ HALF whether this member has a work line, rather than testing for `m.wp` — that is a
|
|
852
|
+
// v1 STORAGE shape, and a v2 member has none, so the old guard skipped every member of a canonical
|
|
853
|
+
// model and drew no reference lines at all. Silently: an empty `pts` just returns. (unit 5, P7d)
|
|
854
|
+
const g = m && geoOf(m);
|
|
855
|
+
if (!g || !g.line) continue;
|
|
851
856
|
pts.push(new THREE.Vector3(g.line[0][0], g.line[0][1], g.line[0][2]), new THREE.Vector3(g.line[1][0], g.line[1][1], g.line[1][2]));
|
|
852
857
|
}
|
|
853
858
|
if (!pts.length) return;
|
|
@@ -1084,11 +1089,11 @@ const gridTexCache = new Map(); // 'b:LABEL' bubble / 't:LABEL' tag -> CanvasTex
|
|
|
1084
1089
|
// scale-independent. Intersections stay within a sheet (pairwise across the whole model is O(n²) noise).
|
|
1085
1090
|
// Grid is the active sheet's (the plan-locked reference the user is drawing against).
|
|
1086
1091
|
function allCandidates(excludeId) {
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
const base =
|
|
1092
|
+
// The member and grid halves come from the read half; the UCS origin does NOT — it is VIEW state, not
|
|
1093
|
+
// model data, and it keeps its position between them so the candidate ORDER is unchanged.
|
|
1094
|
+
const base = MODEL().memberCandidates(excludeId);
|
|
1090
1095
|
if (frame3d && !(pending && pending.frameDrag)) base.push({ type: 'origin', p: [...frame3d.origin], fromId: 'ucs-origin' }); // the local UCS origin is a snap target for every tool (Move/Copy, Add, Dimension); excluded while dragging the origin itself → no self-snap
|
|
1091
|
-
try { return base.concat(
|
|
1096
|
+
try { return base.concat(MODEL().gridCandidates()); }
|
|
1092
1097
|
catch { return base; } // a malformed hand-edited grid must never break member dragging
|
|
1093
1098
|
}
|
|
1094
1099
|
|
|
@@ -1132,14 +1137,20 @@ function clearStructGrid() {
|
|
|
1132
1137
|
}
|
|
1133
1138
|
function buildStructGrid() {
|
|
1134
1139
|
clearStructGrid();
|
|
1135
|
-
dimCandidates3d = null; tfCandidates = null; clipCandidates = null; clipLevels = null;
|
|
1136
|
-
if (!api || !
|
|
1137
|
-
|
|
1138
|
-
|
|
1140
|
+
dimCandidates3d = null; tfCandidates = null; clipCandidates = null; clipLevels = null; invalidateModelCache(); // the grid just changed → EVERY cached snap set built from the OLD one is stale (dim, Move/Copy + Add, clip-box draw). rebuild() already nulls these, but refresh3DGrid() (grid panel edits, and the plan switch setPlan now fires) reaches us without it, which would pair one sheet's grid X/Y with another's elevations.
|
|
1141
|
+
if (!api || !scene) return;
|
|
1142
|
+
// THE GRID NEEDS ITS OWN v2 PATH, and this is the one place it shows (§8.3). v1's grid is stored in the
|
|
1143
|
+
// active sheet's DISPLAY space — px, with Y growing DOWN the page — so the two conversions below are a
|
|
1144
|
+
// scale AND a reflection. v2's grid is already world mm with Y up. Handing a world-mm grid to the v1
|
|
1145
|
+
// conversion would not throw; it would draw the whole grid mirrored about Y, plausibly, at 1/12 scale.
|
|
1146
|
+
// So the read half answers with the drawable geometry AND the two facts needed to place it.
|
|
1147
|
+
let d = null;
|
|
1148
|
+
try { d = MODEL().gridDraw(); }
|
|
1139
1149
|
catch (e) { console.warn('[steel-3d] grid skipped (bad grid data)', e); return; }
|
|
1150
|
+
if (!d) return; // no grid, or the grid is switched off
|
|
1151
|
+
const { g, geo, k, flipY } = d;
|
|
1140
1152
|
if (!geo.v.length && !geo.h.length && !(geo.lines && geo.lines.length)) return;
|
|
1141
|
-
const k =
|
|
1142
|
-
const mmX = (px) => px * k, mmY = (px) => -px * k; // display → scene (Y flips)
|
|
1153
|
+
const mmX = (u) => u * k, mmY = (u) => (flipY ? -u : u) * k; // stored space → scene
|
|
1143
1154
|
const levels = geo.zs.length ? visibleGridLevels(geo.zs, g.hidden_z) : [{ mm: 0, label: '0' }];
|
|
1144
1155
|
if (!levels.length) return; // every authored Z datum is hidden
|
|
1145
1156
|
gridLevelsMm = levels.map((lv) => lv.mm); // the planes grid snapping evaluates on — same list, same order as what gets drawn below
|
|
@@ -1257,7 +1268,7 @@ let rebuildSeq = 0;
|
|
|
1257
1268
|
async function rebuild(fit = false) {
|
|
1258
1269
|
if (!api) return;
|
|
1259
1270
|
invalidatePointEntry('rebuild'); // synchronous, BEFORE the first await — the scene is changing; drop any open typed entry + stale base (never on stale async completion)
|
|
1260
|
-
clipCandidates = null; clipLevels = null;
|
|
1271
|
+
clipCandidates = null; clipLevels = null; invalidateModelCache(); // …and the clip-draw snap cache, synchronously here too (not only in buildFromScene): every edit/undo/redo funnels through rebuild(), so a draw in progress can't snap against pre-edit candidates during the async fetchScene window
|
|
1261
1272
|
if (marker && clipMode === 'box') marker.visible = false; // a model change under an armed box draw invalidates the reticle position — drop it (the next hover re-snaps)
|
|
1262
1273
|
if (fit) fitPending = true; // entering 3D re-fits; an edit-triggered rebuild keeps the camera put
|
|
1263
1274
|
const seq = ++rebuildSeq;
|
|
@@ -1773,7 +1784,7 @@ function clipBoxFrom(a, b, zlo, ztop) {
|
|
|
1773
1784
|
// the cache on every arm/disarm. A malformed member/grid degrades to no snap (raw floor), never a broken tool.
|
|
1774
1785
|
let clipCandidates = null, clipLevels = null;
|
|
1775
1786
|
function clipBoxSnapCands() { if (!clipCandidates) { try { clipCandidates = allCandidates(null); } catch { clipCandidates = []; } } return clipCandidates; }
|
|
1776
|
-
function clipBoxLevels() { if (!clipLevels) { try { clipLevels =
|
|
1787
|
+
function clipBoxLevels() { if (!clipLevels) { try { clipLevels = MODEL().levels(null); } catch { clipLevels = []; } } return clipLevels; } // model-wide: the clip box spans every sheet, so it must be able to snap to an off-sheet endpoint
|
|
1777
1788
|
// A footprint corner from the cursor: the floor point under it, PULLED to a member/grid/UCS snap when one is
|
|
1778
1789
|
// screen-near — same candidates + running-snaps filter as the Dimension / Move tools. Returns { xy:[x,y], snap,
|
|
1779
1790
|
// world } or null (ray parallel to the floor). We keep only the snap's X/Y (the corner rides the floor plane).
|
|
@@ -2022,6 +2033,15 @@ function onKey(e) {
|
|
|
2022
2033
|
}
|
|
2023
2034
|
// ---- 3D dimension tool controls (driven from the toolbar + the keyboard) ----
|
|
2024
2035
|
function toggleDimTool() {
|
|
2036
|
+
// ARMING is refused when the host says the model is read-only (unit 5, P7d). Disabling the #m3dDim
|
|
2037
|
+
// BUTTON is not enough and that was measured, not assumed: the tool also arms from a bare `d` keydown
|
|
2038
|
+
// on this view, and a DOM `disabled` only suppresses that button's own click — it says nothing about an
|
|
2039
|
+
// independent keyboard listener. Without this the user gets a live tool on a document that will refuse
|
|
2040
|
+
// its writes, which is the silent no-op the whole mode exists to avoid.
|
|
2041
|
+
if (!dimMode3d && api && typeof api.canEditModel === 'function' && !api.canEditModel()) {
|
|
2042
|
+
if (api.toast) api.toast('This model is read-only here — dimensions are coming. Ask your terminal AI to change it.');
|
|
2043
|
+
return dimMode3d;
|
|
2044
|
+
}
|
|
2025
2045
|
if (!dimMode3d) dropGridLinePick3d(); // arming the dim tool takes the left-click — cancel an armed grid-line pick through the editor first
|
|
2026
2046
|
dimMode3d = !dimMode3d;
|
|
2027
2047
|
if (!dimMode3d) { dimDraft3d = null; dimCandidates3d = null; dimPreviewLine.visible = false; marker.visible = false; readout.style.display = 'none'; canvasEl.style.cursor = 'default'; setSnapOnly3d(null); } // disarming ends the operation → the snap override reverts to all snaps
|
|
@@ -2806,21 +2826,43 @@ const memberById = (id) => { const all = (api && api.allMembers && api.allMember
|
|
|
2806
2826
|
// the ACTIVE plane's ppf/dtos, so editing an off-active-sheet member whose sheet has a different
|
|
2807
2827
|
// pt_per_ft inverted the commit through the wrong scale and wrote a mis-scaled wp — while the target it
|
|
2808
2828
|
// snapped to had been computed in the target sheet's own scale. One source ⇒ they cannot disagree.
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2829
|
+
/*
|
|
2830
|
+
* ---- THE MODEL READ HALF (unit 5, P7d) -----------------------------------------------------------
|
|
2831
|
+
*
|
|
2832
|
+
* Every geometry read this view makes goes through ONE object the host injects, so the contract VERSION
|
|
2833
|
+
* stops at that boundary instead of branching through 4,400 lines. Epic §15 answer 4: "the gate at the
|
|
2834
|
+
* ADAPTER boundary, not scattered `if (v2)` branches through the editor closure" — a branch per geometry
|
|
2835
|
+
* site is the shape this epic has rejected three times.
|
|
2836
|
+
*
|
|
2837
|
+
* The host supplies BOTH arms. steel.takeoff/v1's is today's computation, moved verbatim — the per-plan
|
|
2838
|
+
* scale index, `planScaleOf`, `memberGeometryInOwnPlan` — so v1 stays byte-identical by construction
|
|
2839
|
+
* rather than by test. steel.model/v2's answers from world-mm members and needs none of it.
|
|
2840
|
+
*
|
|
2841
|
+
* WHAT LIVED HERE AND MOVED: `activeScale`, `planList`, `scaleIndex`, `scaleFor` and the scale cache.
|
|
2842
|
+
* P5's review round 4 corrected the understatement that geoOf was a delegation — it is a seam, and those
|
|
2843
|
+
* four came with it. The cache came too, which is why `invalidateModelCache()` exists: this view still
|
|
2844
|
+
* owns WHEN the model changed (buildFromScene, rebuild, buildStructGrid), it just no longer owns HOW the
|
|
2845
|
+
* geometry is derived.
|
|
2846
|
+
*/
|
|
2847
|
+
let modelReads = null;
|
|
2848
|
+
function MODEL() {
|
|
2849
|
+
if (!modelReads) {
|
|
2850
|
+
// NAMED rather than a fallback. A host without this seam cannot be served by quietly reverting to v1's
|
|
2851
|
+
// computation: for a v2 document that would read `m.wp`/`m.col` off members that have neither and yield
|
|
2852
|
+
// NaN geometry — a scene that draws, silently, in nowhere.
|
|
2853
|
+
if (!api || typeof api.model !== 'function') throw new Error('steel-3d-view: the host supplied no api.model() — the model read half is required');
|
|
2854
|
+
modelReads = api.model();
|
|
2855
|
+
}
|
|
2856
|
+
return modelReads;
|
|
2857
|
+
}
|
|
2858
|
+
/** The model changed, or the grid did — drop whatever the read half cached off the old one. */
|
|
2859
|
+
function invalidateModelCache() { if (modelReads && typeof modelReads.invalidate === 'function') modelReads.invalidate(); }
|
|
2860
|
+
const scaleFor = (m) => MODEL().scaleOf(m); // keyed by the member OBJECT — ids are only sheet-unique
|
|
2861
|
+
// A member's WORK LINE in world mm. For v1 that is its OWN sheet's scale + default T.O.S — matching the
|
|
2862
|
+
// server bake, which resolves per-plan (contract-to-scene: per-plan pt_per_ft + `default_tos ?? 0`). Using
|
|
2863
|
+
// the ACTIVE sheet's default T.O.S put every overlay (handles, labels, reference lines) for an off-sheet
|
|
2822
2864
|
// member whose T.O.S is unset at the WRONG elevation, while its server-built mesh sat at the right one.
|
|
2823
|
-
const geoOf = (m) =>
|
|
2865
|
+
const geoOf = (m) => MODEL().geometryOf(m);
|
|
2824
2866
|
const geoMode = () => (api && api.geoMode && api.geoMode()) || null;
|
|
2825
2867
|
|
|
2826
2868
|
// ---- working plane (spec §6): session view-state grounding ALL 3D picks. null = the active plan's
|
|
@@ -2844,11 +2886,11 @@ let framePreview = null; // THREE.Group: the live X/Y rubber-band + Z-fli
|
|
|
2844
2886
|
const cloneFrame = (f) => ({ origin: [...f.origin], xAxis: [...f.xAxis], yAxis: [...f.yAxis], normal: [...f.normal] });
|
|
2845
2887
|
const _dot3 = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
2846
2888
|
const _unit3 = (a) => { const L = Math.hypot(a[0], a[1], a[2]) || 1; return [a[0] / L, a[1] / L, a[2] / L]; };
|
|
2847
|
-
function frameZ() { return frame3d ? frame3d.origin[2] : (api ?
|
|
2889
|
+
function frameZ() { return frame3d ? frame3d.origin[2] : (api ? MODEL().defaultPlaneZ() : 0); }
|
|
2848
2890
|
function effectiveWP() {
|
|
2849
2891
|
if (workPlane) return workPlane; // explicit ◇ Plane wins (unchanged)
|
|
2850
2892
|
if (frame3d) return { origin: [...frame3d.origin], normal: [...frame3d.normal], xAxis: [...frame3d.xAxis], kind: 'frame' };
|
|
2851
|
-
return { origin: [0, 0, api ?
|
|
2893
|
+
return { origin: [0, 0, api ? MODEL().defaultPlaneZ() : 0], normal: [0, 0, 1], xAxis: [1, 0, 0] };
|
|
2852
2894
|
}
|
|
2853
2895
|
// ---- Typed coordinate entry (UCS Stage 3) — the ONE authoritative point-entry frame + a generation-stamped
|
|
2854
2896
|
// lifecycle. `pointEntryFrame()` is what the tools actually follow: a ◇ Plane shadows the local frame, and
|
|
@@ -2919,7 +2961,7 @@ function setFrame3d(originMm, angleDeg) {
|
|
|
2919
2961
|
// Set a full (possibly tilted) UCS from a computed basis — the 3-click pick's output.
|
|
2920
2962
|
function setFrameBasis(basis) { frame3d = cloneFrame(basis); fireFrameChange(); }
|
|
2921
2963
|
// Numeric "Angle°" sets a HORIZONTAL frame at that in-plane angle (keeps origin) — the horizontal refine case.
|
|
2922
|
-
function setFrameAngle(angleDeg) { setFrame3d(frame3d ? frame3d.origin : [0, 0, api ?
|
|
2964
|
+
function setFrameAngle(angleDeg) { setFrame3d(frame3d ? frame3d.origin : [0, 0, api ? MODEL().defaultPlaneZ() : 0], angleDeg); }
|
|
2923
2965
|
function setFrameOrigin(originMm) { // translate origin, keep the basis orientation
|
|
2924
2966
|
if (!frame3d) { setFrame3d(originMm, 0); return; }
|
|
2925
2967
|
frame3d.origin = [originMm[0], originMm[1], originMm.length > 2 ? originMm[2] : frame3d.origin[2]];
|
|
@@ -3283,7 +3325,7 @@ function cmAxisLock(e, axisVec, base, opts) {
|
|
|
3283
3325
|
if (Math.abs(n[2]) > 0.999 && !(opts && opts.noSnap)) { // ~vertical axis → snap the elevation to a framing level (WORLD-space: in Top view all levels share one screen point); Add+Alt passes noSnap so "no snap" holds even under a lock
|
|
3284
3326
|
const tol = pxToWorldAt(SNAP_TOL_PX, base);
|
|
3285
3327
|
let best = null, bestD = tol;
|
|
3286
|
-
for (const z of
|
|
3328
|
+
for (const z of MODEL().levelsHere()) { const d = Math.abs(p[2] - z); if (d <= bestD) { bestD = d; best = z; } }
|
|
3287
3329
|
if (best != null) { t = (best - base[2]) / n[2]; p = [base[0] + n[0] * t, base[1] + n[1] * t, best]; snap = true; type = 'level'; } // re-solve t so the point stays exactly on base + t·axis
|
|
3288
3330
|
}
|
|
3289
3331
|
return { p, snap, type };
|
|
@@ -3715,7 +3757,7 @@ function onDown(e) {
|
|
|
3715
3757
|
grab: geo ? rayToPlane(e.clientX, e.clientY, planeZ) : null,
|
|
3716
3758
|
origMm: geo ? geo.line.map((p) => [p[0], p[1], p[2]]) : null,
|
|
3717
3759
|
candidates: allCandidates(ctrl ? undefined : id).filter((c) => candAllowed3d(c.type)), // member + grid snap targets (a ctrl-copy snaps to the ORIGINAL too; a move excludes itself), filtered by the running-snaps (⋯ menu → Snapping)
|
|
3718
|
-
levels:
|
|
3760
|
+
levels: MODEL().levels(m), // Alt-drag snaps to T.O.S levels across EVERY sheet, each in its own default elevation (pairing the active sheet's members with the grabbed sheet's default reported unset-T.O.S members at an elevation they are not drawn at)
|
|
3719
3761
|
mesh, meshPos0: mesh ? mesh.position.clone() : null, delta: null, mode: null,
|
|
3720
3762
|
};
|
|
3721
3763
|
} catch (err) { controls.enabled = true; pending = null; endTeklaDrag(); } // a failure must never strand orbit disabled — nor an armed drag-out holding the pointer capture, which the next movement would fire
|
|
@@ -4286,6 +4328,7 @@ function hide() {
|
|
|
4286
4328
|
function isReady() { return built; }
|
|
4287
4329
|
|
|
4288
4330
|
function dispose() {
|
|
4331
|
+
modelReads = null; // the resolved read half belongs to the host that was torn down; a re-init must ask the new one (unit 5, P7d)
|
|
4289
4332
|
endTeklaDrag(); // release the pointer capture and take the badge with us
|
|
4290
4333
|
if (rafId) cancelAnimationFrame(rafId);
|
|
4291
4334
|
if (hoverRAF) cancelAnimationFrame(hoverRAF);
|