Skip to content

fix(ifc): a floor sketch opening that is not a rectangle carries its Area where its outline is square-cornered (#1016) - #1786

Merged
DrunkOnJava merged 13 commits into
mainfrom
feat/1016-floor-opening-area-2
Nov 12, 2026
Merged

DrunkOnJava merged 13 commits into
mainfrom
feat/1016-floor-opening-area-2

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

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

Audit-honesty checklist

  • Docs state what this change writes and what it leaves out
  • A changelog fragment under changelog.d/
  • No emojis, private paths or personal data in committed files
  • Limits are in the body above and in the code's doc comments

Legal and contribution hygiene

  • Apache-2.0
  • 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.
  • No fixture with real-world personal data

Breaking changes

None.

…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.
… 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.
…gle gets no Area (#1016)

Revit takes the area from the sketch's curves; an arc reaches the outline as
chords within 0.0005 ft of it, so its polygon is short of that area by more
than the measurement's tolerance on a small radius. No corner between two
chords is square, so only an outline whose corners are all right angles is
written. Found by the second read: the measured outlines hold no arc, and the
unscored ones (Core Interior's 20, Snowdon Towers' 12) are not known to.
…ur square corners, counted without straight joints (#1016)

The outline's raw point count let a rectangle one of whose edges is two
sketch lines through (five points, four corners), and whether Revit calls
that loop a rectangle is not measured. The helper now returns the number of
square corners, or none where a corner is not square, and the opening's Area
is written above four; a roof's Perimeter needs four. The helper is pure and
has seven tests of the ways it can fail: an arc of chords, a slanted edge, a
spike, a split edge, repeated points, a turned or reversed outline, and no
outline. Found by the second read.
…ng-area-2

# Conflicts:
#	docs/evidence.md
#	docs/supported-profile.md
#	src/ifc/export_content.rs
@DrunkOnJava
DrunkOnJava merged commit 69f56e5 into main Nov 12, 2026
38 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/1016-floor-opening-area-2 branch November 12, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant