Skip to content

feat(elements): build 2024 walls from their centreline at their type's thickness (RE-54) - #360

Merged
DrunkOnJava merged 1 commit into
mainfrom
feat/wall-bodies
Sep 24, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
feat/wall-bodies

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

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

Audit-honesty checklist

  • Status partial with the residuals above. Every count is measured against Revit's own export of the same model.
  • RE finding: report, reconnaissance addendum, and an end-to-end scorer with its inputs' hashes.
  • No emojis, private paths or personal data.

Legal and contribution hygiene

  • Apache-2.0
  • Clean-room: byte observations of wall data, and Revit's own IFC exports as oracles.
  • 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.


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.

Reviewed by Cursor Bugbot for commit 4d18785. Configure here.

…s thickness (RE-54)

The bounded line a wall's data stores (RE-49) 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, all with 1 in the word after the setting. The word is now read
with the flip (partition_compound_structure::wall_orientation).

A 2024 wall with word 1 gets its centreline and type thickness, and the
exporter builds its body from them where the record box does not already
give it: an axis-parallel wall keeps RE-26's trimmed run and keeps its
box when the box is thinner than the type (a cut wall); an angled wall is
the rectangle its box closes on, or runs joint to joint unless its box is
far wider (a leaning or profiled wall).

Scored end to end on Snowdon with rvt-gltf against Revit's IFC4 bodies:
angled walls' faces within 0.001 ft on 75 of 102 (0 before), their ends
on 13 (1 before); axis-parallel faces on 927 of 976 (918); per wall 71
better, 1,003 unchanged, 4 worse; walls drawn in layers 967 (883). Core
Interior is unchanged. tools/re/wall_bodies_vs_ifc.py is the scorer.
@cursor

cursor Bot commented Sep 24, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_29a4069d-913b-4ac8-a747-d45f639e567c)

@DrunkOnJava
DrunkOnJava merged commit 9e3e0ef into main Sep 24, 2026
22 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/wall-bodies branch September 24, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant