Repository navigation
feat(ifc): write a hollow-section column's NetVolume, the volume Revit computes (RE-247) - #1750
Closed
DrunkOnJava wants to merge 1 commit into
Closed
DrunkOnJava wants to merge 1 commit into
DrunkOnJava wants to merge 1 commit into
Conversation
…t computes (RE-247)
Owner
Author
|
Superseded by #1773: the same change on a fresh branch on today's main, with the measured rows in its body. |
Merged
7 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Nov 11, 2026
…mputes (#1016) (RE-247) (#1773) ## Summary Revit's export writes `Qto_ColumnBaseQuantities.NetVolume` on all 279 columns of the BIM4LCA office as built and rvt-rs writes it on 199 (`Qto_ColumnBaseQuantities.NetVolume: 279, equal 199, different 0, missing 80`, `Missing…: 80; on IfcColumn x80`). The 80 are the office's 79 hollow-section columns plus the round column: 199 box-drawn columns (RE-291) plus 79 hollow sections plus the one round column is 279, and the missing sets are exactly the four-property ones (`Length`, `CrossSectionArea`, `OuterSurfaceArea`, `GrossVolume`) that `add_body_quantities` writes for an unjoined column drawn as its type's hollow section. `hollow_section_area_perimeter` also wrote `GrossVolume` as the section's true area times the depth, and Revit's `GrossVolume` is equal there (278 of 279), so those columns are uncut and only `NetVolume` is absent. The value Revit writes is **not** the section's area times the length: it is the volume Revit computes, which the arcs of the profile's rounded corners are missing from — the section's outside rectangle less its inside one, times the extrusion's depth. Measured on both IFC files of the office, matching by Tag: | column | type | length | rvt-rs `GrossVolume` / Revit's `CrossSectionArea` | Revit's `NetVolume` | section rectangles | |---|---|---|---|---|---| | 2218137 | PI-4 | 4.5 m | 0.008260 / 0.00183557 | 0.0085500000000010 | 0.0019 × 4.5 | | 2230755 | PI-4 | 5.0 m | 0.009178 / 0.00183557 | 0.0094999999999998 | 0.0019 × 5.0 | | 2472052 | PI-4 | 3.4 m | 0.006241 / 0.00183557 | 0.0064600000000006 | 0.0019 × 3.4 | | 3513039 | PI-2 | 5.0 m | 0.026695 / 0.00533905 | 0.0275200000000003 | 0.005504 × 5.0 | | 3513306 | PI-2 | 3.153 m | 0.016834 / 0.00533905 | 0.0173541120000002 | 0.005504 × 3.153 | | 3134738 | PI-5 | 5.4 m | 0.020712 / 0.00383555 | 0.0210600000000022 | 0.0039 × 5.4 | The office's 79 hollow-section columns are of exactly these three types (`Hollow Sections-Column:PI-2`, `PI-4`, `PI-5`), each column carrying its own copy of the same profile, so the rectangle area is a constant per type and the value is linear in the length rvt-rs already writes (equal to Revit's on 279 of 279). ## Evidence * `src/ifc/export_content.rs`: `add_body_quantities` (the pass that writes an unjoined column's `Length` and, for a hollow section, its `CrossSectionArea`, `OuterSurfaceArea` and `GrossVolume`) said "Its `NetVolume` is left out: Revit's export writes the volume Revit computes, less than that on every one of the BIM4LCA office's hollow columns" — the direction of that difference is the opposite of what the two files show, and the volume *is* derivable. `hollow_section_profile` builds the section from the family's `b`, `Ht`, `t` and `kr` as a rounded rectangle spanning `b`×`Ht` with a hole spanning `(b-2t)`×`(Ht-2t)`, which is what makes the two rectangles readable from the profile itself. * `src/ifc/export_content/column_quantities.rs` (RE-291/RE-353, which write the box-drawn and cut columns), `src/ifc/saved_meshes.rs` (`add_mesh_volumes`, `add_column_quantities`, `drop_column_box_quantities` — none replaces a value a set holds, so the new one stands), `src/ifc/entities.rs` (`IndexedCurve.points`), `src/research/partition_schema_mvp/{fields,framing}.rs` (`HOLLOW_SECTION_FIELDS`). * Evidence censuses: `nordic-office-as-built` (above), `nordic-office-timber-as-built` and `nordic-housing-concrete-as-built` — the timber office has **0** hollow-section columns (`column_bodies_vs_ifc.txt`: `family_type_hollow_section: 0 columns`), so no file whose `NetVolume` is already equal can lose it. * `gh issue view 1203` (closed): item 2 is the round column, item 3 the cut columns; the hollow sections' `NetVolume` is not named as a decided negative, and the closed negatives RE-19, RE-20 and RE-399 are about other values. * Docs: `docs/evidence.md`, `docs/supported-profile.md`, `docs/release-1.0-criteria.md` all listed the hollow-section column's `CrossSectionArea`, `OuterSurfaceArea` and `GrossVolume` without the `NetVolume`; `docs/format-reconnaissance.md` (RE-221, RE-424) and `docs/w10-rerun.md` state the hollow columns' *bodies* and the mesh pass, neither of which moves. Rule written: on a column that no `CleanPairGStep` joins, drawn as its type's hollow section, `NetVolume` is the section's outside rectangle less its inside one times the extrusion's depth, where both rectangles are read off the profile's own rings and the difference is finite and positive. It is written in the same block as the three values that column already gets, so it covers exactly the columns whose area Revit's export confirms (the 79 office columns), and nothing else changes: the round column, the cut columns, the box-drawn columns and every column that already holds a `NetVolume` are untouched. ## Changes * `src/ifc/export_content.rs` * `hollow_section_area_perimeter` also returns the area the section's two rectangles span (outside less inside), and a new `ring_rectangle_area` reads a ring's rectangle from its points; the value is dropped where it is not finite and positive (`None`, so no value is written). * `add_body_quantities` writes `NetVolume` after `GrossVolume` from it. * Its doc comment no longer says the volume is left out, and states the rule and where it was measured. * `docs/evidence.md`, `docs/supported-profile.md`, `docs/release-1.0-criteria.md`: the hollow-section column's `NetVolume` added to the quantities listed. * `changelog.d/added/247-hollow-column-net-volume.md`: new fragment. ## 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_ColumnBaseQuantities.NetVolume` equal, before | after | different | |---|---:|---:|---:| | Office as built | 199 of 279 | 278 of 279 | 0 | | Office at permit | 289 of 345 | 344 of 345 | 0 | - No other model with a Revit export holds a hollow-section column, and "quantities Revit does not write" is unchanged on every model. - Sample saves: one column of Snowdon Towers Structural gains the value; nothing else changes for this. ## Still open - The one column left on each file is the round column, which is drawn as its record's box. - The rule is measured on Revit 2024 exports only and is not held to a release: it is Revit's computed volume, not an exporter's choice. A later exporter that wrote another value would need the release list the cut and round column rules use. Stack: this is change 1 of 7; each branch holds the ones before it, so its own diff is its last commits until those land. First draft: #1750. ## 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. ## 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 export writes
Qto_ColumnBaseQuantities.NetVolumeon all 279 columns of the BIM4LCA office as built and rvt-rs writes it on 199 (Qto_ColumnBaseQuantities.NetVolume: 279, equal 199, different 0, missing 80,Missing…: 80; on IfcColumn x80). The 80 are the office's 79 hollow-section columns plus the round column: 199 box-drawn columns (RE-291) plus 79 hollow sections plus the one round column is 279, and the missing sets are exactly the four-property ones (Length,CrossSectionArea,OuterSurfaceArea,GrossVolume) thatadd_body_quantitieswrites for an unjoined column drawn as its type's hollow section.hollow_section_area_perimeteralso wroteGrossVolumeas the section's true area times the depth, and Revit'sGrossVolumeis equal there (278 of 279), so those columns are uncut and onlyNetVolumeis absent.The value Revit writes is not the section's area times the length: it is the volume Revit computes, which the arcs of the profile's rounded corners are missing from — the section's outside rectangle less its inside one, times the extrusion's depth. Measured on both IFC files of the office, matching by Tag:
GrossVolume/ Revit'sCrossSectionAreaNetVolumeThe office's 79 hollow-section columns are of exactly these three types (
Hollow Sections-Column:PI-2,PI-4,PI-5), each column carrying its own copy of the same profile, so the rectangle area is a constant per type and the value is linear in the length rvt-rs already writes (equal to Revit's on 279 of 279).Evidence
src/ifc/export_content.rs:add_body_quantities(the pass that writes an unjoined column'sLengthand, for a hollow section, itsCrossSectionArea,OuterSurfaceAreaandGrossVolume) said "ItsNetVolumeis left out: Revit's export writes the volume Revit computes, less than that on every one of the BIM4LCA office's hollow columns" — the direction of that difference is the opposite of what the two files show, and the volume is derivable.hollow_section_profilebuilds the section from the family'sb,Ht,tandkras a rounded rectangle spanningb×Htwith a hole spanning(b-2t)×(Ht-2t), which is what makes the two rectangles readable from the profile itself.src/ifc/export_content/column_quantities.rs(RE-291/RE-353, which write the box-drawn and cut columns),src/ifc/saved_meshes.rs(add_mesh_volumes,add_column_quantities,drop_column_box_quantities— none replaces a value a set holds, so the new one stands),src/ifc/entities.rs(IndexedCurve.points),src/research/partition_schema_mvp/{fields,framing}.rs(HOLLOW_SECTION_FIELDS).nordic-office-as-built(above),nordic-office-timber-as-builtandnordic-housing-concrete-as-built— the timber office has 0 hollow-section columns (column_bodies_vs_ifc.txt:family_type_hollow_section: 0 columns), so no file whoseNetVolumeis already equal can lose it.gh issue view 1203(closed): item 2 is the round column, item 3 the cut columns; the hollow sections'NetVolumeis not named as a decided negative, and the closed negatives RE-19, RE-20 and RE-399 are about other values.docs/evidence.md,docs/supported-profile.md,docs/release-1.0-criteria.mdall listed the hollow-section column'sCrossSectionArea,OuterSurfaceAreaandGrossVolumewithout theNetVolume;docs/format-reconnaissance.md(RE-221, RE-424) anddocs/w10-rerun.mdstate the hollow columns' bodies and the mesh pass, neither of which moves.Rule written: on a column that no
CleanPairGStepjoins, drawn as its type's hollow section,NetVolumeis the section's outside rectangle less its inside one times the extrusion's depth, where both rectangles are read off the profile's own rings and the difference is finite and positive. It is written in the same block as the three values that column already gets, so it covers exactly the columns whose area Revit's export confirms (the 79 office columns), and nothing else changes: the round column, the cut columns, the box-drawn columns and every column that already holds aNetVolumeare untouched.Changes
src/ifc/export_content.rshollow_section_area_perimeteralso returns the area the section's two rectangles span (outside less inside), and a newring_rectangle_areareads a ring's rectangle from its points; the value is dropped where it is not finite and positive (None, so no value is written).add_body_quantitieswritesNetVolumeafterGrossVolumefrom it.docs/evidence.md,docs/supported-profile.md,docs/release-1.0-criteria.md: the hollow-section column'sNetVolumeadded to the quantities listed.changelog.d/added/247-hollow-column-net-volume.md: new fragment.What was not checked
I could not compile, run or measure anything. CI must confirm the edits build (
--all-features, clippy-D warnings, edition 2024: no let-chains, nounsafe, no indexing on file data) and that rustfmt accepts the new helper. The measurement must confirm what I could only sample by hand: that NetVolume goes from missing to equal on the 79 hollow-section columns of the office as built (199 → 278 equal, 80 → 1 missing, different still 0, that one being the round column), that the office at building permit's 55 hollow-section columns read equal too, and that no other model in the set (the housing's concrete and timber files, the terrain files, Autodesk's samples) gains a value Revit's export does not write or writes differently — the rule is measured on Revit 2024 alone and is deliberately not release-gated, since it is Revit's computed volume and not an exporter choice. If a later release's export disagrees, the rule needs the same release gateNEW_RULE_REVIT_VERSIONSgives the cut and round column rules. I also did not verify each of the 79 columns individually: the evidence is five columns covering all three types at five lengths, plus the fact that the section and the length are the only inputs.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.