Skip to content

fix(elements): a wall a floor covers in part is drawn stepped, and a cut-pair element cuts a wall's top only where it reaches it (#1067) (RE-320) - #1304

Merged
DrunkOnJava merged 25 commits into
mainfrom
re/1067-stepped-wall-tops
Nov 4, 2026
Merged

DrunkOnJava merged 25 commits into
mainfrom
re/1067-stepped-wall-tops

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

A wall that a floor, roof or footing named by its top join or a Join Geometry cut pair covers in part is drawn stepped: its own plan up to the lowest underside, and over the part of the plan the elements do not cover, convex pieces up to the next underside or the wall's top, in one SweptSolid body. Against Revit's own export of the BIM4LCA office, rvt-rs's wall top equals Revit's over the whole plan on 583 of 607 walls as built (544 before) and 571 of 589 at permit (530), and no wall that was equal moved. An element that only a cut pair names now cuts a wall's top only where it reaches the top (three walls as built, which narrows a shipped rule). RE-320, #1067.

Motivation

RE-267 (#1152) cut a wall's top at the underside of the floor its top join or a cut pair names, only where that element covers the whole plan, and left the walls it covers in part at their full height: 29 office walls as built and 26 at permit were measured stepped along the centre line or with a strip beside it, and more had a floor covering a strip beside the centre line that the centre-line measure could not see. tools/re/wall_top_cover_vs_ifc.py now compares the top across the wall as well. The remainder of #1067 (walls drawn taller than Revit's body) is the walls in section 7 of the report.

Changes

  • src/ifc/export_content/wall_tops.rs: the stepping pass. Partial covers are grouped by underside; the wall's plan (any simple polygon, broken into convex pieces) is reduced by each outline's triangles, lowest underside first; the pieces join where two make a convex piece; the body is a SolidShape::Compound of the wall's profile to the lowest underside and a PlacedExtrusion per piece. Fail closed on more than 32 pieces, an unbroken plan, shared holes and openings, and the one stub of the report's section 4. An element only a cut pair names cuts only where it reaches the wall's top (Pending, Cutter::top).
  • src/research/native_walls.rs, src/research/partition_schema_mvp/{fields,walls}.rs, src/ifc/export_content.rs: the ElementIds only a cut pair names (WallRecords::pair_only, m_wall_top_pair_only) and the constant wall_top_stepped_at_covering_floor.
  • src/ifc/body_geometry.rs, src/ifc/gltf.rs: plan_outline returns a stepped wall's first-item profile, and the glTF draws a stepped wall in its layers (layered_stepped_meshes), as it drew the extrusion.
  • tools/re/wall_top_cover_vs_ifc.py: the plan-wide comparison (Revit's body lined up across the thickness, five rows across the wall), the full-height area against Revit's, each wall's volume, each piece's share at Revit's full height and inside other walls, and the form each file draws a wall in.
  • reports/element-framing/RE-320-stepped-wall-tops.md, docs/format-reconnaissance.md, docs/status.md, docs/supported-profile.md, docs/evidence.md, docs/support-matrix.json, docs/release-1.0-criteria.md, docs/contribution-map.md, ROADMAP.md, changelog.d/fixed/1067-stepped-wall-tops.md.

Testing

Unit tests are banned in this repository; the change is shown end to end on real files.

  • tools/check-local.sh's gates: not run on the Mac (no local builds here; cargo fmt only). They ran in CI on this PR at 23b20800: fmt, clippy, rustdoc, the stable and MSRV builds with the real-file tests on four runners, the i686 job, Corpus health, IfcOpenShell validates exports, semver, docs.rs preview, PII guard and Deploy viewer all pass.

  • Verified end to end on real Revit files. The BIM4LCA office as built and at building permit (Revit 2024, CC BY-SA 4.0, pinned in research/bim4lca-measure.tsv) against Revit 24.0.5's own IFC4 exports, by tools/re/wall_top_cover_vs_ifc.py in Measure. Results (report, section 3):

    as built, before after at permit, before after
    walls drawn stepped 0 49 0 46
    top equal to Revit's along the centre line 472 480 419 426
    top equal to Revit's at every point compared 544 583 530 571
    area at the full height in rvt-rs and not in Revit (ft2) 1,915.8 238.2 1,888.1 38.1

    Checks that did not move (Measure 41741031542, both offices, main against the branch; report section 6):

    • qtos_vs_ifc and psets_vs_ifc are byte-identical. Quantities, Revit's on objects rvt-rs writes / equal / different / missing / rvt-rs's that Revit does not write: as built 39,388 / 29,448 / 1 / 9,939 / 0, at permit 39,679 / 29,762 / 1 / 9,916 / 0. Property sets: as built 45,525 / 44,163 / 1 / 1,361 / 10, at permit 45,704 / 44,339 / 1 / 1,364 / 14.
    • Qto_WallBaseQuantities on the stepped walls moved on 0 of 49 and 0 of 46: rvt-rs writes Width only; Revit also writes Length and NetVolume on every one and Height, GrossVolume, GrossSideArea and NetSideArea on 43 of 49 and 43 of 46. None is written (Revit omits Height on 6 and 3 of them, and nothing tells those apart), and none is computed from the stepped body.
    • Schema step: validate 0 findings and rules 4 findings, the same four as on main (none on an IfcWall, an extrusion or a void); the only line that differs is the count of swept solids with a distinct Position, 12,747 to 12,921 and 12,790 to 13,013. No IfcWallStandardCase; the 734 IfcMaterialLayerSetUsage and the 511 IfcRelVoidsElement are as on main.
    • layer_sets_vs_ifc, wall_layers_vs_ifc and glb_material_colours_vs_ifc are byte-identical (602 walls drawn in layers in the GLB as built): a first draft lost 44 stepped walls from that count until the glTF cut a stepped body into its layers.
    • Openings: opening_boxes_vs_ifc, openings_vs_ifc and opening_hosts_vs_ifc are byte-identical; the 14 and 16 stepped walls with openings (269 and 271) keep every IfcRelVoidsElement, and the opening heads in the meshed bodies of the 13 and 15 walls that have them are unchanged.
    • wall_heights_vs_ifc and wall_bodies_vs_ifc are byte-identical; wall_quantities_vs_ifc's candidates (nothing is written from them) move: NetVolume = rvt-rs's volume equal on 258 of 607 as built (243 before).

    The narrowed rule (RE-267's, shipped in fix(elements): cut a wall's top at the floor that covers it (#1067) (RE-267) #1152): an element that only a Join Geometry cut pair names (never the top join) cuts a wall's top only where its top is at or above the wall's. 3484876, 3490093 and 3490551 as built pass through a slab whose top is 0.984 ft below theirs, and Revit leaves their tops whole; cutting them put rvt-rs 19.5 ft2 lower than Revit's body. Of the 23 office walls as built whose cut-pair element the first draft used, 20 reach the wall's top and Revit cuts them, 3 do not and Revit leaves them; at permit 10 of 10 reach. The 64 and 70 walls RE-267 cuts whole are unchanged: every wall not drawn stepped has the same meshed volume and the same highest and lowest points as on main.

    Reproduce with the commands in the report's section 8, naming b23adf4fbc99d56f45a46f1772139e5fb0c7235f.

  • Exporter change: Core Interior, RE1 Architecture and the 24 R2025 models export byte for byte as before (Measure 41737388173), so no witness replay is owed. Measure 41741013741 (-f nordic=true -f r2025=true -f samples=true -f holdout=true, 111 models, the branch at b23adf4f against main at 4ad28023): 94 export hashes are identical (Core Interior, RE1 Architecture, Einhoven, the 24 R2025 models, 17 of 18 held-out); 17 differ: the two offices, 14 Autodesk sample projects (counted: no Revit export to score against; swept solids +0 to +7, +94 on Snowdon architectural) and the held-out AA-SingleDwellingHouse-RVT-CIADD, whose summary counts are unchanged. Diagnostics are byte-identical on all 93 models that have them, and qtos_vs_ifc, psets_vs_ifc, layer_sets_vs_ifc, wall_layers_vs_ifc, the opening, wall_bodies_vs_ifc and wall_heights_vs_ifc scorers are byte-identical on every model with a Revit export. The only scorer output that moves is schema.txt's swept-solid count.

  • Performance: not a performance change.

Audit-honesty checklist

  • README / docs reflect the current state after this PR: docs/status.md, docs/supported-profile.md, docs/evidence.md, docs/support-matrix.json, the 1.0 criteria page, the contribution map and the roadmap no longer say a partly covered wall keeps its full height.
  • Changelog fragment changelog.d/fixed/1067-stepped-wall-tops.md.
  • A limitation resolved: walls a floor covers in part. A new one, in the PR and in the report: the walls whose layers Revit ends at different heights (the KS walls 1347198 to 1347201), a top cut at a height no join names, the gaps and ends of the 78 walls as built (127 at permit) no floor reaches, and one wall as built (3004978) whose 0.0243 ft2 stub inside an abutting wall Revit cuts and rvt-rs does not.
  • Commit messages describe what changed and why.
  • No emojis, no private paths or personal email addresses.
  • Reverse-engineering finding: a reproducible probe (probe_1067_native_dump, tools/re/wall_top_cover_vs_ifc.py) and a dated addendum to docs/format-reconnaissance.md.

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0.
  • The changes in this PR are based on public byte observations of the BIM4LCA files (CC BY-SA 4.0) and of Revit's own IFC4 exports of them, and the buildingSMART IFC4 specification. I have not used Autodesk SDK source, ODA SDK source, leaked internal documentation, NDA material, or decompiled internal Revit implementation code beyond public symbol exports, and I have not copied or translated code from revit-ifc.
  • No test fixtures are added.

Breaking changes

None. WallRecords (behind unstable-research) gains a pair_only field.

Screenshots or output samples

Wall 1341937 as built, 0.435 m thick, whose floor covers 0.15 m of the thickness (metres): the wall's profile to 3.45 m, and over the other 0.285 m one piece standing on it for 0.45 m.

#10233=IFCEXTRUDEDAREASOLID(#10232,#21,#19,3.450000);
#10247=IFCAXIS2PLACEMENT3D(#10244,#10245,#10246);
#10248=IFCEXTRUDEDAREASOLID(#10237,#10247,#19,0.450000);
#10249=IFCSHAPEREPRESENTATION(#22,'Body','SweptSolid',(#10233,#10248));

Related issues

Refs #1067: the 29 and 26 office walls a floor covers in part now have Revit's top; the walls whose top differs where no floor reaches (wall ends, openings at the top, layered finish heights) stay open there.

…an and lists how each file draws a wall (#1067) (RE-320)
…its top at the floor's underside over the part the floor covers (#1067) (RE-320)
…e volume of each wall and lists the pieces of a stepped one against Revit's (#1067) (RE-320)
…s across the wall's thickness and says where each piece is (#1067) (RE-320)
… wall under floors at several undersides steps at each (#1067) (RE-320)
…hs measured kept and cut is left as it was (#1067) (RE-320)
…e narrowest wider piece measured kept (#1067) (RE-320)
…inside another wall is left as it was (#1067) (RE-320)
… lies outside the floor, so that it moves none of the walls whose small pieces Revit keeps (#1067) (RE-320)
…red against Revit's export, and the open cases are listed (#1067) (RE-320)
…export, the held-out house's hash, the schedule's empty columns, the GLB tops, a partly lower cover) and reproduces with --ref main (#1067) (RE-320)
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 4, 2026 01:01
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) November 4, 2026 01:01
@DrunkOnJava
DrunkOnJava merged commit 8da11da into main Nov 4, 2026
28 checks passed
@DrunkOnJava
DrunkOnJava deleted the re/1067-stepped-wall-tops branch November 4, 2026 01:08
DrunkOnJava added a commit that referenced this pull request Nov 4, 2026
…d one whose corners do not lie in the wall's plane is left out (#1165) (RE-321) (#1310)

## Summary

Follow-up to #1305 from its second read, which came back after #1305 had
landed. #1305's openings took only walls drawn as one extrusion, so in a
wall #1304 (RE-320) draws stepped, which #1305's Measure run predates, a
rectangular wall opening was left out without a word. A stepped wall
keeps its whole prism as `extrusion`, and an opening voids every piece
of its body (#1304's review checked this with IfcOpenShell), so
`host_of` now accepts a wall whose `BodyHeightSource` is
`wall_top_stepped_at_covering_floor`. An opening whose corners spread
across the wall by more than 0.02 ft is now left out, which also fails
closed on a wall whose axis was not read. The contribution map no longer
says curtain-wall cuts and fire hose cabinets are written: #1305
withholds them.

## Changes

- `src/ifc/wall_cut_openings.rs`: `is_stepped`; `host_of` accepts
stepped walls; the plane-spread check.
- `docs/contribution-map.md`: the #1165 row.
- `changelog.d/fixed/1165-stepped-wall-openings.md`.

## Testing

Unfiltered Measure on this head against `main` (cited below once in):
the office's rectangular openings must stay 30 of 30 as built and 24 of
24 at permit, extras unchanged, every other model byte-identical.

## Legal and contribution hygiene

- [x] Apache-2.0; no Autodesk proprietary content.

## Related issues

Refs #1165.
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Automated Claude Code review (the maintainer's review agent; it read the code and Measure runs 41741031542 and 41741013741): no blocking items. On both office files no wall that was equal before is unequal after (plan-equal walls 544 to 583 and 530 to 571). Every stepped wall's pieces lie inside its plan. An opening across a step cuts every piece, which IfcOpenShell confirms on a synthetic opening. The other exports are byte-identical. Fixed in d37e5c5: the report now says what it does not measure. That covers Snowdon's Revit export, which is local only; the held-out house's moved hash, whose cause is inferred; the schedule columns a stepped wall leaves empty; and a partly lower cover, which is drawn at the lowest underside as before.

DrunkOnJava added a commit that referenced this pull request Nov 4, 2026
…ed, where both office files keep every rectangular opening (#1165) (RE-321) (#1313)

## Summary

RE-321's office figures were measured before RE-320's stepped wall tops
(#1304) landed. #1310 then made the openings pass accept a stepped wall
as a host. This adds #1310's own run to the report, as the second read
of #1310 asked. Measure 41758561091, on both office files at cc085b4:

- **Openings:** 30 of 30 as built and 24 of 24 at permit, with box,
GlobalId, name, type, both `Reference`s and Depth equal.
- **Extras:** 17 and 16 extras plus the one counted apart, the same Tags
as in run 41748430211.

## Testing

- `tools/ci/api-doc-ids.py` passes. Docs only.

## Legal and contribution hygiene

- [x] Apache-2.0.

## Related issues

Refs #1165, #1310.
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