Repository navigation
feat(elements): draw walls as their layers, each in its material's colour (RE-53) - #359
Merged
Merged
Conversation
…lour (RE-53) A wall, floor, roof or ceiling type's own element data carries its compound structure: a u32 layer count framed by ff ff ff ff and a per-release tag (or u32 k, k x 2d 00, u32 0 on 2025 floors and ceilings), then 37-byte layers of f64 width, u64 material, u64 deck and u32 function, exterior first. A material's object carries its shading colour and transparency, and a wall's data carries its location line setting and a flip flag that puts its exterior right or left of its location line. The glTF export (rvt-gltf, the viewer) now draws a Revit 2024 wall as one node per layer, cut from its body across its exterior normal, in each layer's colour, where the layers add up to the body's thickness. Scored end to end on Snowdon Towers against Revit's IFC4 per-layer solids: 883 walls drawn in layers, every layer centre within 0.001 ft on 851 of 862 comparable walls and within 0.126 ft on all, and 1,368 of 1,368 layer colours equal to Revit's surface styles. The IFC output is unchanged: layer sets wait on material names (#355). Export diagnostics gain exported.layered_element_count; the viewer's File status reports it under Materials. tools/re/wall_layers_vs_ifc.py is the end-to-end scorer; examples/probe_re53_wall_layers.rs counts the walls drawn and why the others are not (#358).
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_225bc662-6c9a-47c0-9b1a-5ce910a93fea) |
DrunkOnJava
added a commit
that referenced
this pull request
Sep 24, 2026
…s thickness (RE-54) (#360) ## Summary Revit 2024 walls are built from their centreline at their type's thickness (RE-54). The location line a wall's data stores (RE-49's bounded line) is its centreline, whatever its location-line setting. Revit's IFC4 body lies exactly half the type's layer sum (RE-53) either side of it on 964 of Snowdon Towers' 1,054 walls. The exporter now builds a wall from that line where the record box does not already give it. Angled walls were drawn as their whole axis-aligned box, and now run along their line at their real thickness. Measured end to end on Snowdon Towers (local only): `rvt-gltf`'s GLB against the bodies in Revit's own IFC4 export, before (#359) and after. | | walls | within 0.001 ft before | after | |---|---:|---:|---:| | faces, angled | 102 | 0 | 75 | | ends, angled | 102 | 1 | 13 | | faces, axis-parallel | 976 | 918 | 927 | | ends, axis-parallel | 976 | 338 | 338 | - Per wall, taking the larger of its face and end differences: 71 better, 1,003 unchanged and 4 worse. The 4 are angled walls whose ends run to the joint where Revit's butt joins stop short or run on. - Walls drawn in layers: 967 (883 before). Every layer centre is within 0.001 ft of Revit's on 935 of 946 comparable walls. - Core Interior: unchanged. Its IFC is byte-identical apart from timestamps. ## Motivation Angled walls were the worst geometry in the model: boxes up to 9 ft too thick. With RE-53's type thickness and the stored centreline, every wall has what it needs to be drawn as itself, and more walls can show their layers (#358). ## Changes - src/partition_compound_structure.rs: `wall_orientation` / `scan_wall_orientations` read the location-line setting, the word after it and the flip. They replace `wall_flip` / `scan_wall_flips`. - src/partition_schema_mvp.rs: `attach_wall_layers` also gives each 2024 wall with word 1 its centreline and its type's thickness (`m_wall_axis_*`, `m_wall_type_thickness`). `wall_axis_from_fields` reads them back. - src/ifc/export_content.rs: `wall_centreline_body`: - An axis-parallel wall keeps RE-26's trimmed run. It keeps its box if the box is thinner than the type, a wall Revit cut. - An angled wall is the rectangle its box closes on (1e-4 ft) when the box is centred on the line. Otherwise it runs joint to joint, unless the box exceeds that rectangle's by more than 2 × max(T, 1 ft), a leaning or profiled wall. - The body replaces the box only where the two differ: `BodySource` `partition_wall_centreline`, `ThicknessSource` `wall_type_compound_structure`. - tools/re/wall_bodies_vs_ifc.py: the end-to-end scorer. - reports/element-framing/RE-54-wall-bodies.md, a support-matrix row (partial), a reconnaissance addendum, README walls row, status, CHANGELOG. ## Testing End to end, against real files. No unit tests were added. - Snowdon Towers, rvt sha256 `33271010…e5e44a1`, Revit IFC4 `ecfcb04e…cbb985a`: - `rvt-gltf`, then `tools/re/wall_bodies_vs_ifc.py` and `tools/re/wall_layers_vs_ifc.py`. The report's §3 has the commands and output. - rvt-rs's IFC of Snowdon, meshed by IfcOpenShell, equals its GLB on all 1,078 walls to 1e-5 ft. - Core Interior against `IFC Exports/2024_Core_Interior_slim.ifc`: 360 of 360 faces and 351 of 360 ends within 0.001 ft, as before. The IFC output is byte-identical apart from timestamps. - fmt, clippy -D warnings, rustdoc -D warnings, the existing workspace suite, and the MSRV let-chain scan. ## What this does not do - Angled walls' ends at joints. At two-wall joints Revit butt-joins 115 of 156 end faces, which is RE-26's open wrap-or-butt question (#238). T-junctions are not found. - Walls Revit cuts or profiles (67 with word 1), and walls with word 0 or 2 (23), keep their box. - Revit 2025 walls: location lines are read on 2024 only. ## Audit-honesty checklist - [x] Status partial with the residuals above. Every count is measured against Revit's own export of the same model. - [x] RE finding: report, reconnaissance addendum, and an end-to-end scorer with its inputs' hashes. - [x] No emojis, private paths or personal data. ## Legal and contribution hygiene - [x] Apache-2.0 - [x] Clean-room: byte observations of wall data, and Revit's own IFC exports as oracles. - [x] Snowdon and its IFC stay local. ## Breaking changes `partition_compound_structure::wall_flip` / `scan_wall_flips` (added in #359, not released) are replaced by `wall_orientation` / `scan_wall_orientations`. ## Related issues Refs #358, #238. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes core IFC/glTF wall body generation and replaces partition wall-orientation APIs; behaviour is gated to 2024 walls with word 1, but export geometry and thickness metadata shift for many angled and over-wide-box walls. > > **Overview** > **Revit 2024 wall geometry** is now built from the stored location line as a **centreline** at the wall type’s **compound-structure thickness**, instead of always using the partition record’s axis-aligned bounding box. > > For walls whose orientation word is **1**, `attach_wall_layers` writes centreline endpoints and type thickness into element fields; `export_content::wall_centreline_body` turns that into a plan rectangle (axis-parallel walls keep join-trimmed run length; angled walls use box-closure or joint-to-joint rules, with fallbacks for cut/profiled boxes). The centreline body **replaces the bbox only when it differs**, tagging `BodySource` `partition_wall_centreline` and `ThicknessSource` `wall_type_compound_structure`. **RE-53 layered drawing** benefits because more walls have a body thick enough for per-layer bands. > > `wall_flip` / `scan_wall_flips` are **replaced** by `wall_orientation` / `scan_wall_orientations` (`WallOrientation`: location-line setting, word, flip). Docs, support matrix, and **`tools/re/wall_bodies_vs_ifc.py`** record Snowdon vs Revit IFC4 body comparisons. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4d18785. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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
Walls are drawn as their layers, each in its material's colour, in the glTF export and the viewer (RE-53).
With those,
rvt-gltfand the viewer draw a Revit 2024 wall as one band per layer where the layers add up to its body's thickness. All the bands select as the one wall.Measured end to end on Snowdon Towers (local only): the GLB
rvt-gltfwrites, scored against the per-layer solids in Revit's own IFC4 export.Motivation
The 3D view showed every wall as one grey block. Now a wall shows its construction: brick, sheathing, studs, gypsum, each as a band in its material's colour, where the bytes say exactly what they are. Material colours are the first step of #355.
Changes
Testing
End to end, against real files. No unit tests were added (unit tests are no longer written for this repository).
33271010…e5e44a1, Revit IFC4 sha256ecfcb04e…cbb985a:rvt-gltfthentools/re/wall_layers_vs_ifc.py. The report's §6 has the commands and the full output.What this does not do
Audit-honesty checklist
Legal and contribution hygiene
Breaking changes
None.
IfcModelgains a#[serde(default)]field, andExportedModelDiagnosticsgains one too.Related issues
Refs #355, #358, and #88 (layer thicknesses are now read; wiring them into
IfcMaterialLayerSetUsagewaits on material names), #34.Note
Medium Risk
New binary decoding and geometry splitting affect viewer/glTF wall rendering for 2024 models, but IFC export is untouched and layered drawing fails closed when layer thicknesses do not match the body.
Overview
RE-53 decodes compound wall structure from Revit partition bytes—type layer stacks, material shading colours, and wall exterior flip—and uses it in glTF and the viewer for Revit 2024 walls, not in IFC export.
New modules
partition_materialsandpartition_compound_structureread material appearance and host-type layers;attach_wall_layersattaches exterior normals and per-layer widths/colours to wall elements. That data lands onIfcModel::element_layersvia the production export path and is surfaced asexported.layered_element_countin diagnostics and the viewer File status.layered_extrusion_meshesslices extruded wall bodies into thickness bands (fail-closed when layer sum disagrees with body thickness within 0.02 ft).gltf.rsemits one scene node per layer with material colour, sharedentityIndexfor unified selection. Walls that cannot be layered still draw as a single solid.Adds
probe_re53_wall_layers,wall_layers_vs_ifc.py, and documentation/reporting updates. IFC STEP output is unchanged (noIfcMaterialLayerSetuntil material names are read).Reviewed by Cursor Bugbot for commit 2c77dad. Configure here.