Repository navigation
feat(ifc): write the base quantities of a door's opening in a second wall (#1165) - #1749
DrunkOnJava wants to merge 1 commit into
Conversation
|
Closing in favour of #1755, which covers the same openings (#1165). Read against Revit's export of the BIM4LCA office as built, on the openings a door cuts in a wall across its own:
So on these four Revit's three quantities are the ones the existing rule for a rectangular opening already computes, unswapped: Follow-up for #1755 once its (Edited: the first version of this comment called Revit's |
… 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.
Summary
Revit's IFC4 export writes
Qto_OpeningElementBaseQuantities(Width,HeightandDepth) on the opening a door cuts in a wall besides the one it is hosted in. rvt-rs writes that opening (RE-321, RE-338) but no quantity set on it, becausedoor_cutsetsquantities: false. This change writes the set, with Revit's values and with Revit's own assignment of the three names:Widththe wall's thickness,Heightthe opening's height,Depthits extent along the wall.On the office as built that closes
Qto_OpeningElementBaseQuantities.Heightand.Widthon 25 of the 56 objects the census reports missing, and.Depthon 25 of its 25 missing (the same openings). What stays without is stated below.Evidence
The task is real for these objects. The 56 are not the door openings RE-235 §5 already leaves out: the census counts those apart (187 of
Heightand 187 ofWidth,REVIT_DEFECTS, keyed by the class of what fills the opening,docs/counted-apart.mdqto-known-wrong). The 152 scored objects split asWidth= the outline's extent along the wall andHeight= its height are already written (step_writer.rs, theWallCutOpeningblock; RE-321 §3, RE-338);VoidOpening, RE-151) + the 25 openings rvt-rs writes for a door cutting a second wall (RE-338).The split is confirmed by the same file's other lines:
.Depthis missing on exactly 25 objects (the floor voids have noDepthin Revit's export, andDepthmissing 25 = the 25 door openings),.Areais missing on 5 (the 5 floor voids whose loop is not a rectangle, out of the 36 of RE-321 §1), andunfilled_openings_vs_ifc.txtwrites 25 of the 39IfcDoor in IfcWallopenings, so exactly those 25 are census-visible.The rule, from the office's two IFC files (matched by
Tag). Revit's opening for a door in a second wall is a box:Tools/re-free reading of the STEP, four openings of three doors:WidthHeightDepthThe body there is the wall's section (thickness × height,
IFCARBITRARYCLOSEDPROFILEDEF300 × 2100 in #147548) swept along the door's width (depth 1210 in #147553), andWidth/Heightare that profile's X and Y extents whileDepthis the extrusion's depth. rvt-rs'sCutfor the same opening holds exactly those three extents (along= the door's width,left= the wall's thickness,up= the height), and itsIfcOpeningElementmatches Revit's box within 0.01 ft on all 25 (unfilled_openings_vs_ifc.txt). SoWidth=thickness_feet,Height= the outline's Y extent,Depth= its X extent, which is the same three numbers as the rectangle layout withWidthandDepthexchanged.A second construction exists and contradicts nothing here: on door 1436505's openings in walls 1493966 and 3490093 Revit writes
Width1210 (the door's width),Height2100 andDepth3048, ten feet across about a plane nothing read gives (RE-338 §5,door_second_wall_parallel_to_door_wall). Those openings are not written by rvt-rs at all, so they stay out of both the rule and the census's scored objects.What stays out, and why.
WidthandHeighton them, and they are the extents of the hole's profile (Tag 1420820: RevitWidth3455.14,Height5609.77 mm against the loop's two extents), but in the profile frame of that opening: for that opening the extrusion's placement has ref direction(0,-1,0)(#82775), so itsWidthis the loop's Y extent, while the notched void beside it (Tag 3190490) has ref direction(1,0,0)(#82792) and so would read the loop's X extent. Both hosts'IfcLocalPlacements are world-aligned, so the rotation is Revit's per-opening choice, and rvt-rs's own outline for the void lies in its identity frame (step_writer.rs, theVoidOpeningblock). Nothing rvt-rs reads gives that rotation, so a rule here would be right on some openings and swapped on others. Left out; it needs the opening's profile frame, which is not read.Areaonly (Tag 3190490: 3.4096666 m², the loop's area), notWidth/Height, and rvt-rs writes neither. Which of Revit's floor voids takesWidth/Heightand whichAreais seen on two of the 36 only, so no discriminator is proposed.qto-openings-unwritten(Unfilled openings Revit's export writes and rvt-rs does not: a door's further cuts, curtain-wall cuts and fire hose cabinets (591 values on the office) #1165).No maintainer decision leaves these 25 out:
docs/counted-apart.mdcounts them apart only until #1165 writes them ("written where the measurement is exact and its values counted in W7"), and RE-338 §3 records them as missing, not as a Revit defect.Changes
src/ifc/wall_cut_openings.rs:door_cutsetsquantities: true(with the reason), so the opening it builds gets Revit's set.src/ifc/step_writer.rs: theWallCutOpeningquantities block picks the door's layout when the cutter atreference_fromis anIfcDoor(only that kind has a door there — a rectangular opening's is its wall, a cabinet's and a curtain wall's their own element) and writesWidth= the wall's thickness,Height= the outline's height,Depth= its extent along the wall; every other kind keeps the layout it had. The lookup ismodel.entities.get(..).is_some_and(..), so a missing index writes nothing.src/ifc/entities.rs: thequantitiesfield's doc says which of the two layouts the opening gets.changelog.d/added/door-second-wall-opening-quantities.md: the new fragment.docs/supported-profile.md: the one sentence that says what an opening a door cuts in a second wall gets now names the quantity set.Not touched: no test pins these values (
tests/unfilled_openings.rscompares Tags and hosts only, and the witness observations are Core Interior's, not the office's), sotests/is unchanged.What was not checked
-D warnings: the new code is amatches!with a guard insideis_some_andonOption<&IfcEntity>, and anif/elseproducing oneVec<Property>.differentstill 0 forQto_OpeningElementBaseQuantities.Height,.Widthand.Depth, nowidth/depth/heightextra (rvt-rs quantities Revit does not write), and the missing counts falling by 25 on the office as built (56 → 31 forHeightandWidth, 25 → 0 forDepth). If any of the 25 is Revit's ten-foot construction or sits in a wall turned off the model axes, its value will differ, and the rule will have to be narrowed further.docs/release-1.0-criteria.mdare a previous measurement's and were not re-based; this change's Measure run is the one to publish.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.