Repository navigation
feat(viewer): draw doors and windows from their saved meshes, with a toggle - #1150
Merged
Merged
Conversation
…ifc does Since 0.11.0 rvt-ifc and rvt-gltf draw the doors and windows of Revit 2023 to 2027 files from their saved meshes; Python's write_ifc() and rvt_to_ifc() kept their bounding boxes, so the 0.11.0 wheel's IFC differed from the CLI's for the same file. Griffin decided on 2026-10-30 that Python and the viewer follow the CLI's default. rvt::ifc::saved_meshes::default_scope now holds the default (doors and windows on Revit 2023 to 2027) for every caller; rvt-ifc and rvt-gltf use it unchanged. Python's write_ifc(), rvt_to_ifc(), export_diagnostics(), export_diagnostics_json() and rvt_to_ifc_diagnostics() take saved_meshes=True, attach the meshes and recount the diagnostics as rvt-ifc does; False keeps the boxes, and a RuntimeWarning says when the saved graphics could not be read.
…toggle Since 0.11.0 rvt-ifc and rvt-gltf draw the doors and windows of Revit 2023 to 2027 files from the meshes Revit saved for them; the viewer still drew their bounding boxes, so what it showed, exported as glTF and exported as IFC differed from the command line's for the same file. Griffin decided on 2026-10-30 that the viewer follows the CLI's default, with an opt-out, and that its memory and load time are measured in Playwright on the reference models before it lands. rvt-wasm: openRvtBytesWithDiagnosticsMode attaches the default saved meshes after the export, and the options of openRvtBytesWithDiagnosticsModeAndOpenLimits gain savedMeshes (default true; false keeps the boxes). When the saved graphics cannot be read the model keeps its boxes and the diagnostics carry a warning. No binding is added and no signature changes. Viewer: File status has a "Draw doors and windows from saved meshes" option, on by default; changing it reopens the open file, and ?savedMeshes=0 starts with it off. The worker reports the open's cost (the wasm open call, the wasm memory after the parse, the worker heap) and the viewer keeps it with the load time on #status. The Shapes row says how many bodies came from saved meshes. tests/saved-meshes-measure.spec.ts opens each reference model with the option on and off in a fresh browser context, asserts behaviour (off draws none, on draws only doors and windows and replaces boxes one for one, and the toggle reopens the file), and writes the figures to measurements/saved-meshes.json and the job summary. Deploy viewer runs it alone after the suite and uploads the JSON.
…d put the measured cost in the changelog performance.memory does not exist in a dedicated worker, so the worker heap column of the saved-mesh measurement was null on every model (Deploy viewer run 41072412126). The wasm memory, the load time and the page heap stay. The changelog fragment now carries the measured cost of the saved meshes.
Owner
Author
|
Owner review. After the update onto main (#1146 has landed), the diff is the viewer change alone:
Nothing to fix. |
DrunkOnJava
marked this pull request as ready for review
October 30, 2026 15:07
DrunkOnJava
enabled auto-merge (squash)
October 30, 2026 15:07
Open
2 tasks
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The browser viewer draws the doors and windows of Revit 2023 to 2027 files from the meshes Revit saved for them, as
rvt-ifcandrvt-gltfdo by default, with a "Draw doors and windows from saved meshes" option in File status that keeps their boxes. Its memory and load time are measured in Playwright on the reference models (below).Stacked on #1146: the first commit is that PR's (
default_scope, the Python package) and shows here until it lands. This PR's commit is the second.Motivation
Since 0.11.0 the CLIs draw doors and windows from their saved meshes, so what the viewer showed and exported (glTF and IFC) differed from the command line's for the same file. Griffin decided on 2026-10-30: "Python and viewer follow the CLI default, with an opt-out; the viewer's memory and load time are measured in Playwright on the reference models before it lands."
Changes
rvt-wasm/src/lib.rs:openRvtBytesWithDiagnosticsModeandopenRvtBytesWithDiagnosticsModeAndOpenLimitsattach the default saved meshes after the export (ifc::saved_meshes::default_scope,attach_scoped_with_control, thenrecount_exportedandrecord_unread_streams, asrvt-pydoes). The options object gainssavedMeshes?: boolean(default true; false keeps the boxes and skips the pass). When the saved graphics cannot be read the model keeps its boxes and the diagnostics carry a warning. No binding added, no signature changed (tools/ci/wasm-api.py compatanddocspass).viewer/index.html,src/main.ts,src/styles.css: the option in File status, on by default, on the existing checkbox style; changing it reopens the open file withsavedMeshesand the file's own limits (a large-model retry stays large-model); it is disabled while a file loads.?savedMeshes=0starts it off. The Shapes row says how many bodies came from saved meshes.viewer/src/worker.ts: reports what an open cost (the wasm open call, the whole worker, the wasm memory after the parse, the worker heap);main.tskeeps it with the load time indata-load-statson#status.viewer/tests/saved-meshes-measure.spec.ts,playwright.config.ts,.github/workflows/deploy-viewer.yml: the measurement (below). It runs alone (RVT_VIEWER_MEASURE=1, one worker) after the suite, and the JSON is uploaded as theviewer-saved-meshes-measurementartifact.docs/viewer-api.md,viewer/README.md,changelog.d/changed/viewer-saved-meshes.md.?savedMeshes=0differs from?maxStreamBytes=on purpose: the limits describe one file and apply to the first open only, but the option is a visible toggle, which would otherwise turn itself back on after one file. It applies to every open until the toggle is changed.Testing
Unit tests are banned in this repository: none added. No local build or test runs (the repository's rule); GitHub's runners are the gate.
tools/check-local.shpasses: not run locally (the repository's rule);CI passedis greentests/saved-meshes-measure.spec.ts(reproduce:RVT_VIEWER_MEASURE=1 pnpm exec playwright testinviewer/, or run Deploy viewer); the table below is its outputMeasurement
From Deploy viewer run 41072412126 at 60f0c44 (the second commit only drops a column and edits the changelog fragment). Chromium 156 on GitHub's ubuntu-24.04 runner (4 CPUs), one open per setting, each in a fresh browser context, the setting order alternating by model.
tests/saved-meshes-measure.spec.tsran alone after the suite; its JSON is theviewer-saved-meshes-measurementartifact of that run.Load is the click to the loaded model as the viewer measures it; open is the wasm open call alone, where the saved graphics are read; wasm is the linear memory after the whole parse (it only grows, so it is the peak against the 4 GiB a tab can hold); page heap is the main thread's JavaScript heap after the load.
Audit-honesty checklist
docs/viewer-api.md,viewer/README.md); the root README's v0.11.0 list is left alonechangelog.d/changed/viewer-saved-meshes.mdLegal and contribution hygiene
Breaking changes
None. The wasm bindings keep their signatures;
savedMeshesis an optional field of the options object, and the viewer is the only caller.Screenshots or output samples
The measurement above. The option sits under the status panel in File status.
Related issues
Refs #1146.