Repository navigation
feat(ifc): write an Area's Qto_SpaceBaseQuantities.Height from its body - #1756
Closed
DrunkOnJava wants to merge 1 commit into
Closed
DrunkOnJava wants to merge 1 commit into
DrunkOnJava wants to merge 1 commit into
Conversation
Owner
Author
|
Superseded by #1777: the same change on a fresh branch on today's main, with the measured rows in its body. |
7 tasks done
7 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Nov 12, 2026
…ght (#1016) (#1783) ## Summary Revit's IFC4 export of the BIM4LCA office as built writes `Qto_SpaceBaseQuantities.Height` on 308 minus 44 family-instance spaces; rvt-rs writes it on the 234 rooms and on none of the 30 Areas. This change writes an Area's `Height` as the height of its body, from its Level up to the Level above, on Revit 2024 to 2027, and leaves a Revit 2015 to 2023 Area without one, since no export of that release's Area height is measured. ## Evidence **The task is real and still open.** `docs/rooms.md:134` lists exactly this value under "What is not measured" for Areas ("which Revit writes on an Area and rvt-rs does not yet"), and the Areas row of `docs/support-matrix.json` says the same. No issue closes it against us: #1016 is the open W7 quantity umbrella and puts the remainder on #1046, #1165, #1203 (closed, columns), #1207 (spaces' `GrossVolume`, stepped rooms' `NetVolume`, Revit 25's area quantities), #1208 and #1209, none of which names an Area's height; #763 is closed and is about the 44 family-instance spaces. `RE-317` §2 measured the value as the same number as the Area's extrusion depth on all 30 Areas of both office files, and `RE-324` §"not measured" leaves it out for 2015 to 2023. Nothing in the code or docs is a decision against writing it. **Where the 14 are.** From `qtos_vs_ifc.txt`: `Height: 248, equal 234, different 0, missing 14`, `on IfcSpace x14`, and 6 more "on a repeated key, against the object held: missing 6"; `rvt-rs quantities Revit does not write: 0`, so rvt-rs writes `Height` on exactly 234 spaces. `space_kinds_vs_ifc.txt` splits the 308 `IfcSpace` into 234 rooms, 30 Areas and 44 family instances. In `revit.ifc` a family-instance space's `Qto_SpaceBaseQuantities` holds `GrossVolume` and `NetVolume` and no `Height` (e.g. `#787354`), while every one of the 30 Area spaces carries a one-quantity `Qto_SpaceBaseQuantities` that is an `IfcQuantityLength('Height',…)` equal to that Area's `IfcExtrudedAreaSolid` depth (e.g. `#69195`, height `3399.9999999999982` and depth `3399.9999999999982`). The Areas are `GFA 250mm` 1-5, `GFA` K/1/2/3/P/4/5, `BUSINESS SPACE` LIIK1, `OFFICE` TSTO1-TSTO11 and `HEATED NETAREA` K/1/2/3/4/5a. `tools/re/qtos_vs_ifc.py` keys a space by its `Name` and counts a repeated key apart: the 6 names shared by two or three Areas (1, 2, 3, 4, 5, K) are exactly its 6 "repeated key" heights, and the 14 missing are the 14 uniquely named Areas — LIIK1, TSTO1 to TSTO11, P and 5a. There are no other `IfcSpace` without `Height` in the office's export. **The rule.** rvt-rs already holds the number: a drawn Area carries `AREA_BODY_HEIGHT_FIELD` (`m_area_body_height`), the elevation of the next building story less its Level's (`RE-317`), and extrudes its body by it. Against Revit's own `Height` in the same file the two agree inside the census's 1e-5 relative tolerance: area `1` 3.400000 m against 3399.9999999999982 mm, TSTO5 3.950000 against 3949.9999999980364, 5a 5.970000 against 5970.0000000000118. So an Area that rvt-rs draws gets that number; an Area it refuses keeps none. A room and a family-instance space are untouched (`ROOM_HEIGHT_FIELD` is read unchanged, and neither kind has an Area field). **What stays out, and why the releases are gated.** A given Revit release's export is the oracle only where it exists: the Area height is measured on Revit 2024 (the office, both files, 30 of 30). Revit 2025 to 2027 Areas hold the same body height as that save — the same-project gate compares it, with `lowest and highest vertex`/`height` in `tools/re/areas_across_saves.py` — and `revit-ifc` takes the height from the Level distance for every release (cited in `RE-317` §2), so they are written too, labelled like the Areas themselves. A Revit 2015 to 2023 Area keeps none: the only export of one is an IFC2X3 export whose quantities are not measured (`RE-324`). The gate cannot be 2024 alone: `tools/re/readers_across_saves.py` compares the sample projects' saves from `FIRST_YEAR = 2024` against the 2025 save and fails a property written here and not in the reference, and `Qto_SpaceBaseQuantities.Height` is in its `ADDED` list. An Area that rvt-rs refuses a body for still has no `Height`, so on a project where Revit writes one on a refused Area the value stays missing, not wrong. ## Changes - `src/research/partition_area_records.rs`: `AREA_SPACE_HEIGHT_FIELD` (`m_area_space_height`) and `AREA_HEIGHT_REVIT_VERSIONS` (`2024` to `2027`), and a drawn Area's `body.height_feet` is pushed under the new field on those releases only. - `src/ifc/export_content.rs`: `add_space_height` takes that field as well as `ROOM_HEIGHT_FIELD` and writes it as `Qto_SpaceBaseQuantities.Height`. - `docs/rooms.md` (the room sentence and the unmeasured bullet), `docs/supported-profile.md` (the space quantity sentence) and the Areas row of `docs/support-matrix.json`: an Area's height is written on Revit 2024 to 2027, and 2015 to 2023 stays out. - `changelog.d/fixed/area-space-height.md`: the entry. No test pins this value, so `tests/` is unchanged. ## Measured One Measure run scored this change together with nine others it was drafted beside (run 43086493417, head `f5f54467`, base `5e3ac5b0`: every model, with the BIM4LCA office and housing, the Revit 2025 models, Autodesk's samples of every release, rac_advanced, BIMcollab and the held-out pairs; every shard and both same-project gates passed; rows registered on #1636 before it was read). Each change writes a value of a different name, so the rows below are this change's alone. Both sides' exports were kept, and the 58 sample saves, which no Revit export scores, were compared value by value. After the second read the stack was rebuilt on `main` as seven changes (the pipe change left it, and the roof and floor-opening rules were narrowed to square-cornered outlines) and measured once more in full (run 43100937918, head `53c19487` against `e8a99d03`, rows registered first, read on #1636): all shards and both same-project gates pass, "different" and "values Revit does not write" are unchanged on every model, and the rows below repeat except where a line says otherwise. | Model | `Qto_SpaceBaseQuantities.Height` equal, before | after | different | |---|---:|---:|---:| | Office as built, at permit | 234 of 248 each | 248 of 248 each | 0 | | Timber office as built, at permit | 231 of 244 each | 244 of 244 each | 0 | | Concrete housing as built | 82 of 89 | 88 of 89 | 0 | | Concrete housing at permit | 81 of 88 | 87 of 88 | 0 | | Timber housing as built | 84 of 91 | 90 of 91 | 0 | - Both same-project gates pass, and rac_advanced's 2026 and 2027 saves hold the `Height` of 116 spaces of their 2025 save (from 91), none differing. - Sample saves: 198 Areas in 6 saves gain the value (25 in each rac_advanced save of 2024 to 2027, 96 in Snowdon Towers Architectural, 2 in Structural). ## Still open - A 2015 to 2023 Area gets none: the only export of one of their Areas is an IFC2X3 one whose quantities are not measured (RE-324). Stack: this is change 4 of 7; each branch holds the ones before it, so its own diff is its last commits until those land. First draft: #1756, then #1777. ## Testing - Built, linted and tested by CI on this head; nothing was built on a workstation. - Verified end to end on real Revit files against Revit's own exports: the Measure runs named above, which anyone can repeat with `gh workflow run measure.yml --ref main -f ref=<this head> -f base=e8a99d03be8a76a2c8871ea8cc28d036653ec6e2 -f nordic=true -f r2025=true -f samples=true -f racadv=true -f bimcollab=true -f holdout=true`. - No test was added: no unit test, and no pinned count moves except where the body says so. - `main` has moved since those runs (#1769 re-meshes trimmed faces, and #1771, #1773, #1781, #1782, #1787 and #1789 landed). This head, `0f82cb8e`, is `main` at `d1a5c0ee` merged in, with one docs line merged word by word; its change against `main` is this pull request's own commit and nothing else (byte-equal outside `docs/`, word-equal inside). Measure 43108424934 measured the nine batch changes together on `main` with #1769 (`3f2a04c4` against `e7ac68e7`, rows registered on #1636 first): every count above repeats, and the same-project gates pass. ## Audit-honesty checklist - [x] Docs state what this change writes and what it leaves out - [x] A changelog fragment under `changelog.d/` - [x] No emojis, private paths or personal data in committed files - [x] Limits are in the body above and in the code's doc comments ## Legal and contribution hygiene - [x] Apache-2.0 - [x] No Autodesk proprietary source, decompiled internals or NDA material. Where revit-ifc (CLEANROOM.md source 5) is cited, it is read and cited by file and class, and no code is copied. - [x] No fixture with real-world personal data ## Breaking changes None.
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
Revit's IFC4 export of the BIM4LCA office as built writes
Qto_SpaceBaseQuantities.Heighton 308 minus 44 family-instance spaces; rvt-rswrites it on the 234 rooms and on none of the 30 Areas. This change writes an
Area's
Heightas the height of its body, from its Level up to the Level above,on Revit 2024 to 2027, and leaves a Revit 2015 to 2023 Area without one, since
no export of that release's Area height is measured.
Evidence
The task is real and still open.
docs/rooms.md:134lists exactly this valueunder "What is not measured" for Areas ("which Revit writes on an Area and rvt-rs
does not yet"), and the Areas row of
docs/support-matrix.jsonsays the same. Noissue closes it against us: #1016 is the open W7 quantity umbrella and puts the
remainder on #1046, #1165, #1203 (closed, columns), #1207 (spaces'
GrossVolume,stepped rooms'
NetVolume, Revit 25's area quantities), #1208 and #1209, none ofwhich names an Area's height; #763 is closed and is about the 44 family-instance
spaces.
RE-317§2 measured the value as the same number as the Area's extrusiondepth on all 30 Areas of both office files, and
RE-324§"not measured" leaves itout for 2015 to 2023. Nothing in the code or docs is a decision against writing
it.
Where the 14 are. From
qtos_vs_ifc.txt:Height: 248, equal 234, different 0, missing 14,on IfcSpace x14, and 6 more "on a repeated key, against the objectheld: missing 6";
rvt-rs quantities Revit does not write: 0, so rvt-rs writesHeighton exactly 234 spaces.space_kinds_vs_ifc.txtsplits the 308IfcSpaceinto 234 rooms, 30 Areas and 44 family instances. In
revit.ifcafamily-instance space's
Qto_SpaceBaseQuantitiesholdsGrossVolumeandNetVolumeand noHeight(e.g.#787354), while every one of the 30 Areaspaces carries a one-quantity
Qto_SpaceBaseQuantitiesthat is anIfcQuantityLength('Height',…)equal to that Area'sIfcExtrudedAreaSoliddepth(e.g.
#69195, height3399.9999999999982and depth3399.9999999999982). TheAreas are
GFA 250mm1-5,GFAK/1/2/3/P/4/5,BUSINESS SPACELIIK1,OFFICETSTO1-TSTO11 and
HEATED NETAREAK/1/2/3/4/5a.tools/re/qtos_vs_ifc.pykeys aspace by its
Nameand counts a repeated key apart: the 6 names shared by two orthree Areas (1, 2, 3, 4, 5, K) are exactly its 6 "repeated key" heights, and the
14 missing are the 14 uniquely named Areas — LIIK1, TSTO1 to TSTO11, P and 5a.
There are no other
IfcSpacewithoutHeightin the office's export.The rule. rvt-rs already holds the number: a drawn Area carries
AREA_BODY_HEIGHT_FIELD(m_area_body_height), the elevation of the nextbuilding story less its Level's (
RE-317), and extrudes its body by it. AgainstRevit's own
Heightin the same file the two agree inside the census's 1e-5relative tolerance: area
13.400000 m against 3399.9999999999982 mm, TSTO53.950000 against 3949.9999999980364, 5a 5.970000 against 5970.0000000000118.
So an Area that rvt-rs draws gets that number; an Area it refuses keeps none. A
room and a family-instance space are untouched (
ROOM_HEIGHT_FIELDis readunchanged, and neither kind has an Area field).
What stays out, and why the releases are gated. A given Revit release's export
is the oracle only where it exists: the Area height is measured on Revit 2024
(the office, both files, 30 of 30). Revit 2025 to 2027 Areas hold the same body
height as that save — the same-project gate compares it, with
lowest and highest vertex/heightintools/re/areas_across_saves.py— andrevit-ifctakes theheight from the Level distance for every release (cited in
RE-317§2), so theyare written too, labelled like the Areas themselves. A Revit 2015 to 2023 Area
keeps none: the only export of one is an IFC2X3 export whose quantities are not
measured (
RE-324). The gate cannot be 2024 alone:tools/re/readers_across_saves.pycompares the sample projects' saves from
FIRST_YEAR = 2024against the 2025 saveand fails a property written here and not in the reference, and
Qto_SpaceBaseQuantities.Heightis in itsADDEDlist. An Area that rvt-rsrefuses a body for still has no
Height, so on a project where Revit writes oneon a refused Area the value stays missing, not wrong.
Changes
src/research/partition_area_records.rs:AREA_SPACE_HEIGHT_FIELD(
m_area_space_height) andAREA_HEIGHT_REVIT_VERSIONS(2024to2027), anda drawn Area's
body.height_feetis pushed under the new field on thosereleases only.
src/ifc/export_content.rs:add_space_heighttakes that field as well asROOM_HEIGHT_FIELDand writes it asQto_SpaceBaseQuantities.Height.docs/rooms.md(the room sentence and the unmeasured bullet),docs/supported-profile.md(the space quantity sentence) and the Areas row ofdocs/support-matrix.json: an Area's height is written on Revit 2024 to 2027,and 2015 to 2023 stays out.
changelog.d/fixed/area-space-height.md: the entry.No test pins this value, so
tests/is unchanged.What was not checked
I could not compile or measure. CI must confirm that the crate builds on 1.87
(edition 2024, no let-chains) and that Clippy, rustdoc and rustfmt pass. The
Measurement must confirm the counts (unmeasured here): on the office as built
Qto_SpaceBaseQuantities.Heightshould go fromequal 234, different 0, missing 14toequal 248, different 0, missing 0, the "repeated key" line frommissing 6toequal 6, andrvt-rs quantities Revit does not writemust stay0; the permit file and every other model with a Revit export must not gain a
different. The same-project gate must still pass on the 2024, 2026 and 2027samples (
rac_advanced's Areas,rst_basic's refused one), which is the reasonthe release list is 2024 to 2027 and not 2024 alone. Whether Revit writes a
Heighton a 2015 to 2023 Area, and on an Area that rvt-rs itself refuses a bodyfor, is not measured and not claimed.
Pilot draft: written by an automated worker and pushed as proposed, with rustfmt applied. Not yet read by a maintainer session; please do not review, approve or arm it.