Repository navigation
feat(ifc): honour an "Export to IFC As" of IfcGeographicElement (#1772) - #1789
Merged
Merged
Conversation
DrunkOnJava
marked this pull request as ready for review
November 11, 2026 21:40
DrunkOnJava
added a commit
that referenced
this pull request
Nov 11, 2026
…finedType is its own or its type's (#1713) (#1787) ## Summary Revit's export gives a `PredefinedType` to every `IfcWall`, `IfcRamp`, `IfcLightFixture` and `IfcPipeSegment`; rvt-rs wrote `NOTDEFINED` on 3,842 of 4,359 walls and `$` on all 38 ramps, 174 light fixtures and 48 pipe segments of the 42 models with a Revit export (#1713). This adds four rows to `category_map::PREDEFINED_TYPE_ENUMERATORS` with the IFC4 enumerators of `IfcWallTypeEnum`, `IfcRampTypeEnum`, `IfcLightFixtureTypeEnum` and `IfcPipeSegmentTypeEnum`, so an element of one of the four takes its own or its type's "IFC Predefined Type" where that value is an enumerator of the entity — the same rule RE-45, RE-419 and #1765 already apply to slabs, coverings, shading devices, roofs, the terminals, furniture and railings. Nothing else changes. The `Wall`, `ArcWall`, `Ramp`, `LightingFixture`, `Pipe` and `Gutter` mapping rows keep their `predefined_type` (`NOTDEFINED` for the two wall rows, `None` for the other four), so a wall with no value keeps `NOTDEFINED` and a ramp, light fixture or pipe segment with none keeps `$`. `category_map::predefined_type_left_out` still keeps the occurrence's value off a Revit 2027 save, walls included (#1692). ## Evidence **What Revit writes, per class, on the BIM4LCA office as built** (`revit.ifc`, Revit 2024), paired with `rvt-rs.ifc` by `Tag`: | class | in both | Revit's `PredefinedType` | rvt-rs's today | |---|---:|---|---| | `IfcWall` | 607 | `PARTITIONING` 450, `SOLIDWALL` 96, `SHEAR` 53, `PARAPET` 4, `PLUMBINGWALL` 2, `NOTDEFINED` 2 | `NOTDEFINED` 607 | | `IfcRamp` | 5 | `STRAIGHT_RUN_RAMP` 5 | `$` 5 | | `IfcLightFixture` | 43 | `SECURITYLIGHTING` 43 | `$` 43 | | `IfcPipeSegment` | 12 | `GUTTER` 12 | `$` 12 | Every value is an enumerator of its entity, and no element of the four carries a value outside the list. The issue's widened scorer on the 42 models with a Revit export reads the same: 3,842 of 4,359 walls, all 38 ramps, all 174 light fixtures and all 48 pipe segments unset or `NOTDEFINED` in rvt-rs where Revit writes a value, `differs` 0 on all four classes. **Where the value comes from.** Each class's type objects carry it: the office's `IfcPipeSegmentType` `JSV-3` is `GUTTER`, its two `IfcLightFixtureType` (`OPA-1`, `OPA-2`) are `SECURITYLIGHTING`, its four `IfcRampType` `AP-ulkoluiska` are `STRAIGHT_RUN_RAMP`, and its 25 `IfcWallType` carry the wall values. That is the type's "IFC Predefined Type", which `attach_ifc_export_overrides` already attaches to the element as `m_ifc_predefined_type` (`ExportParameters::effective_predefined_type`: the element's own, else its type's). RE-45 measured the same parameter on a wall type: `teste_export_2025` wall type 402 carries `IFC_EXPORT_PREDEFINEDTYPE_TYPE = "CLADDING"` and Revit writes its 3 walls `IFCCOVERING .CLADDING.`, so a wall's occurrence value does fall back to its type's. The only thing that kept the value out of the export was that the four entities were not in the enumerator table, so `predefined_type_for` returned `None` and the mapping's own value was written. **The one place the value is not the type's alone.** The office's wall type `KS-3` has 6 walls: 4 `SOLIDWALL` and 2 `NOTDEFINED`. Revit writes two `IfcWallType` objects for it, `SOLIDWALL` and `STANDARD`, and its two `IfcRelDefinesByType` type the 4 `SOLIDWALL` walls by the first and the 2 `NOTDEFINED` ones by the second. So the occurrence's value is the element's own before its type's, which is the order `effective_predefined_type` already takes; the 2 walls carry their own `NOTDEFINED`. This is the case the measurement has to confirm: if the reader does not find a wall's own value, those 2 would be written `STANDARD` and the wall row would read `differs` 2. **What stays as it is.** A wall with no value of its own or its type's keeps the mapping's `NOTDEFINED`, which is what Revit writes on the 517 walls it writes `NOTDEFINED` on. A ramp, light fixture or pipe segment with no value keeps `$`: Revit writes `NOTDEFINED` on some of the 38 ramps, and no 2027 export of those three classes is measured, so no `NOTDEFINED` default is added to their rows (the reason RE-419's furniture default is release-gated). A value that is no enumerator of the entity is left to the mapping, as before. **Why `IfcStair` and `IfcDoor` are still not listed.** The table's doc comment says listing them would apply every door's and stair's own predefined type as well, which is not measured. That reason does not apply to the four: each is reached by the rows of one or two Revit categories (Wall and ArcWall, Ramp, LightingFixture, Pipe and Gutter), and the elements of those rows are the ones measured above. **The CI check on Core Interior.** `tools/ci/ifc_schema_arity.py --witness-agreement` asserts every written `IfcWall` `PredefinedType` is in `{"NOTDEFINED"}`, the value Revit's own export of `2024_Core_Interior_slim.ifc` writes on all 360 walls. A wall there can only take another value if the reader finds one Revit's export does not write, which the measurement would show as `differs`; the check cannot move otherwise. `IfcWall` stays in `PREDEFINED_TYPE_REQUIRED`, since the mapping's `NOTDEFINED` still fills the slot on a wall with no value. ## Changes - `src/ifc/category_map.rs`: `IFCWALL`, `IFCRAMP`, `IFCLIGHTFIXTURE` and `IFCPIPESEGMENT` join `PREDEFINED_TYPE_ENUMERATORS` with exactly the IFC4 enumerators of `IfcWallTypeEnum`, `IfcRampTypeEnum`, `IfcLightFixtureTypeEnum` and `IfcPipeSegmentTypeEnum`, in schema order; the table's doc comment records the office's per-class counts, the `KS-3` case and why the `IfcStair`/`IfcDoor` reason does not apply. - `changelog.d/fixed/1713-wall-ramp-light-fixture-pipe-predefined-type.md`: the user-visible change. - `docs/compatibility.md`: the sentence that reads the Core Interior walls' `.NOTDEFINED.` as the value rvt-rs writes now says it is the default, replaced by a wall's own or its type's value where that is an `IfcWallTypeEnum` enumerator. - `docs/evidence.md`: the conduit, conduit fitting and gutter row no longer says a gutter carries no `PredefinedType`. No test is edited. `tests/fixtures/synthetic-project.ifc` holds four `IFCWALL .NOTDEFINED.` whose elements are synthesized and carry no export parameter, so they keep the mapping's value. ## The rows the measurement must show Unfiltered Measure against `main` at `aa5dc4c6d9`, with the BIM4LCA office and housing, the 23 Revit 2025 models, Autodesk's samples, `rac_advanced`, BIMcollab and the held-out pairs: | class | model | same | differs | still unset | |---|---|---:|---:|---| | `IfcWall` | office as built and at permit, timber office, concrete and timber housing, every model with a Revit export | 4,359 of 4,359 | 0 | 0 | | `IfcRamp` | office as built and at permit (5 each) | 5 of 5 | 0 | the ramps Revit writes `NOTDEFINED` on | | `IfcLightFixture` | office as built (43) | 43 of 43 | 0 | the light fixtures whose type rvt-rs does not join (RE-190: the permit file's 43) | | `IfcPipeSegment` | office as built (12) | 12 of 12 | 0 | the untyped gutters (the concrete housing's 1) | - The wall row is the one to read first: `differs` 0 on all 4,359, and the 2 `KS-3` walls of the office still `NOTDEFINED`. - The ramp, light fixture and pipe segment rows cannot read `unset` 0: Revit writes `NOTDEFINED` on some ramps, and a light fixture or gutter whose type rvt-rs does not join has no value to take. Those stay `$`, as before. - Type objects, which no export scores: a wall, ramp, light fixture and pipe segment type now takes its value as the types of the other listed classes do, so `type_objects_vs_ifc`'s tallies move on the office (its 25 `IfcWallType` from `NOTDEFINED` to the wall values, its 4 `IfcRampType` to `STRAIGHT_RUN_RAMP`, its 2 `IfcLightFixtureType` to `SECURITYLIGHTING`, its `IfcPipeSegmentType` to `GUTTER`). No WHERE rule finding is expected: `USERDEFINED` with no `ObjectType` is still left unset by the writer (#1430). - No other model should move: the Revit 2025 models, the held-out pairs and the sample saves hold no export parameter on these four classes, so their exports should be byte-identical. ## What was not checked - Nothing was compiled, linted or run: no `cargo build`, no `cargo clippy`, no `cargo test`. CI builds and tests this head. - Nothing was measured. The four rows above are what the measurement must show, not what it has shown; the `KS-3` pair is the one element of the evidence that could make the wall row read `differs` 2, and if it does, the wall row must come out of this change until the reader's own-value path is shown to reach a wall. - The reader's own-value path for a wall is inferred, not measured: `attach_ifc_export_overrides` runs over `out.walls` and reads the element's own `IFC_EXPORT_PREDEFINEDTYPE` before its type's, and RE-45 measured a wall type's value reaching the occurrence, but no probe has listed a wall's own value. - An element of another class redirected to one of the four by its "Export to IFC As" would now take its own predefined type there. No such element is measured on the office; the measurement would show it as `differs`. - `docs/release-1.0-criteria.md`'s RE-427 sentence still reads the wall row of #1713 as open. It is left alone here: it is the line #1765 edits, and its numbers are a Measure run this change does not have yet. It should be updated with the measurement's row. - The 2027 exporter's answer for ramps, light fixtures and pipe segments is not measured, which is why no `NOTDEFINED` default is added to their rows. ## Measured Unfiltered Measure 43100947234 with the held-out pairs (head `4d047255`, this change's commit `438473f9` with #1789's one commit on top, against `main` at `e8a99d03`; rows registered on #1636 before it was read; 42 shards and both same-project gates pass). Exactly 12 of 126 exports move, the 12 BIM4LCA files: every Revit 2025 model, held-out pair, sample save and Core Interior is byte-identical. | Class | Same as Revit, before | after | differs | still unset | |---|---:|---:|---:|---:| | `IfcWall` (12 files) | 19 of 3,861 | 3,821 of 3,861 | 0 | 40, on the three permit files | | `IfcRamp` (6 files) | 0 of 32 | 32 of 32 | 0 | 0 | | `IfcLightFixture` (4 files) | 0 of 174 | 174 of 174 | 0 | 0 | | `IfcPipeSegment` (4 files) | 0 of 48 | 48 of 48 | 0 | 0 | - The office as built reads 607 of 607 walls, the two `KS-3` walls that hold their own `NOTDEFINED` among them: the reader finds a wall's own value before its type's. - The permit office's 43 light fixtures, which this description expected to stay unset, read as Revit's. - No property or quantity census row moves. The type objects of the four classes take the values and no WHERE rule finding is added. - The enumerators equal IfcOpenShell's IFC4 schema tables for all four classes (checked by both sessions). ## Still open - 40 walls on the three permit files stay unset (19, 13 and 8). - A ramp, light fixture or pipe segment with no value keeps none: Revit writes `NOTDEFINED` on some ramps, and no 2027 export of the three is measured. - #1713 stays open for roofs, proxies, stairs and the doors' `TRAPDOOR`. ## Testing - Built, linted and tested by CI on this head; nothing was built on a workstation. - Measure 43100947234 measured 4d04725, which holds 438473f plus #1789's cherry-picked patch; #1787's rows are on classes #1789 does not touch (Wall, Ramp, LightingFixture and Pipe against Floor, Furniture, Planting and SpecialtyEquipment). The same-project gates verdict (pass) is on that commit. - No test was added, and no pinned count moves: Core Interior's export is byte-identical. ## Breaking changes None.
…element-export-value
This was referenced Nov 11, 2026
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.
DrunkOnJava
added a commit
that referenced
this pull request
Nov 12, 2026
… and Height (#1165) (#1784) ## Summary The 25 openings of the BIM4LCA office as built whose `Qto_OpeningElementBaseQuantities.Depth` Revit's export writes and rvt-rs's does not are the openings rvt-rs writes for a door that also cuts a second wall (`ifc::wall_cut_openings`'s `door_cut`, `quantities: false` since RE-338). They are written with no quantity set at all. This change writes their `Depth`, the extent the opening is extruded across that wall by, and leaves their `Width` and `Height` out. ## Evidence - `evidence/nordic-office-as-built/qtos_vs_ifc.txt`: `Depth: 308, equal 283, different 0, missing 25`, all 25 `on IfcOpeningElement x25`; a further 59 openings rvt-rs does not write are counted apart, and `rvt-rs quantities Revit does not write: 0`. - `evidence/nordic-office-as-built/unfilled_openings_vs_ifc.txt`, by kind of cutter and host: `IfcCurtainWall in IfcWall` 27 of 27, `IfcFireSuppressionTerminal in IfcWall` 39 of 39, `none in IfcWall` 30 of 30, `none in IfcSlab` 36 of 36 and `IfcSlab in IfcSlab` 1 have `Depth equal`; `IfcDoor in IfcWall` is the one kind with `revit: 39, written: 25` and `Depth in Revit's: 25` but no `Depth equal` line — rvt-rs writes those 25 openings and no `Depth` on any. - The counts close exactly: 283 equal = 187 openings of a door or window whose symbol cuts an outline (the filled openings, whose `Depth` the writer already writes) + 96 of the 99 wall-cut openings it writes (three curtain walls are written that Revit's export lacks); 283 + 25 = 308. So the 25 are precisely the door-in-second-wall openings, and Revit writes `Depth` on every one of them. - What Revit's value is. RE-321 §3 (the rectangular, cabinet and curtain-wall openings, all 96 equal) and RE-244 (the 187) find `Depth` to be the extrusion's depth, i.e. the extent the opening passes through the wall by, which is what `thickness_feet` already is for a wall-cut opening. On a door's second-wall opening that extent is the door's own width: `revit.ifc`'s opening `#77141` (Tag 1383546, unfilled, voiding `Basic Wall:VS-2:1352055`) carries `Width` 100, `Height` 2100, `Depth` 810 mm — the profile is the second wall's plane (the door's own wall thickness by the door's height) extruded 810 mm across it, and 810 mm is the door's own opening's across extent, which RE-338 §3 measured as the door's own opening box (equal to rvt-rs's box within 0.01 ft on 25 of 28 as built, and on all 25 these openings are the ones written). `Depth` = 3048 mm on exactly the 11 openings where the second wall runs *along* the door's wall, which rvt-rs leaves out (`door_second_wall_parallel_to_door_wall`, 9 of the 14 it leaves out of the 39). - Rule, and what stays out: `Depth` is written on every wall-cut opening whose host holds that quantity (all 607 walls that rvt-rs writes hold a `Width` here, and with `--no-base-quantities` the list is empty and nothing is written). `Width` and `Height` stay missing on the 25: Revit's export swaps them on a door's opening (RE-244, RE-235 §5) and nothing read says it does not on this one, even though `#77141`'s are the rectangle's extents. So `Width` 152 (missing 56) and `Height` 152 (missing 56) are unchanged, and the 14 door openings rvt-rs does not write are untouched. ## Changes - `src/ifc/step_writer.rs`: the wall-cut opening's quantity set is now written where its host holds the quantity, not only where `Width` and `Height` are written too; `Width` and `Height` are still pushed only for the rectangular, cabinet and curtain-wall openings, so their output is byte for byte what it was, and a door's second-wall opening gains a set holding `Depth` alone. - `src/ifc/entities.rs`, `src/ifc/wall_cut_openings.rs`: the doc comments of `quantities` say why that opening takes only its `Depth`. - `docs/supported-profile.md` and `docs/release-1.0-criteria.md`: the sentences listing what an opening a door cuts in a second wall carries gain the `Depth`, and say that its `Width` and `Height` stay out. - `changelog.d/added/1165-door-second-wall-opening-depth.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. The first draft wrote `Depth` alone. `Height` was added after reading four such openings in Revit's export of the office (Width, Height and Depth 100 / 2100 / 810 and 300 / 2100 / 1210 mm, the same way round as on any rectangular opening; the table is in the last comment on #1749). | Model | `Depth` equal, before | after | `Height` equal, before | after | newly different | |---|---:|---:|---:|---:|---:| | Office as built | 283 of 308 | 308 of 308 | 96 of 152 | 121 of 152 | 0 | | Office at permit | 262 of 295 | 295 of 295 | 75 of 137 | 108 of 137 | 0 | | Timber office as built | 286 of 302 | 302 of 302 | 101 of 142 | 117 of 142 | 0 | | Timber office at permit | 247 of 281 | 263 of 281 | 74 of 121 | 90 of 121 | 0 | | Concrete housing as built, at permit | 72, 62 of 79 | 75, 65 of 79 | 18, 6 of 35 | 21, 9 of 35 | 0 | | Timber housing as built, at permit | 67 of 68 each | 68 of 68 each | 7 of 19 each | 8 of 19 each | 0 | - The timber office at permit read 9 `Depth` values different before and reads the same 9 after. - Sample saves: one opening in each rac_basic save of 2024 to 2027 gains the two values. ## Still open - `Width`, which Revit's export writes too, stays out: Revit's is the thickness of the wall the door stands in, and rvt-rs's outline is 0.2 mm wider than that on two of the four openings read, which the scorer would count as different. - A second wall that runs along the door's wall is still not written. Stack: this is change 5 of 7; each branch holds the ones before it, so its own diff is its last commits until those land. First draft: #1755, then #1779. ## 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, `44bafde9`, is built on #1783's merged head `0f82cb8e`, so until #1783 lands its diff against `main` also shows #1783's change; its own change (`0f82cb8e..44bafde`) is this pull request's two commits and nothing else (byte-equal outside `docs/`, word-equal inside). It is armed only after #1783 has merged. 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
On the BIM4LCA housing terrain model, 23 elements carry an "Export to IFC As" of
IfcGeographicElementand Revit's own export writes every one of them as that entity, while rvt-rs wrote them asIfcFurniture(9),IfcBuildingElementProxy(12) andIfcSlab(2). The value was read but not honoured:EXPORT_OVERRIDE_TARGETShad noIfcGeographicElemententry, solookup_export_override_forfound nothing and each element kept its category's entity. This adds the target, limited to the four classes the export diagnostics name, with the element's own or its type's "IFC Predefined Type" where that is anIfcGeographicElementTypeEnumenumerator.The two floors are the ones #1772 opened with (Tags 1455094 and 1455321,
Floor:AP-nostopaikka.sijainti): they areIFCSLAB(..., '1455094', .USERDEFINED.)today and carry the sixQto_SlabBaseQuantitiesvalues Revit does not write.Evidence
The rule. An element of class
Floor,Furniture,PlantingorSpecialtyEquipmentwhose own or its type's "Export to IFC As" isIfcGeographicElementis written asIFCGEOGRAPHICELEMENT, withPredefinedTypethe element's own or its type's "IFC Predefined Type" where that is one of IFC4'sIfcGeographicElementTypeEnumvalues,TERRAIN,USERDEFINEDandNOTDEFINED, and$where it is not.What it covers, from
evidence/nordic-housing-terrain-concrete(rvt-rs's diagnostics for the same model name exactly these 23: "IfcGeographicElement on Furniture 9, IfcGeographicElement on Planting 9, IfcFlowTerminal on SpecialtyEquipment 3, IfcGeographicElement on SpecialtyEquipment 3, IfcGeographicElement on Floor 2"):class_sets_vs_ifc.txt: Revit's 65IfcGeographicElementare 0 same, 23 written as another class (IfcFurniture9,IfcBuildingElementProxy12,IfcSlab2) and 42 absent. The 23 are exactly the elements carrying the value; the 42 absent areToposolid(5),U2BicyclePost(6) andSub-Division(31), classes rvt-rs does not map at all and which this change does not touch.predefined_types_vs_ifc.txt: Revit'sIfcGeographicElementTypecarryTERRAIN30,USERDEFINED11,NOTDEFINED1, and on the 23 elements Revit writesUSERDEFINEDon 20 andNOTDEFINEDon 3. rvt-rs reads those same values as the element's own or its type's "IFC Predefined Type", so each of the 23 gets Revit's value: the 9 furniture, 6 planting, 3 specialty equipment and 2 floorsUSERDEFINED, the 3 plantingNOTDEFINED. Checked inrvt-rs.ifc: 1421668 isIFCFURNITURE(..., .USERDEFINED.), 1414066 and 1393277 areIFCBUILDINGELEMENTPROXY(..., $), 1405092IFCBUILDINGELEMENTPROXY(..., $), 1455094IFCSLAB(..., .USERDEFINED.).qtos_vs_ifc.txt: the six "rvt-rs quantities Revit does not write" are all on the two floors (Depth1,GrossArea2,GrossVolume1,NetVolume2), "Revit's Qto_SlabBaseQuantities: none". Traced in the code: every slab quantity is gated on the entity, not the class.add_slab_gross_areareturns atifc_type != "IFCSLAB",level_slabandshaped_floor_bodylikewise, andadd_slab_pitchis only reached through those two, so no slab set survives the entity change.Pset_SlabCommonis not written either:reference_set_kindsfiltersSTANDARD_PROPERTY_SETSbyapplies_to(ifc_type, ...)and the set applies toIFCSLABalone, andis_external_sethas no arm for the new entity.psets_vs_ifc.txt: Revit writes noPset_SlabCommonon the two floors, noPset_FurnitureTypeCommon.Referenceon the 9 furniture and noPset_BuildingElementProxyCommonon the 12 proxies; all three are in its "rvt-rs values Revit does not write" list, so they go with the class. The measurement will give the new total (49 today).type_objects_vs_ifc.txt: "entity disagrees: 23IfcGeographicElement" and "typed in ours: 501 of 501". Without a type entity the 23 would lose their type object, sotype_entity_forgainsIFCGEOGRAPHICELEMENT(tailPredefinedType, IFC4'sIfcGeographicElementTypedeclaring nothing afterElementType) andrevit_ifc_type_entity_namegains its revit-ifc name for the hashed GlobalId of a second type object of one type, as RE-417 did forIfcSolarDeviceandIfcTransportElement(commit 134db97). Each of the 23 is then typed by anIfcGeographicElementTypewithUSERDEFINEDorNOTDEFINED, both of which Revit writes.What it leaves out. The value is acted on for the four classes only (
OVERRIDE_CLASS_LIMITS), because that is what is measured; revit-ifc takes the entity from the value on anyIfcProduct(ExporterUtil.GetExportType), so the limit is the evidence's, not Revit's. An element of those classes carrying the value but no "IFC Predefined Type" is written with$: what Revit writes for one is not measured, so the target's default isNonerather than a guess. The 42IfcGeographicElementof Revit's export that rvt-rs does not write at all areToposolid,U2BicyclePostandSub-Division, unmapped classes outside this task. The threeIfcFlowTerminalonSpecialtyEquipmentare a different value with no target and stayIfcBuildingElementProxy, as they are; the diagnostics will still count them ("3 element(s) carry an "Export to IFC As" value the export does not apply ... IfcFlowTerminal on SpecialtyEquipment 3").The body is unchanged: geometry is chosen by the decoded class, not the entity, so the 23 keep the bodies they have today.
No other model moves. The office as-built diagnostics list only
IfcShadingDevice,IfcWallandIfcCoveringvalues, and the concrete housing as-built carries noIfcGeographicElementvalue at all, so no element of either changes class.The measurement this pull request must name, on both housing terrain models: of Revit's 65
IfcGeographicElement, how many rvt-rs writes as that class (23 are written as another class today:IfcFurniture9,IfcBuildingElementProxy12,IfcSlab2, and 42 are absent and stay absent), "rvt-rs quantities Revit does not write" 6 to 0, and no class count moving on any other model.Changes
src/ifc/category_map.rs: theIfcGeographicElementtarget, its class limit toFloor,Furniture,PlantingandSpecialtyEquipment, theIfcGeographicElementTypeEnumenumerators inOVERRIDE_ONLY_ENUMERATORS, and the doc comments.src/ifc/step_writer.rs:IFCGEOGRAPHICELEMENTtyped byIFCGEOGRAPHICELEMENTTYPE, and that entity's revit-ifc name for the hashed GlobalId.changelog.d/changed/1772-geographic-element.md: the fragment.docs/supported-profile.md,docs/evidence.md,docs/support-matrix.json: the honoured value and the evidence for it.No unit tests added; no test pins a value this moves.
What was not checked
I could not compile or run anything, so CI must confirm that the new target, the class limit and the enumerator list build and pass clippy, and that the writer emits
IFCGEOGRAPHICELEMENT(..., 'Tag', .USERDEFINED.)andIFCGEOGRAPHICELEMENTTYPE(..., .USERDEFINED.)with the attribute counts IFC4 declares. The measurement must confirm, on both terrain models, the class counts above, the six quantities going to 0, thePredefinedTypeof the 23 and of their type objects, the property sets that go with the old classes, and that no other model's class counts move. The timber terrain model's own diagnostics and export were not in the evidence I could read: its 23 elements are assumed to be the same as the concrete model's, and the measurement is what settles it.Measured
Unfiltered Measure 43100947234 with the held-out pairs (head
4d047255: #1787's commit and this change's on top, againstmainate8a99d03; rows registered on #1636 before it was read; 42 shards and both same-project gates pass). Only the four terrain models move for this change.IfcGeographicElementwritten as that classPredefinedTypesame as Revit on the 20USERDEFINEDelements of each housing terrain model and on the office terrain's one, differs 0; the 3 Revit writesNOTDEFINEDon are unset.IfcGeographicElement. The three enumerators equal IfcOpenShell's IFC4 schema tables.Still open
IfcGeographicElementthat rvt-rs does not write at all.NOTDEFINEDon.Depth) can come back once this lands: the floor it tripped on is no longer a slab.Testing
ed57e095) andmainis merged in here as7ccd202a, a clean merge:git diff origin/main 7ccd202a -- srcis byte-equal togit diff 438473f9 4d047255 -- src(index lines apart), and the delta outsidesrcis byte-equal to this branch's own commit's.mainalso holds feat(ifc): a hollow-section column's NetVolume is the volume Revit computes (#1016) (RE-247) #1773 and fix(ifc): an oblique mullion at an end no longer leaves its mullion out, a partner end beside one or a mullion across inside is kept, and a joint centred under a mullion across is hidden: the offices gain 107 to 108 NetSurfaceArea values and 3 of the 4 different at permit are Revit's (#1767) (RE-438) #1771 since the run; neither touchescategory_map.rsor the two lines ofstep_writer.rsthis changes. Measure 43108424934 measures this change again onmainate7ac68e7with everything else unlanded.Breaking changes
None.