Skip to content

fix(railings): write no body where a railing's saved mesh is not saved #1635 - #2305

Open
puzzbobb wants to merge 1 commit into
DrunkOnJava:mainfrom
puzzbobb:feat-1635-railing-bodies
Open

puzzbobb wants to merge 1 commit into
DrunkOnJava:mainfrom
puzzbobb:feat-1635-railing-bodies

Conversation

@puzzbobb

@puzzbobb puzzbobb commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #1635. RE-509.

  • A railing whose saved mesh is not drawn is written with no body, not its record box. The 8 such railings measured (the BIM4LCA office's KAI-6 as built and at permit, 17_Rooms_Stairs_Spiral's 2, Snowdon Towers Architectural 2025's 5) had boxes holding 0.04% to 3.5% of Revit's body. Each stair holding one was 66 to 277 times Revit's volume and is now 79% to 89% of it. The exception is the spiral stair, whose flight is still a box (GCylindricalHelix). The railing keeps its placement, storey, stair, type and properties. Its BodySource is none_railing_record_box_withheld, and its SavedMeshRefusal still says why the mesh was not drawn. saved_meshes::withhold_railing_boxes runs after the saved-mesh pass, so railings of Revit 2022 and earlier (not offered a pass) have no body either.
  • The issue's open question. Revit's body of a railing is its own saved mesh. That mesh already places the rails it names in BaseRailing.m_continuousRailIds (RE-397). On the office as built it is within 1% of Revit's body on 35 of 41 railings; adding the rails' own meshes makes it 1.42 to 1.99 times Revit's. So nothing is left to add from the rails. Reading HermiteSurf (RE-460, behind RVT_2085_HERMITE_RECOVERY) does not give Revit's body for these railings either (RE-460 §7).

Evidence

Each product of main's export and this branch's, paired by GlobalId and compared on class, name, Tag, representation, properties and quantities:

model products differ
BIM4LCA office as built 13,686 1
BIM4LCA office at permit 13,714 1
17_Rooms_Stairs_Spiral 35 2
13_Rooms_Stairs 37 0
Snowdon Architectural 2025 (local only) 6,963 5
rac_advanced_sample_project 2019 5,776 22

Every product that differs is an IfcRailing that lost its box body and changed BodySource.

Tests and checks

  • New tests/railing_bodies.rs (corpus=r2025): the spiral stair's two railings have no body, are placed, carry the new BodySource and partial: unsupported surface HermiteSurf, and are counted in exported.body_sources. 13_Rooms_Stairs' two railings stay saved_graphics_mesh.
  • value_sources_offsets: COVERAGE has a NoBody row for the new source.
  • The integration suite passes with the project, BIM4LCA, R2025 and samples corpora.
  • fmt, clippy (--test integration, the probe), rustdoc, measured_numbers, api-doc-ids, changelog.py check and verify-real-files.sh --check-only pass. clippy --lib stops on src/research/partition_name_candidates.rs (enum_variant_names), which this branch does not touch.

Probe probe_1635_railing_meshes; scorers tools/re/railing_meshes_vs_ifc.py and tools/re/withheld_railings_vs_ifc.py.

DrunkOnJava#1635)

A railing whose saved mesh is partial, or whose release's saved graphics
are not read, was written as its record box: the box around its path and
height, which held 0.04% to 3.5% of Revit's body on the 8 railings
measured and, since DrunkOnJava#1626, made each stair holding one 66 to 277 times
Revit's volume. It is now written with no body, keeping its placement,
storey, stair and properties; BodySource none_railing_record_box_withheld
and SavedMeshRefusal say why.

RE-509 also answers the issue's open question: Revit's body of a railing
is its own saved mesh, which already places the rails it names in
m_continuousRailIds (within 1% on 35 of the BIM4LCA office's 41); adding
the rails' own meshes counts them twice. No other product changes.
@puzzbobb
puzzbobb requested a review from DrunkOnJava as a code owner December 6, 2026 12:33
@DrunkOnJava

Copy link
Copy Markdown
Owner

@puzzbobb, thank you. main's offline checks from the PII guard job pass on your head, and CI is running. Next, ours: a read of the change and a full Measure run on its head, with what it shows posted here.

@DrunkOnJava

Copy link
Copy Markdown
Owner

@puzzbobb, one more thing: this branch predates today's framing changes on main (#2295, #2298), so the same-project check can't pass on its head as it stands. A merge of main into the branch (not a rebase) fixes that.

@DrunkOnJava

Copy link
Copy Markdown
Owner

@puzzbobb, what the measurements show so far, before the code read, on a merge of main into your head (a scratch branch here, 9ed52cc7; run 47654744511):

  • 26 of 101 exports move: the four BIM4LCA office files (as built and at permit, concrete and timber), 17_Rooms_Stairs_Spiral, Snowdon Architectural 2024, and Autodesk's sample projects of 2015 to 2022. The same-project gates pass on 9ed52cc7.
  • On the five with a Revit export, every scorer line that moves follows from the railings' bodies: KAI-6's record-box body gone on each office file and the spiral stair's two, the same railings gone from the glTF, and the stairs that hold them:
    • the office stair 3057027: volume 911.9 ft³ (933.0 on the timber office) → 6.0 ft³ against Revit's 7.2, while the farthest of Revit's vertices from rvt-rs's surface goes from 1.19 ft to 3.94 ft, as Revit's stair carries the railing's body that is now absent;
    • the spiral stair 13535: 1,365.1 ft³ → 683.7 ft³ against Revit's 58.9, its flight's box being what's left, as your summary says; farthest vertex 1.7 ft → 3.41 ft.
  • The other 21 have no Revit export, and only their swept-solid counts were read: 22 fewer on rac_advanced 2019, the 22 railings of your table, and as many on its 2015 save. Railings of 2022 and earlier losing their box follows from your note that they get no saved-mesh pass.

Nothing stands in the way from these, beyond the merge of main. Next, ours: the code read, an element diff of one older sample to see that only railings change there, then a Measure run on the merged head.

@DrunkOnJava

Copy link
Copy Markdown
Owner

The element diff I said I'd run, on rac_advanced 2019 with the exports kept (run 47659196272, the same merge 9ed52cc7 against main): of its 5,776 products, the count your table has, the 22 railings, every railing in the file, are the only ones that differ. With the entity numbers taken out, the only lines that change are those 22 railings, their box bodies (each an extruded rectangle with its placement and shape) and their BodySource, from partition_element_record_bbox to none_railing_record_box_withheld; the diagnostics move by the same 22 (bounding-box bodies 5,160 → 5,138). None carries a SavedMeshRefusal, as you'd expect with no saved-mesh pass on a 2019 save.

@DrunkOnJava

Copy link
Copy Markdown
Owner

@puzzbobb, the code read of the two source files, which turned up nothing to change: withhold_railing_boxes runs in the one export pipeline every exporter goes through, after the saved-mesh pass, touches only railings whose BodySource is still the record box, takes their body and profile properties off, and the diagnostics are recounted after it. It meets #1635's "done when": "A railing's body is Revit's, or the railing writes no body, where the saved mesh is not whole."

Three asks, all docs, which can ride the push with the merge of main:

  1. Saved meshes switched off. The step runs whether or not the saved-mesh pass ran, so with --no-saved-meshes every railing has no body. That's consistent with the box never being right, but the changelog should say it beside the 2022-and-earlier sentence.
  2. The support-matrix entry for the thirteen product categories still says their bodies are the record bounding box, railings among them. A clause there saying railings no longer are would keep it honest.
  3. A ## Clean-room section in the description, like the one on feat(params): built-in parameters are named #1962 #2303; RE-509's own sources paragraph would do, since format findings carry it in the PR body here.

Next, yours: those and the merge of main. Ours: a held-out run on the scratch merge, going now (run 47661456894), whose kept results include the box bodies by class, since held-out saves of 2018 to 2022 may hold railings; then a Measure run on the merged head.

@DrunkOnJava

Copy link
Copy Markdown
Owner

The held-out run on the same merge (run 47661456894): 5 of 25 exports move, all saves of 2018 to 2022. In the counts it keeps, the only lines that move are railings' record boxes: 7, 14, 11 and 2 railings on four held-out models, each with its BodySource moving to none_railing_record_box_withheld, and 14 on the spent 2018 Vitoria save. Of the 41 the box scorer pairs with a Revit body, every one fills under half its own bounding box (a median of 0.2% to 3.4% by model), so none of those bodies is box-shaped; the 2020 model's 7 have no Revit element or body to pair with. Nothing else in the kept counts moves, the schema and EXPRESS-rule counts included.

This branch has not been deployed

No deployments
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.

Railings are written as record boxes, about a thousand times Revit's volume, and now sit inside their stairs

2 participants