Repository navigation
feat(ifc): a flat roof written as a slab carries its Qto_SlabBaseQuantities.Perimeter where its outline is square-cornered (#1208) - #1785
Merged
Conversation
…t computes (RE-247)
…nd none different (#1016)
…n axis its Span and Length (#1016)
…ingElementBaseQuantities.Depth (#1165)
…t too (#1165) Read on Revit's export of the BIM4LCA office as built: on the four such openings read, Width, Height and Depth are 100/2100/810 and 300/2100/1210 mm, the same way round as on any rectangular opening. Height is the outline's (2.1000 m on all four). Width is left out: the outline along the wall is 0.1000 and 0.3002 m, 0.2 mm off Revit's on two of the four.
…tities.Perimeter (#1208)
… gets no Perimeter (#1208) A sketch arc reaches the outline as chords within 0.0005 ft of it, so the polygon's length is short of the arc's by about a third of sagitta over radius, which the measurement would read as different wherever arcs are more than a small share of the loop. No corner between two chords is square, so an outline whose corners are all right angles holds no arc. Found by the second read; no measured roof has an arc.
Closed
7 tasks done
DrunkOnJava
marked this pull request as ready for review
November 11, 2026 21:40
…ter-2 # Conflicts: # docs/evidence.md # docs/supported-profile.md
7 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Nov 12, 2026
…Area where its outline is square-cornered (#1016) (#1786) ## Summary `Qto_OpeningElementBaseQuantities.Area` is now written on an opening a floor's sketch makes where its outline is not a rectangle, and on no other unfilled opening. On the BIM4LCA office as built that is the 5 openings the census lists as missing, and the 31 rectangular sketch openings, on which Revit's export writes no `Area`, keep none. ## Evidence The census (`evidence/nordic-office-as-built/qtos_vs_ifc.txt`): `Qto_OpeningElementBaseQuantities.Area: 5, equal 0, different 0, missing 5` (line 42), all on `IfcOpeningElement` x5 (line 123); 3 more on openings rvt-rs does not write (line 7) and 1 on a repeated key (line 78). Matching the two files of the office by Tag, the 5 are the same five objects: **3190490, 3143563, 3146720, 3147725, 3151525**, all named `Floor:VP-1:418397` in both files, each an opening of a floor's sketch (RE-151) that rvt-rs already writes, with its box and its `Reference` values equal. - **What Revit's value is.** In every one of the 13 opening quantity sets of Revit's export that hold an `IFCQUANTITYAREA`, the `Area` is the area of the polygon the opening's body extrudes: e.g. 3.4096666 m2 for opening 3190490, whose profile is a 890 x 3890 mm rectangle less a 230 x 230 mm notch (3.409662 m2 from rvt-rs's own outline, read in its file's metres), and 9.634416 m2 for 3146720 against 9.634423 m2 from that outline. The same holds for the four roof hatch openings (tag 2991742), the two wall profile openings (1671974) and the door opening that cuts two walls (1623922), which this change does not touch. - **What tells the 5 apart.** rvt-rs writes 36 openings of a floor's sketch on this file. Of those, exactly 5 have an outline that is not a rectangle (a 6-corner outline with a notch, closed by a repeated last point) and 31 are 5-point rectangles — and the 5 are Revit's 5, the 31 Revit's 31, on which Revit writes `Width` and `Height` and no `Area`. Nothing else separates them: the 5 sit in five different floors (1384047, 1451421, 1457693, 1457785, 1474132) among openings of the same name, the same kind and the same depth. - **A second model against the rule.** The housing as built's rvt-rs export holds 11 openings of a floor's sketch (`Floor:VP-2`, `Floor:AP-1`, `Floor:VP-1.OL`, `Floor:VP-1.KL`), all 5-point rectangles, and its census misses no `Area` at all: the rule adds nothing there. - **Rule.** On an opening a floor's sketch makes (`IfcEntity::VoidOpening`, not a face-hosted cut) whose outline has more than four corners, write `Area`, the outline's shoelace area in square feet, as the wall profile opening's `Area` is written (RE-381). Read from evidence: 5 of 5 equal on the model measured, none on the 31 Revit gives none. - **What it leaves out.** A quadrilateral that is not a rectangle (no measured export has one, and nothing tells it from the 31); every other kind of unfilled opening (a roof's hatch, a curtain wall's cut, a cabinet's, a door's in a further wall, a wall's own profile opening), which have their own rules; and a door's or window's opening. It also does not touch the existing 3 `Area` values rvt-rs writes on the timber office where Revit writes `Width` and `Height` instead (RE-402) — that is the wall profile opening's rule, not this one. - **`--no-base-quantities`.** The value is written only where rvt-rs writes base quantities at all, the gate a door opening's `Depth` and a wall profile opening's `Area` have (RE-242): with the flag every `Qto_` set is empty and no opening quantity is written. ## Changes - `src/ifc/step_writer.rs`: in the loop that writes an opening of a floor's sketch, a boolean of whether any `Qto_` set still holds quantities, and, on such an opening whose outline has more than four corners, its `Area` as `IfcQuantityArea`, the outline's area (the shoelace expression the wall profile opening's `Area` already uses). - `docs/supported-profile.md`, `docs/evidence.md`: the two sentences that list the openings' base quantities now say the floor sketch opening's `Area` is written. - `changelog.d/fixed/40-floor-void-opening-area.md`. ## 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_OpeningElementBaseQuantities.Area` equal, before | after | different | |---|---:|---:|---:| | Office as built | 0 of 5 | 5 of 5 | 0 | | Office at permit | 0 of 6 | 6 of 6 | 0 | | Timber office as built, at permit | 0 of 12 each | 12 of 12 each | 0 | - "quantities Revit does not write" is unchanged on every model, the timber office's 3 included. - Before the narrowing Core Interior gained 20 `Area` sets on floor sketch openings that are not rectangles, which no Revit value scores (its export writes no base quantities); after it none is written there. - Sample saves: 12 openings gain the value, 10 in Snowdon Towers Architectural and 2 in Structural. - **Narrowed after the second read:** an outline with a corner that is not a right angle now gets none. Revit takes the area from the sketch's curves, and an arc reaches the outline as chords within 0.0005 ft, whose polygon is short of it by more than the scorer's 1e-5 on a small radius. The counts above, Core Interior's 20 and the samples' 12 included, are from before the narrowing. **After it (the final run):** all four office counts are kept (5 of 5, 6 of 6, 12 of 12, 12 of 12, none different), and Core Interior's export is byte-identical: none of its 20 openings passes, so no witness observation moves and no refresh is needed. - **Tightened again:** the `Area` is written only where the outline has more than four square corners, counted without the joints it runs straight through, so a rectangle one of whose edges is two sketch lines (five points, four corners) is left out: whether Revit calls that loop a rectangle is not measured. The helper that counts them is pure and has seven tests of the ways it can fail. ## Still open - A rectangle gets no `Area` (Revit's export writes its `Width` and `Height` there), and a four-cornered outline that is not a rectangle is left out as unmeasured. Stack: this is change 7 of 7; each branch holds the ones before it, so its own diff is its last commits until those land. First draft: #1758, then #1780. ## 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: the eight batch changes before this one landed, with #1769, #1771, #1791 and others. This head, `422e9432`, is `main` at `000fc1af` merged in. The merge resolved one conflict in `src/ifc/export_content.rs`, where this pull request's own commits rewrite the corner helper #1785 added, by taking this branch's side; the resolved `export_content.rs` and `step_writer.rs` are byte-equal to the files Measure 43108424934 measured at `3f2a04c4`, and the change against `main` is this pull request's own three commits (byte-equal outside `docs/`, word-equal inside). - Because a source conflict was resolved, this head has an unfiltered Measure of its own against `main`, with kept exports: run 43133784518, rows registered on #1636 before it is read. Its same-project verdict and the advisory semantic verdict land on this head. - Autodesk's sample saves have no Revit export in Measure, so nothing scores them; the kept exports are read by element instead. In run 43113322070 (all nine batch changes on `main`) the only sample saves that gain this value are the two Snowdon Towers 2024 saves, Architectural 10 and Structural 2 openings, with no existing value changed or removed. Revit's own IFC4 export of the architectural file was made without base quantities, so those 12 `Area` values are written where no Revit export can check them. ## 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 office as built Revit's export writes
Qto_SlabBaseQuantities.Perimeteron 29 objects where rvt-rs writes none. Thirteen of the office's 42 slab perimeters are already counted apart as Revit's feet-unscaled defect (RE-235 §5,REVIT_DEFECTSintools/re/qtos_vs_ifc.py); the other 29 are scored missing. Reading the 42 values against the profile each slab's body extrudes splits them cleanly in two, and the split is the element's class: every.ROOF.slab's value is the outline's length in the file's unit, and every floor's, base slab's and stair landing's is that same length in feet. This writes the roof ones — 10 of the 29 — and leaves the rest out with the reason stated.Evidence
I mapped each of the 42
Qto_SlabBaseQuantitiessets ofrevit.ifcto itsIfcSlab(through itsIFCRELDEFINESBYPROPERTIES) and to theGrossAreawritten beside itsPerimeter, then read the profile the slab's body extrudes. The two readings of one value differ by 304.8, so each of the 42 is unambiguous against its area:.ROOF.slabs4*sqrt(area).FLOOR./.BASESLAB./.LANDING.slabs2*sqrt(pi*area)4*sqrt(area)Checked to the last digit where the profile is a plain outline in the export:
Basic Roof:KA-11461758 (area 261.2999 m²): outline 188,699.718 mm of lines plus two quarter arcs of radius 2925 mm, 197,888.88 mm against Revit's 197,888.87629548809.Basic Roof:YP-12991742 (area 614.7886): 158,585.00 mm against 158,584.9999999993.Basic Roof:YP-43165182 (area 491.8956): a 26,385 by 18,643 rectangle, 90,056.00 mm against 90,056.0000000018.Floor:VP-11384047 (area 1017.0252): outline 174,303.6 mm plus its 6 holes 42,700.7 mm, 217,004 mm, against 743.65029082242927 read as feet, 226,664 mm — the export counts a hole's outline in its value.Floor:AP-21439250 (a landing, area 16.6319): 2×(2,760.48 + 6,025) = 17,570.95 mm, against 57.64750022310872 ft = 17,571 mm.So the rule is narrowed to the class the evidence carries: a roof whose
GrossAreathe export writes (the scopeadd_slab_gross_areaalready uses for a flat roof: drawn as one extrusion of its sketch's outline, not sloped, its type's layers filling its body) and whose profile has no holes gets itsPerimeter, the length of that outline. Arcs are tessellated at the profile's own 0.0005 ft (Ka-1's two arcs make 4.6% of the outline, so the polygon reads within 1e-6 of the arc length, well inside the census's 1e-5).What stays without, and why:
Non-Monolithic Landing3058084, whose value is the outline in mm (4,688.14 mm for 1.3804 m²): rvt-rs writes noQto_SlabBaseQuantitieson a landing at all (RE-295), so there is nothing to add it to;profile_outline_lengthreturnsNoneforArbitraryWithVoids.Not a settled question: the maintainer's RE-235 §5 leaves out "a floor's
Perimeter" only, issue #1208 (open) listsPerimeteramong the slab quantities not written with the reason "Revit writesPerimeterin feet in a millimetre file", which holds for the floors and not for the roofs; no report or decision covers a roof's, and no merged pull request writes it.Changes
src/ifc/export_content.rs:add_slab_gross_areapushesPerimeter(asPropertyValue::PositiveLengthFeet) on a roof; a newprofile_outline_lengthreturns the length of a closed polyline profile andNonefor a profile with voids or another shape. The function's comment now says a floor's is left out and a roof's is written, with what stays without.changelog.d/added/1208-roof-perimeter.md: the new fragment.docs/supported-profile.md,docs/evidence.md: the roof'sPerimeterin the two lists of the base quantities written.No test pins the set (
rg Qto_SlabBaseQuantities tests/finds nothing), so no test is edited.Measured
One Measure run scored this change together with nine others it was drafted beside (run 43086493417, head
f5f54467, base5e3ac5b0: 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 onmainas 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, head53c19487againste8a99d03, 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.Qto_SlabBaseQuantities.Perimeterequal, beforeStill open
Perimeterstays out: Revit's export writes it in feet in a file whose unit is millimetres (RE-235 section 5).Stack: this is change 6 of 7; each branch holds the ones before it, so its own diff is its last commits until those land. First draft: #1752, then #1774.
Testing
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.mainhas moved since those runs (perf(research): a face cut by its trim is cut across at the chord's v steps and at the v of the trim's own steps and cusps, and the triangles of 25 of 126 exports fall (#1737) (RE-437) #1769 re-meshes trimmed faces, and the six batch changes before this one landed). This head,99db61c5, ismainat1fe64d99merged in, with two docs lines merged word by word; its change againstmainis this pull request's own two commits and nothing else (byte-equal outsidedocs/, word-equal inside). Measure 43108424934 measured the nine batch changes together onmainwith perf(research): a face cut by its trim is cut across at the chord's v steps and at the v of the trim's own steps and cusps, and the triangles of 25 of 126 exports fall (#1737) (RE-437) #1769 (3f2a04c4againste7ac68e7, rows registered on List the shipped rules that rest on one project, and the second model that could test each #1636 first): every count above repeats, and the same-project gates pass.Audit-honesty checklist
changelog.d/Legal and contribution hygiene
Breaking changes
None.