Repository navigation
fix(ifc): a profile-edited wall whose profile closes below its record box ends at the profile's highest point, and its Height is the profile's (#1600) (RE-378) - #1604
Merged
Conversation
DrunkOnJava
marked this pull request as ready for review
November 9, 2026 12:42
… box ends at the profile's highest point, and its Height is the profile's (#1600) (RE-378) The BIM4LCA office's terrain files hold wall 1387731, whose edited elevation profile closes 3.6765 ft below its record box over its whole length. Revit's body ends at the profile's highest point; rvt-rs's profile openings are cut from the profile's own bounding rectangle and left the strip up to the box solid, and its Qto Height was the box's.
… the rule that follows from its profile (#1600)
DrunkOnJava
force-pushed
the
fix/1600-profile-top
branch
from
November 9, 2026 12:44
0a48a7c to
dcf9976
Compare
DrunkOnJava
added a commit
that referenced
this pull request
Nov 9, 2026
…oint list the profile's sketch as their sources (#1607) (RE-380) The second CI of the pull request left one Corpus health failure: Core Interior's wall 55840 carries ProfileCutSource and no ProfileStubSource, so no noted sketch source was listed for it (the provenance table lists the noted sources of the readers a written *Source value names, and the office's walls had the stub's) and the offsets test's Sourced row found none. ProfileCutSource, and ProfileTopSource of #1604, which no tested model writes, are drawn from the profile's sketch as RE-358's stub is; both have the row. The unit test of 55840's polygon took the area's sign from a wall that runs toward -y, where counter-clockwise along the wall is clockwise in (y, z).
DrunkOnJava
added a commit
that referenced
this pull request
Nov 9, 2026
…oint list the profile's sketch as their sources (#1607) (RE-380) The second CI of the pull request left one Corpus health failure: Core Interior's wall 55840 carries ProfileCutSource and no ProfileStubSource, so no noted sketch source was listed for it (the provenance table lists the noted sources of the readers a written *Source value names, and the office's walls had the stub's) and the offsets test's Sourced row found none. ProfileCutSource, and ProfileTopSource of #1604, which no tested model writes, are drawn from the profile's sketch as RE-358's stub is; both have the row. The unit test of 55840's polygon took the area's sign from a wall that runs toward -y, where counter-clockwise along the wall is clockwise in (y, z).
DrunkOnJava
added a commit
that referenced
this pull request
Nov 9, 2026
…ts openings are the pockets of the profile against its convex hull, as Revit's export writes them (#1607) (RE-380) (#1608) ## Summary A wall with an edited elevation profile now carries the openings Revit's export writes for it, the pockets of the profile against its convex hull, and the rest of its profile's cut is made in its body. RE-151 read the profile as the box less one opening for each run of its lines that leaves its bounding rectangle; that matched Revit's export on one wall of the five Revit 2024 files (Core Interior's 55840), wrote an opening Revit does not write on ten more, and missed the one Revit writes on the terrain wall 1387731. Rebased onto `main` after v0.17.0 (`495b212c`); ships in 0.18.0. Six commits, squashed on merge: the pockets and the cut, the closure through the rectangle's corner, the value sources, a witness refresh that the redesign reverts, the redesign after Snowdon Towers (below), and the report's measurements (docs only, after the measured commit). ## Motivation #1607, found by #1600's Measure. Revit's export writes an opening for a profile-edited wall only for each pocket of the profile against its convex hull, none on a straight sloped top. Measured on the 27 walls with sketch lines in six files (the five Revit 2024 files with Revit's export, and Autodesk's Snowdon Towers Architectural with Revit's own IFC4 export of it, local only, counts only here): the rule predicts 16 pockets on 10 walls; Revit's export holds the 15 it exports with the pocket's polygon, and no opening on the other 17 walls. The Tag is the first line of the pocket's stretch on 12 of the 15; on the 3 of one Snowdon wall (698364) Revit names the last line and nothing read says why (RE-380 section 5, with what was checked). The report is RE-380. What Snowdon Towers changed in the design: a region RE-151 reads that a pocket equals (55840 and 4 of Snowdon's 7 walls with pockets) was both cut in the wall's body and written as the pocket's opening, and IfcOpenShell 0.9.0.post1 then evaluates the body of Snowdon's wall 698311 as the uncut box. Such a region is now the pocket: the wall keeps its box and the pocket is written in its place, so Core Interior's export is byte-identical to main's apart from the two timestamps (checked on the CI-built binaries). The Tag was the highest id of the stretch, fitted to three walls, and is right on 6 of the 15; the first line is right on 12. ## Changes - `src/research/partition_schema_mvp/walls.rs`, `fields.rs`: `elevation_profile_pockets` (the loop, its convex hull, the stretches the hull cuts off, tagged with the first line of the stretch in the loop's counter-clockwise walk, closed by the hull's edge or through the profile rectangle's corner where the edge cuts it off, as Revit closes Core Interior's 55840: 301.65 ft2, where the stretch and the edge hold 71.23; a pocket whose edge ends at a corner with the other end on a side it does not share is not written, and none of the 26 pockets of every Revit 2024 file in the corpus has one), `profile_pockets_from_fields` and the field `m_profile_pocket_<k>`, kept with the wall's openings on Revit 2024. `profile_loop` is `elevation_profile_cuts`'s chaining of the lines into one loop, shared. Fast failure-first tests of the pure function sit next to it. - `src/ifc/entities.rs`: a variant `WallProfilePocket`, at the end of `IfcEntity` (non-exhaustive). - `src/ifc/export_content.rs`, `export_content/wall_profile.rs`, `wall_tops.rs`, `src/ifc/mod.rs`, `step_writer.rs`: the passes keep working on RE-151's regions as before. After every pass that reads a wall's body or openings, `cut_profiles_from_bodies` deals with each region: one a pocket equals (`same_outline`: the same corners in the same order from some corner on, within 0.001 ft) is that pocket, the wall keeps its box and the pocket's opening is written in its place; any other region is taken out of the wall's body as one `IfcBooleanResult` difference (extruded through the wall, 0.01 ft wider each side) and written as no opening, and the wall's pockets are its openings. A wall it cannot do this for keeps its regions as its openings, as before. `ProfileCutSource` `wall_profile_cut_in_body` says a cut was made in the body, counted in `exported.wall_profile_cuts`. - `tools/re/unfilled_openings_vs_ifc.py` compares the volume of each opening's mesh (0.01 %): its boxes and corner sets are the same for a pocket closed either way, which the first commit's CI showed (the test of #227 reads the area). `tests/value_sources_offsets.rs` and `element_provenance.rs`: `ProfileCutSource` has its row and its readers, sourced from the sketch lines as `ProfileStubSource` is. - `docs/export-diagnostics.md`, `docs/schemas/export-diagnostics.schema.json`, `tools/re/wall_rule_counts.py`, `changelog.d/fixed/1607-profile-openings-are-hull-pockets.md`, the report RE-380 and a dated addendum to `docs/format-reconnaissance.md`. ## Testing Unit tests are banned in this repository; the one exception is a pure helper, and `elevation_profile_pockets` and `same_outline` (no I/O) have fast failure-first tests next to them. The change itself is shown end to end on real files: - [x] `full / CI passed` on the final head (`2a199c92`) - [x] Verified end to end on real Revit files: an unfiltered Measure with every flag and `holdout=true` against `main` (`495b212c`), run [42642004630](https://github.com/DrunkOnJava/rvt-rs/actions/runs/42642004630) on `14ae0999` (the one commit after it changes docs only). Six exports move (the office as built and at permit, the two terrain files, `rac_basic`, Snowdon Towers Architectural); Core Interior's and the 18 held-out models' do not. On the office the unfilled openings written that Revit's export does not go from 8 to 0 on each file and those both write do not change; on each terrain file the one opening Revit writes now pairs, with box within 0.01 ft and volume within 0.01 %, and the two extras are gone; no scorer of a wall's body, top, height, ends or layers moves on any model. `same-project gates` is success on `14ae0999`: 15 samples held to their earlier saves, and the Areas on 4 saves and on the 2021 save. Locally, on the CI-built binaries: Core Interior's IFC is main's apart from two timestamps, and Snowdon's nine profile walls have main's mesh volumes. The numbers are in RE-380 section 4. - [x] If this touches the IFC exporter: the witness verdicts replay. Core Interior's export is unchanged (the redesign leaves wall 55840 as it was), so no observation is refreshed; the two witness files are main's. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR: the diagnostics table and schema. - [x] A user-visible change has its entry as a fragment under `changelog.d/fixed/`. - [x] If a limitation was resolved, the docs are updated: with the report and the Measure. - [x] If a new limitation was introduced, it is documented in the PR body and in-code: the rule is read from 27 walls, 9 of which have an opening in Revit's export; the Tag of 3 openings on one wall is another line than Revit's; a wall the cut cannot be made for keeps its regions as its openings; a cut body with an overlapping opening can evaluate wrong in IfcOpenShell (the redesign avoids the one case measured). - [x] Commit messages describe what changed and why - [x] No emojis in code, docs, or commit messages - [x] No private paths, personal email addresses, or internal jargon in committed files - [x] Reverse-engineering finding: the report RE-380 and a dated addendum to `docs/format-reconnaissance.md`. ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 (see `CONTRIBUTING.md`) - [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content (see `CLEANROOM.md`). Contributor declaration: every fact here comes from byte observations of the BIM4LCA office's files (CC BY-SA 4.0), Autodesk's Core Interior and Snowdon Towers samples and Autodesk's sample projects, with Revit's own IFC4 exports of the first three, and from reading Autodesk's open-source exporter (`WallExporter.cs`, `BodyExporter.cs`) for what Revit's export writes; the rule inside its native clipping call is closed and was measured, not read. No Autodesk or ODA SDK source, disassembly, leaked document or NDA material was used, and nothing was copied or translated from revit-ifc. - [x] No new test fixtures ## Breaking changes None to the stable API: `IfcEntity` (non-exhaustive) gains a variant at its end and `ExportedModelDiagnostics` a field with `#[serde(default)]`. The IFC output changes: a profile-edited wall's openings are Revit's, and the rest of its profile's cut is a boolean difference in its body. ## Related issues Closes #1607. Refs #1600, #1604 (the top at the profile's highest point), #1473 (RE-358's stubs).
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
A wall whose edited elevation profile closes below its record box now ends at the profile's highest point, and its
Qto_WallBaseQuantities.Heightis the profile's. The BIM4LCA office's terrain files hold one such wall, 1387731: Revit's body ends at 196.5223 ft where rvt-rs drew the box's 200.1988 ft, and Revit writesHeight4.4 m where rvt-rs wrote 5.520605 m. The rule rests on that one wall (two files), so it is as narrow as the wall allows.Motivation
#1600, found while measuring #1067's last piece (#1596): the wall has no top join and no cut pair, so no floor, roof or footing was ever going to cut it. Its record holds an elevation profile, a closed loop of seven lines from the base up to a falling top, and the profile's highest point is Revit's top. rvt-rs's openings (RE-151) are cut from the profile's own bounding rectangle, so the strip between that rectangle's top and the box's top stayed solid (3.6765 ft over the whole 173.9 ft), and the quantity took the box's height. The probe is
probe_1067_native_dump(Measure 42608767799); the findings are in the comment on #1600.Changes
src/research/partition_schema_mvp/fields.rs,walls.rs:m_profile_height, the lowest and highest height of a profile's lines, kept with the wall's openings on Revit 2024 (WALL_PROFILE_TOP_REVIT_VERSIONS, its own list).src/ifc/export_content/wall_profile.rs,export_content.rs:take_top_at_profilelowers the extrusion to the profile's highest point where the record names nothing joined to or cutting the wall, the profile spans the whole wall within a thousandth of a foot and starts at its base, and its highest point lies below the box's top; the wall then carriesProfileTopSource(wall_top_at_profile_top). It runs before the quantities, soHeightfollows.top_at_profileis pure and has unit tests of its failure modes next to it. A wall that goes on past its profile keeps the box's top:rac_basic's wall 493612, whose box holds the profile's line carried on (RE-358), is why full span is a hard condition.src/ifc/mod.rs,docs/export-diagnostics.md,docs/schemas/export-diagnostics.schema.json,tools/re/wall_rule_counts.py:exported.wall_profile_top_sources, so every Measure run shows the count on every model, held-out ones included (wall rules: profile top sources).changelog.d/fixed/1600-profile-edited-wall-top.md; the report RE-378 (the wall, the rule, the Measure's results and how to reproduce them) and a dated addendum todocs/format-reconnaissance.md.Testing
Unit tests are banned in this repository; the one exception is a pure helper, and
top_at_profile(no I/O) has eight fast failure-first tests next to it (a profile short of an end, starting above the base, as high as or above the box, with no height, on a turned wall and one longer in depth, and non-finite numbers). The change itself is shown end to end on real files:full / CI passedon the final head (the full set runs once the PR is ready)holdout=true(42614629885, 118 models,8a5b2225againstb969296e). Only the two terrain exports moved. Wall 1387731's top is Revit's 196.5223 ft and itsHeightequal (4.4 m); base and top are Revit's on 1,560 of 1,560 walls of the five Revit 2024 files with Revit's export (1,558 before);diagnostics.jsondiffers on every model that keeps one by the newwall_profile_top_sourcesalone; the 25 held-out, BIMcollab andrac_advancedmodels' counts are identical;same-project gatespass. The rebase ontomainatf0842b30changed the commits' SHAs, so the run was repeated on the headdcf9976d(42621509872): the same two exports moved, the same diagnostics differ, andsame-project gatespass on the head.ifc.sha256equal), so its witness observations need no refresh.Audit-honesty checklist
changelog.d/fixed/.docs/format-reconnaissance.mdcome with the Measure.Legal and contribution hygiene
CONTRIBUTING.md)CLEANROOM.md). Contributor declaration: every fact here comes from byte observations of the BIM4LCA office's terrain files (CC BY-SA 4.0) and Revit's own IFC4 exports of them. No Autodesk or ODA SDK source, disassembly, leaked document or NDA material was used, and nothing was copied or translated from revit-ifc.Breaking changes
None.
ExportedModelDiagnostics(#[non_exhaustive]) gainswall_profile_top_sources, with#[serde(default)].Related issues
Closes #1600. Refs #1067 (the terrain residual it split off) and #1607 (the unfilled openings RE-151's rule writes on these walls and on the office's, which this PR does not move).