Skip to content

feat(ifc): give the opening a door cuts in a second wall its Qto_OpeningElementBaseQuantities.Depth (#1165) - #1755

Closed
DrunkOnJava wants to merge 2 commits into
mainfrom
pilot/28-openingelement-depth
Closed

DrunkOnJava wants to merge 2 commits into
mainfrom
pilot/28-openingelement-depth

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

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.

What was not checked

  • Nothing was compiled or run here: CI's build, clippy and real-file tests must pass, and the measurement must show Qto_OpeningElementBaseQuantities.Depth on the office as built going from 283 equal and 25 missing to 308 equal, none missing and none different, with rvt-rs quantities Revit does not write still 0 (two of the 25's openings Revit's export lacks are written anyway and carry the set, which the census does not score).
  • The value rule rests on the door's second-wall opening being the rectangle rvt-rs already writes, extruded across that wall, on one read opening (#77141) plus RE-338's box agreement on all 25 and RE-321/RE-244's convention that Depth is the extrusion's depth. If the measurement finds any of the 25 different, the value rvt-rs holds for it is wrong and the change must be narrowed (a per-element rule nothing read gives today) or dropped.
  • No test or probe under tests/ or probes/ references WallCutOpening or Qto_OpeningElementBaseQuantities; if a real-file test pins an export's entity counts, this adds one IFCELEMENTQUANTITY and one IFCRELDEFINESBYPROPERTIES per door's second-wall opening.

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.

…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.
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Superseded by #1779: the same change on a fresh branch on today's main, with the measured rows in its body.

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.
@DrunkOnJava
DrunkOnJava deleted the pilot/28-openingelement-depth branch November 12, 2026 02:13
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